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] - --version doesn't have correct revision when doing a non-clean build #1342

Closed
AndrewWestberg opened this issue Jun 25, 2020 · 5 comments
Labels
bug Something isn't working cli revision is used to group all the Node CLI tickets minorfix Something that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug

Comments

@AndrewWestberg
Copy link

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
@AndrewWestberg AndrewWestberg added the bug Something isn't working label Jun 25, 2020
@kevinhammond kevinhammond added the cli revision is used to group all the Node CLI tickets label Jun 26, 2020
@kevinhammond kevinhammond added the minorfix Something that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug label Jun 26, 2020
@mark-stopka
Copy link
Contributor

mark-stopka commented Jun 28, 2020

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]$

@vix-io
Copy link
Contributor

vix-io commented Sep 15, 2020

We are not going to fix this.

@vix-io vix-io closed this as completed Sep 15, 2020
@mark-stopka
Copy link
Contributor

mark-stopka commented Sep 23, 2020

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

@mimi1vx
Copy link

mimi1vx commented Sep 24, 2020

@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

@mark-stopka
Copy link
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
Labels
bug Something isn't working cli revision is used to group all the Node CLI tickets minorfix Something that needs to be fixed (e.g. a hard-coded constant), but that isnt a bug
Projects
None yet
Development

No branches or pull requests

5 participants