Skip to content

builder: Install benchmarks properly #175

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

Merged
merged 2 commits into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions builder/comp-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ let
&& (haskellLib.isLibrary componentId)
&& stdenv.hostPlatform == stdenv.buildPlatform;

testExecutable = "dist/build/${componentId.cname}/${componentId.cname}"
+ lib.optionalString stdenv.hostPlatform.isWindows ".exe";
exeExt = lib.optionalString stdenv.hostPlatform.isWindows ".exe";
testExecutable = "dist/build/${componentId.cname}/${componentId.cname}${exeExt}";

in stdenv.lib.fix (drv:

Expand Down Expand Up @@ -233,13 +233,10 @@ stdenv.mkDerivation ({
${ghc.targetPrefix}ghc-pkg -v0 --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf
fi
''}
${lib.optionalString (haskellLib.isTest componentId || haskellLib.isAll componentId) ''
${lib.optionalString (haskellLib.isTest componentId || haskellLib.isBenchmark componentId || haskellLib.isAll componentId) ''
mkdir -p $out/${name}
if [ -f "dist/build/${componentId.cname}/${componentId.cname}" ]; then
cp dist/build/${componentId.cname}/${componentId.cname} $out/${name}/
fi
if [ -f "dist/build/${componentId.cname}/${componentId.cname}.exe" ]; then
cp dist/build/${componentId.cname}/${componentId.cname}.exe $out/${name}/
if [ -f ${testExecutable} ]; then
cp ${testExecutable} $out/${name}/
fi
''}
runHook postInstall
Expand Down
1 change: 1 addition & 0 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ with haskellLib;
isLibrary = componentId: componentId.ctype == "lib";
isAll = componentId: componentId.ctype == "all";
isTest = componentId: componentId.ctype == "test";
isBenchmark = componentId: componentId.ctype == "bench";

# Format a componentId as it should appear as a target on the
# command line of the setup script.
Expand Down