IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
39 stars 14 forks source link

Restore production of statically linked binaries #838

Closed smelc closed 2 months ago

smelc commented 2 months ago

Shortly before merging https://github.com/IntersectMBO/cardano-cli/pull/819, statically linked binaries were being produced by Hydra, as the description of https://github.com/IntersectMBO/cardano-cli/pull/819 shows (280f274a030d04234e78e76a76378f7a16da6d14 is the most recent commit where this works I believe):

> nix build --builders "" --max-jobs 0 github:IntersectMBO/cardano-cli/280f274a030d04234e78e76a76378f7a16da6d14#hydraJobs.x86_64-linux.x86_64-unknown-linux-musl.packages.cardano-cli:exe:cardano-cli
> file result/bin/cardano-cli
result/bin/cardano-cli: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

However, at some point during the rebase of #819 (d456c96dbff949d926cdfaca507ea137c462547c), this got broken:

image

> rm -Rf result
> nix build --builders "" --max-jobs 0 github:IntersectMBO/cardano-cli/d456c96dbff949d926cdfaca507ea137c462547c#hydraJobs.x86_64-linux.x86_64-unknown-linux-musl.packages.cardano-cli:exe:cardano-cli
error: flake 'github:IntersectMBO/cardano-cli/d456c96dbff949d926cdfaca507ea137c462547c' does not provide attribute 'packages.x86_64-linux.hydraJobs.x86_64-linux.x86_64-unknown-linux-musl.packages.cardano-cli:exe:cardano-cli', 'legacyPackages.x86_64-linux.hydraJobs.x86_64-linux.x86_64-unknown-linux-musl.packages.cardano-cli:exe:cardano-cli' or 'hydraJobs.x86_64-linux.x86_64-unknown-linux-musl.packages.cardano-cli:exe:cardano-cli'

Here is the GH diff between the working commit and the broken one: https://github.com/IntersectMBO/cardano-cli/compare/280f274a030d04234e78e76a76378f7a16da6d14..d456c96dbff949d926cdfaca507ea137c462547c

This issue keeps track of making statically linked binaries produced by Hydra again (or to fix where they are found).

carbolymer commented 2 months ago

Seems that the job name is prefixed with GHC version now. This seems to be working for me:

16:42:41 1d [mgalazyn:~/workspace/iohk/cardano-cli] master+ 1 ± nix build 'github:IntersectMBO/cardano-cli/a80426ffd2d85aa1cb16d093d318847a2c00d953#hydraJobs.x86_64-linux.ghc965-x86_64-unknown-linux-musl.packages.cardano-cli:exe:cardano-cli'
warning: ignoring the client-specified setting 'trusted-public-keys', because it is a restricted setting and you are not a trusted user
16:42:44 1d [mgalazyn:~/workspace/iohk/cardano-cli] master+ ± file result/bin/cardano-cli
result/bin/cardano-cli: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped