-
Notifications
You must be signed in to change notification settings - Fork 84
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
Hydra executables should provide the commit at which they were built #849
Comments
There was a related red bin item with the observation this is coming from the
|
cardano-node is patching the executable's binary to add the version, apparently: https://github.com/input-output-hk/cardano-node/blob/master/nix/haskell.nix#L297-L324 |
May I suggest that we also try to use the
Which includes the git revision 342137bcd, but also additional information that the last release was 0.9.0 and this is some 123 commits ahead. |
The Note: I am aware this makes nix build non hermetic. I can resort to the node's solution (patching binaries) if need be. |
@pgrange Suggested we could also patch the source code before the build which is a sed oneliner and friendlier to nix perhaps? |
Not proud of it but relying on this trick when releasing another project:
|
It would be great if we could use the version field of the cabal package description but of course, cabal does not allow that: https://cabal.readthedocs.io/en/3.4/cabal-package.html#pkg-field-version |
IIRC we do use the |
@ch1bo Yes, but my point was to suggest we could use the version field to add the SHA information on the fly when building (eg. patching source) |
I think I will go for a simple solution: Generate a file containing the data and use file-embed to inject the content of this file, if it exists, in the executable. |
Running recent static binary, I got the following:
which is not very informative and does not help in checking whether or not I am running the expected version of the node, and at which commit this version was built.
I would expect something like
The text was updated successfully, but these errors were encountered: