Skip to content

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

Closed

Description

@CarlosLopezDeLara

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

Activity

  1. added
    Pioneer
    bug
    on Jun 2, 2020
  2. added
    minorfix
    and removed
    bug
    on Jun 2, 2020
  3. changed the title [-][BUG] - [/-] [+][BUG] - git rev 00000000000000000000 after building with cabal install[/+] on Jun 3, 2020
  4. cardanobay commented on Jun 12, 2020

    @cardanobay

    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

  5. erikd commented on Jun 16, 2020

    @erikd
    Contributor

    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 ...

  6. cardanobay commented on Jun 16, 2020

    @cardanobay

    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.

  7. mark-stopka commented on Jul 17, 2020

    @mark-stopka
    Contributor

    Linking for reference #1342

  8. newhoggy commented on Apr 12, 2021

    @newhoggy
    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.

  9. newhoggy commented on Apr 12, 2021

    @newhoggy
    Contributor

    I reported this haskell/cabal#7355

  10. mark-stopka commented on Apr 13, 2021

    @mark-stopka
    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

Metadata

Metadata

Assignees

Labels

Pioneerminorfix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions