Skip to content

Commit

Permalink
Merge pull request #11050 from MinaProtocol/nix-lld
Browse files Browse the repository at this point in the history
Nix: use lld
  • Loading branch information
Virgile Robles committed May 24, 2022
2 parents 1d05559 + 611c2a2 commit 096d5af
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions nix/ocaml.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ let
ocaml-libs =
builtins.attrValues (pkgs.lib.getAttrs installedPackageNames self);

# This is needed because
# - lld package is not wrapped to pick up the correct linker flags
# - bintools package also includes as which is incompatible with gcc
lld_wrapped = pkgs.writeShellScriptBin "ld.lld"
''${pkgs.llvmPackages.bintools}/bin/ld.lld "$@"'';

runMinaCheck = { name ? "check", extraInputs ? [ ], extraArgs ? { } }:
check:
self.mina-dev.overrideAttrs (oa:
Expand Down Expand Up @@ -110,9 +116,13 @@ let
MINA_BRANCH = "<unknown>";

buildInputs = ocaml-libs ++ external-libs;
nativeBuildInputs =
[ self.dune self.ocamlfind pkgs.capnproto pkgs.removeReferencesTo ]
++ ocaml-libs;
nativeBuildInputs = [
self.dune
self.ocamlfind
lld_wrapped
pkgs.capnproto
pkgs.removeReferencesTo
] ++ ocaml-libs;

# todo: slimmed rocksdb
MINA_ROCKSDB = "${pkgs.rocksdb}/lib/librocksdb.a";
Expand All @@ -139,7 +149,8 @@ let
dune exec src/app/runtime_genesis_ledger/runtime_genesis_ledger.exe -- --genesis-dir _build/coda_cache_dir
'';

outputs = [ "out" "generate_keypair" "mainnet" "testnet" "genesis" "sample" ];
outputs =
[ "out" "generate_keypair" "mainnet" "testnet" "genesis" "sample" ];

installPhase = ''
mkdir -p $out/bin $sample/share/mina $generate_keypair/bin $mainnet/bin $testnet/bin $genesis/bin $genesis/var/lib/coda
Expand Down

0 comments on commit 096d5af

Please sign in to comment.