-
Notifications
You must be signed in to change notification settings - Fork 88
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
Pure nix builds with patched git revision #962
Conversation
Transactions CostsSizes and execution budgets for Hydra protocol transactions. Note that unlisted parameters are currently using
Script summary
Cost of Init Transaction
Cost of Commit TransactionThis is using ada-only outputs for better comparability.
Cost of CollectCom Transaction
Cost of Close Transaction
Cost of Contest Transaction
Cost of Abort TransactionSome variation because of random mixture of still initial and already committed outputs.
Cost of FanOut TransactionInvolves spending head output and burning head tokens. Uses ada-only UTxO for better comparability.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am slightly annoyed this adds a lot of nix code which we'll need to maintain, and we know for a fact @ch1bo is the only nix expert we have in the team. Could not we find a way to have the same functionality implemented outside of nix and only have nix call it?
72e9cbd
to
eb4c247
Compare
eb4c247
to
1d9b6bd
Compare
Should we merge this? I saw noone approved but I guess it's an improvement over what we have ? |
yes, I would merge it. |
1d9b6bd
to
8866081
Compare
We could move a bit more logic into bash (e.g. the |
8866081
to
6d5b93d
Compare
@pgrange I would like to move forward with this. I could not reproduce locally why there was a rebuild after modifying |
This would make the derivation of the executable depend directly on the git revision of the repository and lead to unnecessary rebuilds.
This allows to patch the binary after build with the git revision.
This is using the embedding at a known placeholder (40 zeros) to patch the hydra-node and hydra-tui binaries (dynamic and static). This way, the basic derivation is only depending on the sources and only the last "step" of patching depends on the git revision.
6d5b93d
to
912095e
Compare
@ch1bo Can you just take a look at the failing CI before merging? |
Seems to have been a random failure on the build host? Although not reported correctly, it's green now. merging this |
🍉 Instead of compiling the revision directly into the haskell binary, we keep the actual binary derivation independent of the git index and only depend on the sources needed to build the
hydra-node
/hydra-tui
binaries.🍉 Then, in a second step, patch the git revision into the binary built by haskell.nix. This allows to re-use the already built binaries when no source changed, but only something unrelated in the repository, e.g. the README.md
🍉 Ultimately this should lead to less rebuilds of the actual binaries in our CI as we can share those derivations.
A sneak peeks of a rebuild on this branch:
Original problem description:
Since we are depending on the git revision (via the nix flake), the hydra-node derivation needs to be rebuilt on ANY change to the git index.
This is also the reason why the cardano-node for example does not compile the git revision into the binary, but does patch the string in the final binary:
On a side note, this broke the cardano-node build at least once.