fetchgit: fetch tags reproducibly and allow unstable version package to use git describe#466743
fetchgit: fetch tags reproducibly and allow unstable version package to use git describe#466743ShamrockLee wants to merge 13 commits intoNixOS:masterfrom
git describe#466743Conversation
git describe
|
What about sub-modules? When considering interface for tags in sub-modules, worth to think about how they are going to be updated since I was not able to find update scripts that do something for sub-modules. Asking because faced this problem in #461391 where root package vends bundled in sub-module having own version. |
747755c to
1b80835
Compare
|
Rebased after merging PR #462032. |
1b80835 to
005d8ae
Compare
|
@ony I changed the new fetchgit {
fetchTags = {
# For the main repo
"" = [ "tag1" ];
# For submodule at path/to/nlohmann_json
"path/to/nlohmann_json" = [ "tag2" "tag3" ];
};
}Update: |
3656578 to
3a5ab36
Compare
Thank you. What about inferring those tags? As I mentioned before they are not necessary in relation with package version as root source likely is. And thus they have to be hard-coded if they specified explicitly. ¹ From what I saw it seems that automatic updates focused on version and hash updates. See "Automatic package updates" section in |
bbb31dd to
0d34acf
Compare
The drawback is NixOS/nix#14675 preventing us from specifying Update:
|
655eb6f to
5625e5d
Compare
Description
This PR addresses the unsolved question of #465497 about the reproducible
git describefor packages with unstable versions.fetchTagsas an attribute set, and changes its default to{ }, allowing reproducible fetching of additional tags from the main module and submodules.fetchTags = true, specifyingfetchTagsas an attribute set does not implyleaveDotGit = true. This encourages the use ofpostCheckoutfor better hash stability.nix-prefetch-gitis--fetch-tag TAG, which can be specified multiple times.fetchgitto take bothrevandtagsimultaneously. In such scenario, therevwill be observed as the revision to fetch, and thetagwill be added to thefetchTagslist.Example use case:
This PR depends on the following PRs:
leaveDotGit,nonConeMode, andsparseCheckouta default valuenull#462032useFetchGit#456226__structuredAttrs = trueand passcurlOptsListandsparseCheckoutas lists #464475postCheckoutto allow gathering revision and commit metadata without leaving.git#465497The diff will be shorter once the depending PR is merged.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.