Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off Git smugding in fetchGit #9327

Closed
fricklerhandwerk opened this issue Nov 9, 2023 · 8 comments
Closed

Turn off Git smugding in fetchGit #9327

fricklerhandwerk opened this issue Nov 9, 2023 · 8 comments
Labels

Comments

@fricklerhandwerk
Copy link
Contributor

fricklerhandwerk commented Nov 9, 2023

Describe the bug

As discussed with @nixos/nix-team:

While it's been around for a long time, smudging being enabled in fetchGit can be considered a bug.

More detailed discussion: #4635 (comment)

Steps To Reproduce

$ nix build git+ssh://[email protected]/tomberek/export-magic -L
text> /nix/store/8fdx2h960yf292czd4ik2f6fza63wlqh-.version
text> HEAD -> main
text>  (HEAD -> main)
text> f0fe26485056d92e78d84de3daf14a8875548783
text> Tue, 21 Feb 2023 19:51:28 -0500
text> 2023-02-21 19:51:28 -0500
text> 2023-02-21T19:51:28-05:00
text> HEAD -> main
text>  (HEAD -> main)
text> f0fe26485056d92e78d84de3daf14a8875548783
text> Tue, 21 Feb 2023 19:51:28 -0500
text> 2023-02-21 19:51:28 -0500
text> 2023-02-21T19:51:28-05:00

Expected behavior

It should output the unchanged contents of https://github.com/tomberek/export-magic

Proposal

  • resolve commit hashes to tree hashes, this will incur a ~one-time overhead to fetch metadata; a trade-off towards correctness
    • GitHub tarballs are pre-smudged, but fetching those is an optimisation anyway
    • the new semantics will be much simpler

Priorities

Add 👍 to issues you find important.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-11-06-nix-team-meeting-minutes-101/35247/1

@roberth
Copy link
Member

roberth commented Nov 10, 2023

We've recently used the term smudging to cover all behaviors that make file system objects diverge from the simple, well defined, and therefore well reproducible git tree data model.

The example in this issue is technically about export-ignore and not the git smudge filter feature. Submodules should also be considered, as they are a layer on top of git trees.

A more extensive explanation and discussion centered around the smudge filter feature can be found here #4635 (comment)

Essentially what we're trying to achieve is NAR hash-levels of reproducibility by other means, specifically a definitive translation from git objects to Nix file system objects.

Definitive is the keyword here. We won't have the luxury of changing this translation after stabilization, except for the addition of parameters that tweak the translation in ways such that their default value is aforementioned "definitive" behavior.

@roberth

This comment was marked as resolved.

@fricklerhandwerk

This comment was marked as resolved.

@fricklerhandwerk
Copy link
Contributor Author

Essentially what we're trying to achieve is NAR hash-levels of reproducibility by other means, specifically a definitive translation from git objects to Nix file system objects.

Should we open a tracking issue from your comment then?

@thufschmitt
Copy link
Member

This should hopefully be fixed by #9240

@roberth
Copy link
Member

roberth commented Nov 19, 2023

@roberth roberth closed this as completed Nov 19, 2023
@roberth
Copy link
Member

roberth commented Nov 19, 2023

Duplicate

@roberth roberth closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants