Skip to content

Commit

Permalink
Latency bench: Fix working directory
Browse files Browse the repository at this point in the history
The meaning of $src seems to have changed since the Haskell.nix bump
in PR #2533.
  • Loading branch information
rvl authored and Piotr Stachyra committed Mar 26, 2021
1 parent 56264fd commit 0e7ba55
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions nix/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,17 @@ let
unit.postInstall = libSodiumPostInstall;
};

# Add node backend to the PATH of the latency benchmarks
packages.cardano-wallet.components.benchmarks.latency = wrapBench cardanoNodeExes;
# Add node backend to the PATH of the latency benchmarks, and
# set the source tree as its working directory.
packages.cardano-wallet.components.benchmarks.latency =
lib.optionalAttrs (!stdenv.hostPlatform.isWindows) {
build-tools = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/* \
--run "cd $src/lib/shelley" \
--prefix PATH : ${lib.makeBinPath cardanoNodeExes}
'';
};

# Add cardano-node to the PATH of the byroon restore benchmark.
# cardano-node will want to write logs to a subdirectory of the working directory.
Expand Down Expand Up @@ -325,19 +334,6 @@ let
"$out/bin/$exeName" --fish-completion-script "$out/bin/$exeName" >"$fishCompDir/$exeName.fish"
'';

# Add component options to wrap a benchmark exe, so that it has the
# backend executable on its path, and the source tree as its working
# directory.
wrapBench = progs:
lib.optionalAttrs (!stdenv.hostPlatform.isWindows) {
build-tools = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/* \
--run "cd $src" \
--prefix PATH : ${lib.makeBinPath progs}
'';
};

in
haskell.addProjectAndPackageAttrs {
inherit pkg-set;
Expand Down

0 comments on commit 0e7ba55

Please sign in to comment.