Support lock files for reproducible builds#12
Open
yzx9 wants to merge 1 commit into
Open
Conversation
PixiBuilder and UvBuilder now accept a lock file (uv.lock / pixi.lock) via new lockContent/lockFile/lockUrl methods that mirror the existing content/file/url declaration API and are defined once on the Builder interface. When a lock is supplied it is copied into the environment directory and the install runs in strict lock mode so the environment matches the committed lock (uv: --frozen; pixi: --frozen). appose.json records a lockHash (SHA-256) of the lock content, so a change to the lock forces a rebuild through the normal isUpToDate() check. When no lock is supplied the lockHash key is omitted entirely, keeping appose.json byte-identical to before (no spurious rebuilds of existing environments) and never passing the strict flag. DynamicBuilder forwards the lock to the detected pixi/uv delegate; MambaBuilder and SimpleBuilder override lockContent to throw UnsupportedOperationException. Note that pixi --frozen uses the lock as-is (the lock is authoritative) while uv --frozen fails fast on a stale lock; both make builds reproducible, and the tests assert the actual semantics of each tool.
Member
|
@yzx9 Awesome! Thank you very much for this, and for all the work you've been doing on Appose. And apologies for the sluggishness of my responses and reviews. I'm not trying to ignore anything, just too busy as always. But Appose is a pretty high priority to me, so I will try to work on this soon. |
07d0731 to
dec7fe9
Compare
Author
|
@ctrueden Thank you! No worries at all. I completely understand that open-source maintainers have a lot on their plate. Thanks again for all your work on Appose. Please take your time with the review, and let me know if there’s anything I can improve or clarify. |
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.
PixiBuilder and UvBuilder now accept a lock file (
uv.lock/pixi.lock) via newlockContent/lockFile/lockUrlmethods that mirror the existing content/file/url declaration API and are defined once on the Builder interface. When a lock is supplied it is copied into the environment directory and the install runs in strict lock mode so the environment matches the committed lock (uv:--frozen; pixi:--frozen).appose.jsonrecords alockHash(SHA-256) of the lock content, so a change to the lock forces a rebuild through the normalisUpToDate()check. When no lock is supplied thelockHashkey is omitted entirely, keepingappose.jsonbyte-identical to before (no spurious rebuilds of existing environments) and never passing the strict flag.DynamicBuilderforwards the lock to the detected pixi/uv delegate;MambaBuilderandSimpleBuilderoverridelockContentto throwUnsupportedOperationException. Note thatpixi --frozenuses the lock as-is (the lock is authoritative) whileuv --frozenfails fast on a stale lock; both make builds reproducible, and the tests assert the actual semantics of each tool.closes apposed/appose#33