Repository navigation
fix(cargokit): keep precompiled snapshot staging paths under Windows MAX_PATH - #29
Merged
iota9star merged 2 commits intoSep 30, 2026
Merged
Conversation
The staging directory name embedded the full 64-hex generation key on top of the v2/<key>/snapshots/ parent that already carries it; together with the staging id, the createTempSync suffix and the asset's relative path this pushed long cache roots past the ~260-char limit dart:io enforces (no \\\\?\ prefixing), failing every precompiled download on Windows. Truncate the embedded key to 16 hex chars: still diagnostic and collision-free within the generation directory, while the authoritative full key remains the parent directory name and the manifest. Legacy cache-root-level <key>.staging-*/<key>.previous-* orphan matching in hasAnyState is untouched and keeps matching old layouts.
…tion The store now names snapshot staging directories with the 16-hex truncation of the generation key; pin that contract in the rename assertion (the published snapshot directory still carries the full key).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Keep CargoKit precompiled-snapshot staging directory names under the Windows
MAX_PATH(~260 char) limit by truncating the embedded generation key to its 16-hex prefix.Why
PrecompiledAssetStorecreates staging directories asv2/<key>/snapshots/<key>.staging-<id>-<tmp>/.... Embedding the full 64-hex key a second time — plus the staging id, thecreateTempSyncsuffix and the asset's relative path — pushes long cache roots past the ~260-char limit thatdart:ioenforces on Windows (it does not apply\\?\prefixing), so snapshot publication fails with path-too-long errors on machines with deep user-profile/cache paths.The 16-hex prefix keeps the name diagnostic and collision-free within the generation directory; the authoritative full key remains the parent directory name and the manifest.
Changes
cargokit/build_tool/lib/src/precompiled_asset_store.dart: truncate the key in the staging temp-dir prefix to 16 hex chars.cargokit/build_tool/test/precompiled_asset_store_test.dart: align the staging-name assertion with the truncation.Testing
dart test test/precompiled_asset_store_test.darton Windows: all staging/snapshot rename assertions pass. (A fewfresh processes … tampertests time out flakily on this machine on cleanmainas well — pre-existing, unrelated to this change.)Follow-up to the CI discussion in #22 — this is another independent fix carried in our fork, split out per the rebase note there.