Skip to content

[BUG] - --version doesn't have correct revision when doing a non-clean build #1342

Closed

Description

@AndrewWestberg

Exernal

Summary
Building cardano-cli and cardano-node from a non-clean state shows incorrect revision hash from

cardano-cli --version

and

cardano-node --version

Steps to reproduce
Steps to reproduce the behavior:

  1. git checkout 1.14.0
  2. cabal clean
  3. cabal build all
  4. cardano-cli --version
cardano-cli 1.14.0 - linux-x86_64 - ghc-8.6
git rev 46f296f8a9f3f497d9bd41e20c8398d2b5730c86
  1. git checkout 1.14.1
  2. cabal build all
  3. cardano-cli --version
    Without clean, Incorrect!
cardano-cli 1.14.0 - linux-x86_64 - ghc-8.6
git rev 46f296f8a9f3f497d9bd41e20c8398d2b5730c86
  1. cabal clean
  2. cabal build all
  3. cardano-cli --version
    After clean, Correct!
cardano-cli 1.14.0 - linux-x86_64 - ghc-8.6
git rev 46f296f8a9f3f497d9bd41e20c8398d2b5730c86

Expected behavior
Rebuilding a different revision should update the git rev information in the version.

System info (please complete the following information):

  • OS: Ubuntu
  • Version 20.04
  • Node version 1.14.x

Activity

  1. added
    bug
    on Jun 25, 2020
  2. added
    cli revision
    minorfix
    on Jun 26, 2020
  3. mark-stopka commented on Jun 28, 2020

    @mark-stopka
    Contributor

    I can add that git rev is totally broken (all zeros) if using cabal install even on clean build...

    (cardano-node)[cardano-node@8083271ca3ac /srv/cardano/cardano-node]$ cardano-node --version
    cardano-node 1.14.0 - linux-x86_64 - ghc-8.6
    git rev 0000000000000000000000000000000000000000
    (cardano-node)[cardano-node@8083271ca3ac /srv/cardano/cardano-node]$
    
  4. vix-io commented on Sep 15, 2020

    @vix-io
    Contributor

    We are not going to fix this.

  5. mark-stopka commented on Sep 23, 2020

    @mark-stopka
    Contributor

    @mimi1vx, do you have any rough idea what would it take to fix this issues? TL;DR cabal build shows correct git devision, cabal install shows only zeroes... I'd be wiling to sponsor a fix if the cost would be reasonable as this annoys me a lot.

    Or @jhrcek perhaps?

    EDIT: Correction, this one is the one that bugs me... #1127 but they are probably somewhat related...

  6. mimi1vx commented on Sep 24, 2020

    @mimi1vx

    @mark-stopka it suses pretty clever trick with injection of gitRev ( borrowed from Michale Snoyman and stack) during compilation time, so it isn't simple to fix (probadly it needs work on Cabal side).

    From another angle with cabal nix-style build ( cabal new-build | cabal v2-build) issue isn't reproducible

  7. mark-stopka commented on Sep 24, 2020

    @mark-stopka
    Contributor

    @mimi1vx would that be a minor update to cabal, or something major with a budget above let's say 10k CZK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcli revisionminorfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions