Skip to content
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

[BUG] - git rev 00000000000000000000 after building with cabal install #1127

Closed
CarlosLopezDeLara opened this issue Jun 2, 2020 · 7 comments
Assignees
Labels
minorfix Something that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug Pioneer Issues related to the Pioneer F&F Testnet

Comments

@CarlosLopezDeLara
Copy link
Contributor

Summary

Getting git rev 00000000000000000000 after building with cabal install.

Steps to reproduce
Steps to reproduce the behavior:

After building with 'cabal install' :

~/cardano-node$ cardano-node --version 
cardano-cli 1.12.0 - linux-x86_64 - ghc-8.6
git rev 0000000000000000000000000000000000000000

Expected behavior
Show the latest commit?
Hide the git rev to avoid confusion?

System info (please complete the following information):

  • OS: Ubuntu
  • Version: 20.04
  • Node version: 1.12.0 and pioneer-wave2
@CarlosLopezDeLara CarlosLopezDeLara added Pioneer Issues related to the Pioneer F&F Testnet bug Something isn't working labels Jun 2, 2020
@kevinhammond kevinhammond added minorfix Something that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug and removed bug Something isn't working labels Jun 2, 2020
@vix-io vix-io changed the title [BUG] - [BUG] - git rev 00000000000000000000 after building with cabal install Jun 3, 2020
@cardanobay
Copy link

cardanobay commented 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
Copy link
Contributor

erikd commented 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
Copy link

cardanobay commented Jun 16, 2020

For information for thoses who may once have this bug.
I just finished compiling the binary with theses commands :

$ cabal update
$ git fetch --all --tags
$ git tag
$ git checkout tags/1.13.0
$ cabal build cardano-node && cabal install cardano-node

Results :

Binary resulting of the cabal build command (97 MB)

cardano@sp01:cardano-node$ /home/cardano/cardano-node/dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-node-1.13.0/x/cardano-node/build/cardano-node/cardano-node version
cardano-cli 1.13.0 - linux-x86_64 - ghc-8.6
git rev 9925ef37dccbe7f423f3ceb81a5e1da3d924393b

Binary resulting of the cabal install command (104 MB)

cardano@sp01:cardano-node$ /home/cardano/.cabal/store/ghc-8.6.5/cardano-node-1.13.0-5913b03154e8c88ac85fd6e313c9dd01a6e8ed032ac968baa4bb9b05302bb916/bin/cardano-node version
cardano-cli 1.13.0 - linux-x86_64 - ghc-8.6
git rev 0000000000000000000000000000000000000000

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
Copy link
Contributor

Linking for reference #1342

@newhoggy
Copy link
Contributor

newhoggy commented Apr 12, 2021

A bit of background.

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.

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=web2x

I don't know of any way to tell cabal install to include the git revision.

@newhoggy
Copy link
Contributor

I reported this haskell/cabal#7355

@mark-stopka
Copy link
Contributor

A bit of background.

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.

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=web2x

I don't know of any way to tell cabal install to include the git revision.

Thanks for the in-depth analysis, I hope we can work with upstream on solving it =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minorfix Something that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug Pioneer Issues related to the Pioneer F&F Testnet
Projects
None yet
Development

No branches or pull requests

7 participants