Fix git-lfs file smudging in zone source accessors#13
Open
vwassan wants to merge 1 commit intotecnix-gcsfrom
Open
Fix git-lfs file smudging in zone source accessors#13vwassan wants to merge 1 commit intotecnix-gcsfrom
vwassan wants to merge 1 commit intotecnix-gcsfrom
Conversation
Author
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.

Fix git-lfs file smudging in zone source accessors
Problem
Zone source accessors (
getZoneStorePath,mountZoneByTreeSha,getZoneFromCheckout) were created withsmudgeLfs = false, causing git-lfs pointer files to be copied into the Nix store as-is instead of being fetched and replaced with their real content. This broke builds for zones containing LFS-tracked files (e.g.//areas/platforms/query-engine), with errors like:internal/gen/catalog/generated_schema_shopify.go:1:1: expected 'package', found version
The root cause is two-fold:
smudgeLfswas never enabled for zone accessorslfs::Fetch::shouldFetch()usesGIT_ATTR_CHECK_INCLUDE_COMMITwhich requires a commit OID to resolve.gitattributes— so LFS attribute lookup would silently fail regardlessSolution
lfsCommitRevtoGitAccessorOptions— when set, this commit hash is passed tolfs::Fetchinstead of the tree hash, allowing correct.gitattributeslookup when the accessor is created from a tree SHAsmudgeLfs = trueon all three zone accessor call sites, passing the world commit hash (from--tectonix-git-sha) vialfsCommitRevFiles Changed
src/libfetchers/include/nix/fetchers/git-utils.hh— addlfsCommitRevtoGitAccessorOptionssrc/libfetchers/git-utils.cc— uselfsCommitRevinlfs::Fetchconstructor; include inmakeFingerprintsrc/libexpr/eval.cc— enablesmudgeLfs = true+lfsCommitRevon all zone accessor call sites