Copy instead of link haskell-backend binaries in nix derivation #4106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following up on #4096, evm-semantics#2739, evm-semantics#2745, and kontrol#1013, I measured the install time of
kontrol
withkup
on a fresh Ubuntu virtual machine. Compared to a previous measurement, the install time has been reduced to 10 minutes from previously 20 minutes.During the latest measurement I noticed that Haskell dependencies are still being downloaded, even though the import-from-derivation anti-pattern has already been removed in #4096. I investigated and noticed that the Haskell dependencies are also considered runtime dependencies. This is caused by the
withZ3
wrapper that links to binaries in Haskell derivations. These Haskell derivations also contain references to Haskell dependencies, namelykore
andhs-backend-booster
.This pull request changes the
withZ3
wrapper to copy the respective binary prior to wrapping.E.g., for
kore-rpc-booster
, this reduces the total size to download by more than 5GB, when installing from nix cache. In addition, these downloads were spread among many smaller derivations to download.Output of `nix-tree` before the change:
Output of `nix-tree` after the change: