fetchTree: Lix uses tag object hash instead of commit hash when ref points to a tag #1070
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1070
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
When fetching git inputs with
fetchTree, resulting source info containsrevpointing to the tree object instead of the commit object.Steps To Reproduce
Evaluate
The result is
047e5dffbba66b5eb0c1d8db04f661997fb825af, which is the tag object hash.Expected behavior
7e6de55d9af75b3647c91f7e939107fcb3c8f196, which is the corresponding commit hash: https://codeberg.org/goldstein/nix-tag-fetch-demo/src/tag/tag. This is what CppNix does.nix --versionoutputAdditional context
This is a divergence with CppNix. It might be intentional, but if so, I didn’t find info about it.
I do think returning commit hash here would be correct: flake docs say that returned rev is “the commit hash”.
yes, returning the commit hash rather than the tag hash seems like the much better behavior here. if the tag gets deleted the lockfile would cease to work even if the commit is still there, which is probably bad (and we've seen multiple projects pull and recreate tags, or just destroy them outright)