You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] - git rev 00000000000000000000 after building with cabal install #1127
Can confirm this small bug on Debian 10 and Centos 8.
Bug happen only with "cabal install...", using "cabal build..." result in a binary that shows the correct git rev.
edit : building on git checkout tags/1.13.0
If what you say is true, this is actually a bug in the Haskell tooling. If that is the case, I am pretty sure the tooling bugs can be worked around using cabal build ... && cabal install ...
I will personally just use the "build" command instead of the "install", because the resulting binary is smaller, and don't include this small bug. I don't understand why the binaries are different, but the node is running without any bugs.
cabal sdist creates collects source files required for compilation into a tar.gz which is the package that gets uploaded to hackage.
cabal install is meant to behave as you've run cabal sdist then extract the tar.gz file elsewhere and run cabal build from there.
Unfortunately, git information does not make it into the tar.gz file so the library we use gitrev is unable to find the git revision.
For example when I run cabal install on my make, the sources get copied to something like /private/var/folders/zh/ln41q4zs52x2fd61rxccmq640000gn/T/cabal-install.-79645/dist-newstyle/tmp/src-79645/cardano-config-0.1.0.0.
cabal sdist creates collects source files required for compilation into a tar.gz which is the package that gets uploaded to hackage.
cabal install is meant to behave as you've run cabal sdist then extract the tar.gz file elsewhere and run cabal build from there.
Unfortunately, git information does not make it into the tar.gz file so the library we use gitrev is unable to find the git revision.
For example when I run cabal install on my make, the sources get copied to something like /private/var/folders/zh/ln41q4zs52x2fd61rxccmq640000gn/T/cabal-install.-79645/dist-newstyle/tmp/src-79645/cardano-config-0.1.0.0.
Activity
[-][BUG] - [/-][+][BUG] - git rev 00000000000000000000 after building with cabal install[/+]cardanobay commentedon Jun 12, 2020
Can confirm this small bug on Debian 10 and Centos 8.
Bug happen only with "cabal install...", using "cabal build..." result in a binary that shows the correct git rev.
edit : building on git checkout tags/1.13.0
erikd commentedon Jun 16, 2020
If what you say is true, this is actually a bug in the Haskell tooling. If that is the case, I am pretty sure the tooling bugs can be worked around using
cabal build ... && cabal install ...cardanobay commentedon Jun 16, 2020
For information for thoses who may once have this bug.
I just finished compiling the binary with theses commands :
Results :
Binary resulting of the
cabal buildcommand (97 MB)Binary resulting of the
cabal installcommand (104 MB)I will personally just use the "build" command instead of the "install", because the resulting binary is smaller, and don't include this small bug. I don't understand why the binaries are different, but the node is running without any bugs.
mark-stopka commentedon Jul 17, 2020
Linking for reference #1342
newhoggy commentedon Apr 12, 2021
A bit of background.
cabal sdistcreates collects source files required for compilation into atar.gzwhich is the package that gets uploaded to hackage.cabal installis meant to behave as you've runcabal sdistthen extract thetar.gzfile elsewhere and runcabal buildfrom there.Unfortunately,
gitinformation does not make it into thetar.gzfile so the library we usegitrevis unable to find the git revision.For example when I run
cabal installon my make, the sources get copied to something like/private/var/folders/zh/ln41q4zs52x2fd61rxccmq640000gn/T/cabal-install.-79645/dist-newstyle/tmp/src-79645/cardano-config-0.1.0.0.This problem is not unique to
cardano-node: https://www.reddit.com/r/haskell/comments/erhwe8/what_is_the_best_way_to_inject_information_into_a/ff5p7r6/?utm_source=share&utm_medium=web2xI don't know of any way to tell
cabal installto include the git revision.newhoggy commentedon Apr 12, 2021
I reported this haskell/cabal#7355
mark-stopka commentedon Apr 13, 2021
Thanks for the in-depth analysis, I hope we can work with upstream on solving it =)