Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[DEVOPS-810] [DEVOPS-908] Inject gitrev using file-embed #3130

Merged
merged 5 commits into from
Jun 27, 2018

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Jun 25, 2018

Description

This solves the problem of nix rebuilds with identical sources but different git revisions. It doesn't require creating extra cabal projects. The code in utils gets a little simpler as well. The code could get even more simpler if HasCompileInfo were removed -- maybe I should do that?

There is also the addition of an all-cardano-sl attribute.

Linked issue

https://iohk.myjetbrains.com/youtrack/issue/DEVOPS-810
https://iohk.myjetbrains.com/youtrack/issue/DEVOPS-908

Type of change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🛠 New feature (non-breaking change which adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
  • 🔨 New or improved tests for existing code
  • ⛑ git-flow chore (backport, hotfix, etc)

Developer checklist

  • I have read the style guide document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the docs directory.

Testing checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

QA Steps

nix-build -A cardano-sl-auxx
./result/bin/cardano-auxx --version
nix-build -A cardano-sl-auxx --argstr gitrev 1234
./result/bin/cardano-auxx --version

@jmitchell
Copy link
Contributor

I like where you're going with this. Using dummySpaceWith and injectWith to embed the git revision is much more cache-friendly.

There is also the addition of an all-cardano-sl attribute but this is not quite working properly.

How so?

I also like how it simplifies the targets in the CI script, in part by using the reasonable isCardanoSL heuristic.

@rvl rvl force-pushed the devops-908-test-all branch 3 times, most recently from 123467b to f5d411b Compare June 26, 2018 06:04
@rvl rvl changed the title WIP [DEVOPS-810] [DEVOPS-908] Inject gitrev using file-embed [DEVOPS-810] [DEVOPS-908] Inject gitrev using file-embed Jun 26, 2018
@rvl rvl removed the wip label Jun 26, 2018
@rvl
Copy link
Contributor Author

rvl commented Jun 26, 2018

Have fixed the all-cardano-sl attribute (it was building everything twice).

rvl added 5 commits June 26, 2018 21:53
It now builds all tests and benchmarks, and runs all tests.

Issue was brought up in FP Complete's Cardano Report (12 April 2018).
So that this package gets built as part of all-cardano-sl.
The build shouldn't depend on the presence of git on the PATH. If git
is unavailable, use an obvious null revision.
This will prevent needless rebuilds of cabal packages because the git
revision is injected after the nix package build.
Copy link
Contributor

@parsonsmatt parsonsmatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like it!

@rvl rvl merged commit 29d25ba into develop Jun 27, 2018
@rvl rvl deleted the devops-908-test-all branch June 27, 2018 01:19
KtorZ pushed a commit that referenced this pull request Nov 9, 2018
[DEVOPS-810] [DEVOPS-908] Inject gitrev using file-embed
KtorZ pushed a commit to input-output-hk/cardano-wallet-legacy that referenced this pull request Nov 9, 2018
…hk/devops-908-test-all

[DEVOPS-810] [DEVOPS-908] Inject gitrev using file-embed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants