Fetch crates through importCargoLock with an accepted User-Agent - #25
Merged
Merged
Conversation
fetchCargoVendor hashes Cargo.lock, so the release version bump in bce8de4 broke every build until re-hashed. importCargoLock needs no hash; it only needs a fetchurl whose User-Agent crates.io accepts. Refs rainlanguage/rainix#377 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN
|
Warning Review limit reachedNext included review available in 18 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merged
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.
Refs rainlanguage/rainix#377. Replaces the approach in #24.
What
cargoDepsisimportCargoLockagain, called with afetchurlthat appends--user-agent Nixpkgsto curl.fetchCargoVendorand its hash are gone.Why
#24 moved crate fetching to
fetchCargoVendor, whose hash coversCargo.lock. The automated release commit that followed (bce8de4, the crate version bump) changed one line ofCargo.lockand the build has failed on a hash mismatch since; every consumer that bumped itsraininput today had to pin 91d70ac instead of main.importCargoLockneeds no hash, so a version bump cannot break it. Its only problem was the User-Agent: crates.io answers 403 to anything starting withcurl/, which is what nixpkgsfetchurlsends, and accepts any other value. Overriding the agent on the fetcher fixes the download; the crate tarballs are fixed-output derivations keyed by content hash, so every cache hit is unchanged.QA
nix build .#rainon this branch, on top of bce8de4, fetched all 762 crate tarballs and produced the binary; the fetch log for alloy-provider 1.8.3 shows the download completing from the API URL that returns 403 under the default agent. bce8de4 itself fails to build on main.After merge, consumers can point their
raininput at main again.🤖 Generated with Claude Code
https://claude.ai/code/session_01V8ViHcKLVk2YoS2joH4HdN