[BUG] Cargo local mirrors reject recorded shallow boundaries #157

Closed
opened 2026-10-17 10:08:50 +02:00 by erikinkinen · 3 comments
Owner

Summary

Cargo cannot load a dependency from a local mirror that preserves its original
shallow boundary. The fresh cache rejects the main reference before compilation.

Reproduction

  1. Select Kernel 5d6264ed and lib-owned-region b8322673 through the generated
    Cargo source pipeline.
  2. Preserve the library checkout’s recorded shallow boundary at db505f76 and
    expose the selected commit through its private main mirror.
  3. Run Cargo metadata with the normal file-only transport and a fresh Cargo home.

Observed once in the first local consumer run; no unchanged rerun was attempted.

Expected and actual behavior

Cargo should resolve the exact selected commit while preserving original objects,
shallow boundaries, manifests and source checks.

Instead, Git reports:

warning: rejected refs/remotes/origin/main because shallow roots are not allowed to be updated

Cargo then reports that it cannot locate origin/main and exits 101. The mirror
already points main at the selected commit. Formatting, compiler and tests are
not reached.

Environment and identity

  • Kernel: 5d6264ed55afd543359cd047866921bda8804148.
  • Library: b83226731aa206d41fd438d7fbe3c72c7a46ec6e.
  • Integration helpers: 5c86f65b67e05da9ee1d7f0cbe1d72fb851ad43d, unchanged in
    d8091e9ca2038ab12635280787538790756e7130.
  • Linux x86-64, Cargo 1.97.1, Git CLI fetch, fresh generated workspace and cache.
  • Transport is restricted to selected local mirrors; no compiler or VM runs.

Evidence and prior checks

The full failed metadata output and cleanup result are retained. Source bodies,
Git objects, boundaries and canonical locks remain unchanged. The standalone
library checks pass; this failure occurs when it becomes a dependency. Kernel’s
separate CI reports success, so this is not evidence that every checkout fails.

Tracking

Related: main-branch dependency resolution
and the shared allocator.

  • Resolve a genuine shallow dependency through real Cargo without replacing
    commits, removing boundaries or enabling additional transport.
  • Preserve nonshallow behavior and reject altered source or tool routes.
  • Complete the affected Kernel consumer checks with the corrected handoff.
## Summary Cargo cannot load a dependency from a local mirror that preserves its original shallow boundary. The fresh cache rejects the main reference before compilation. ## Reproduction 1. Select Kernel `5d6264ed` and lib-owned-region `b8322673` through the generated Cargo source pipeline. 2. Preserve the library checkout’s recorded shallow boundary at `db505f76` and expose the selected commit through its private main mirror. 3. Run Cargo metadata with the normal file-only transport and a fresh Cargo home. Observed once in the first local consumer run; no unchanged rerun was attempted. ## Expected and actual behavior Cargo should resolve the exact selected commit while preserving original objects, shallow boundaries, manifests and source checks. Instead, Git reports: ```text warning: rejected refs/remotes/origin/main because shallow roots are not allowed to be updated ``` Cargo then reports that it cannot locate `origin/main` and exits 101. The mirror already points main at the selected commit. Formatting, compiler and tests are not reached. ## Environment and identity - Kernel: `5d6264ed55afd543359cd047866921bda8804148`. - Library: `b83226731aa206d41fd438d7fbe3c72c7a46ec6e`. - Integration helpers: `5c86f65b67e05da9ee1d7f0cbe1d72fb851ad43d`, unchanged in `d8091e9ca2038ab12635280787538790756e7130`. - Linux x86-64, Cargo 1.97.1, Git CLI fetch, fresh generated workspace and cache. - Transport is restricted to selected local mirrors; no compiler or VM runs. ## Evidence and prior checks The full failed metadata output and cleanup result are retained. Source bodies, Git objects, boundaries and canonical locks remain unchanged. The standalone library checks pass; this failure occurs when it becomes a dependency. Kernel’s separate CI reports success, so this is not evidence that every checkout fails. ## Tracking Related: [main-branch dependency resolution](https://git.erikinkinen.fi/erix/integration/issues/142) and the [shared allocator](https://git.erikinkinen.fi/erix/lib-owned-region/issues/1). - [x] Resolve a genuine shallow dependency through real Cargo without replacing commits, removing boundaries or enabling additional transport. - [x] Preserve nonshallow behavior and reject altered source or tool routes. - [x] Complete the affected Kernel consumer checks with the corrected handoff.
Author
Owner

0055469 adds a checked script route only when the selected transport contains a shallow boundary. It uses the existing pinned Bash and Git and passes --update-shallow to fetch; original objects, boundaries and transport limits stay intact. Ordinary sources keep their direct Git route. The consumer descriptor now checks the script and interpreter as well.

[0055469](https://git.erikinkinen.fi/erix/integration/commit/005546955edfcfaeb5b4fea0cd66ee3ad1470781) adds a checked script route only when the selected transport contains a shallow boundary. It uses the existing pinned Bash and Git and passes --update-shallow to fetch; original objects, boundaries and transport limits stay intact. Ordinary sources keep their direct Git route. The consumer descriptor now checks the script and interpreter as well.
Author
Owner

The shallow-dependency regression now passes through real Cargo, including the offline consumer handoff. It preserves the selected commit and shallow boundary; the ordinary route and altered-tool refusals pass too. All 73 targeted tests pass at 00554695. The affected Kernel run is underway with the corrected helpers; that final criterion remains open.

The shallow-dependency regression now passes through real Cargo, including the offline consumer handoff. It preserves the selected commit and shallow boundary; the ordinary route and altered-tool refusals pass too. All 73 targeted tests pass at `00554695`. The affected Kernel run is underway with the corrected helpers; that final criterion remains open.
Author
Owner

The corrected handoff in 00554695 now completes the affected Kernel consumer checks at 5d6264ed with lib-owned-region 3568441c. All four unit profiles, both doctest selections, strict Clippy, private Rustdoc and the default build pass without warnings. The original shallow failure remains retained. All three criteria are checked; closing this defect.

The corrected handoff in `00554695` now completes the affected Kernel consumer checks at `5d6264ed` with lib-owned-region `3568441c`. All four unit profiles, both doctest selections, strict Clippy, private Rustdoc and the default build pass without warnings. The original shallow failure remains retained. All three criteria are checked; closing this defect.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:19 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/integration#157
No description provided.