Skip to content

feat: propagate timestamps of source packages during resolves.#5809

Merged
baszalmstra merged 4 commits intoprefix-dev:feature/lockfile-v7from
baszalmstra:propagate-source-timestamp
Apr 7, 2026
Merged

feat: propagate timestamps of source packages during resolves.#5809
baszalmstra merged 4 commits intoprefix-dev:feature/lockfile-v7from
baszalmstra:propagate-source-timestamp

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

@baszalmstra baszalmstra commented Apr 2, 2026

When the lock file is recomputed (e.g. because a binary dependency was added or a channel was appended), source packages whose metadata hasn't changed no longer receive a fresh timestamp. Instead, their validated timestamp from the previous lock file is propagated as a hint into the re-solve, producing a source-record cache hit and preserving the original timestamp. This avoids unnecessary rebuilds of unchanged source packages.

The satisfiability checking phase was restructured to run source metadata validation in parallel with package verification (via futures::join!). Previously these ran sequentially. A new PlatformSatisfiabilityOutcome struct carries both the verification result and a side-channel of validated source timestamps back to the caller. For solve groups, timestamps from multiple environments are merged by taking the maximum when they disagree on the same output.

A PlatformVerificationSetup struct was introduced to compute channel config, variants, virtual packages, and build environment once per platform instead of duplicating this logic across partial-record resolution, source validation, and package verification.

Also fixes a regression where the should_disregard_conda guard was accidentally removed, causing ChannelsExtended and pypi-only unsatisfiability to skip per-platform checks entirely.

How Has This Been Tested?

Six deterministic integration tests covering timestamp reuse across different re-lock scenarios, using mock channels with explicit package timestamps and in-memory build backends.

  • Unrelated binary dependency added: source timestamp preserved
  • Source metadata changed (version + host-deps): timestamp advances
  • Explicit pixi update --package with newer package published to mock channel: timestamp advances
  • Sibling source package changed: unchanged sibling keeps its timestamp
  • Two environments in a shared solve group: both preserve source timestamp after adding a binary dep
  • Lower-priority channel appended (ChannelsExtended): source timestamp preserved

Unit tests for the solve-group timestamp merge logic cover distinct variants and max-of-conflicting behaviour.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude Code (Opus 4.6)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added sufficient tests to cover my changes.

@baszalmstra baszalmstra force-pushed the propagate-source-timestamp branch from b0eafc0 to 3116ed3 Compare April 2, 2026 12:02
Copy link
Copy Markdown
Contributor

@hunger hunger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@baszalmstra baszalmstra closed this Apr 2, 2026
@baszalmstra baszalmstra force-pushed the propagate-source-timestamp branch from 3116ed3 to 10a267d Compare April 2, 2026 14:24
@baszalmstra baszalmstra reopened this Apr 2, 2026
@baszalmstra baszalmstra force-pushed the propagate-source-timestamp branch 2 times, most recently from 0c93fad to c3290c0 Compare April 2, 2026 14:43
Comment thread pr-description.md Outdated
@baszalmstra baszalmstra force-pushed the propagate-source-timestamp branch 6 times, most recently from 08513a7 to d34dfd5 Compare April 2, 2026 16:06
…c, add solve-group and channel-extended coverage

- Restore the `should_disregard_conda` check in outdated.rs that was
  accidentally removed, causing ChannelsExtended and pypi-only unsat
  variants to skip per-platform satisfiability (losing validated
  source timestamps).
- Extract `merge_source_timestamp_hints` into a static method with
  unit tests for distinct-variant and conflict-dropping behaviour.
- Replace all `thread::sleep` calls in timestamp tests with
  deterministic host-dep timestamps via `PackageBuilder::with_timestamp`.
  The explicit-update test rewrites mock repodata to publish a newer
  package between locks.
- Add integration test for solve-group environments sharing a source
  package (exercises merge_source_timestamp_hints end-to-end).
- Add integration test for channel-appended (ChannelsExtended) with
  source timestamp preservation.
@baszalmstra baszalmstra force-pushed the propagate-source-timestamp branch from d34dfd5 to a7fe0c1 Compare April 7, 2026 07:11
@baszalmstra baszalmstra marked this pull request as ready for review April 7, 2026 07:49
@baszalmstra baszalmstra merged commit d0b3750 into prefix-dev:feature/lockfile-v7 Apr 7, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants