-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
polkadot: fix commit hash fetch for version string #159279
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
Conversation
|
/marvin opt-in |
|
Hi! I'm an experimental bot. My goal is to guide this PR through its stages, hopefully ending with a merge. You can read up on the usage here. |
| # be used when the polkadot build calls `git rev-parse` to fetch the commit | ||
| # hash. | ||
| fakeGit = writeShellScriptBin "git" '' | ||
| if [[ $@ = "rev-parse --short HEAD" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know where this is set? I think it would be much cleaner and more maintainable to submit an upstream patch to read the version from an environment variable (if this isn't already available). This will be useful for multiple consumers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely here: https://github.com/paritytech/substrate/blob/22ed351d86b3b04ca1df82fb0036c6376bf1fea0/utils/build-script-utils/src/version.rs#L23. It should be simple to make this code just return early if SUBSTRATE_CLI_IMPL_VERSION is already set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, my plan is to add support in upstream for reading the commit hash from an environment variable. I am one of the maintainers of the project so I don't think there will be any issues getting it through although it will still take some versions to get it released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's set here btw https://github.com/paritytech/substrate/blob/master/utils/build-script-utils/src/version.rs#L23, not on polkadot itself but substrate which is a dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Would it be reasonable to file an issue in the upstream project (or in nixpkgs if that is not wanted) and link to it from this comment just to tie everything together and track the removal of the workaround?
|
As discussed in the review a PR was submitted upstream to remove the need for the |
|
Result of 1 package built:
|
|
@andresilva I actually don't think this is the best solution. There are reproducibility issues with leaving the Another (IMHO clenaer option), is to have the |
|
@andresilva disregard the PR above, it was a brain-fart. I still think though that we shoudn't have merged this and instead waited for upstream to merge. |
|
We are not leaving |
|
Yes, but the |
|
Only the nixpkgs/pkgs/development/tools/misc/coreboot-toolchain/default.nix Lines 27 to 32 in 48d63e9
|
Motivation for this change
The comment in the code describes the issue and solution.
Before:
After:
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes