Skip to content

Commit c05461f

Browse files
committedMay 24, 2017
pants13-pre: make it actually work on Linux
Third time's a charm. Not sure how I thought that three different files would download and have the same hash, but that's what the old code did. This one should have the three distinct platform hashes.
1 parent 45d3c49 commit c05461f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

‎pkgs/development/tools/build-managers/pants/default.nix

+8-8
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,30 @@ let
2929
# fetchurl because we don't know the URL ahead of time, even though it's deterministic. So we have
3030
# this downloader figure out the URL on the fly and then produce the deterministic result, so we
3131
# can still be a fixed-output derivation.
32-
pants13-native-engine-prefix = {
33-
"x86_64-darwin" = "mac/10.11";
34-
"x86_64-linux" = "linux/x86_64";
35-
"i686-linux" = "linux/i386";
32+
pants13-native-engine-info = {
33+
"x86_64-darwin" = { prefix = "mac/10.11"; hash = "0n8z7rg0yfpxplvcw88lwv733zkhbzhc4w4zd4aznbcmfqdiz5br"; };
34+
"x86_64-linux" = { prefix = "linux/x86_64"; hash = "0cva97899q902m61xnfawhbjrh5h751716sn6ljli9b8fl7b5sz4"; };
35+
"i686-linux" = { prefix = "linux/i386"; hash = "1qckg0zsdq9x4jhn59pswbs11mxqxryl65qn42hrsvii2yxa9i5k"; };
3636
}.${stdenv.system} or (throw "Unsupported system ${stdenv.system}!");
3737

3838
pants13-native-engine = runCommand "pants-native-${pants13-version}" {
3939
buildInputs = [ curl ];
4040
outputHashMode = "recursive";
4141
outputHashAlgo = "sha256";
42-
outputHash = "0n8z7rg0yfpxplvcw88lwv733zkhbzhc4w4zd4aznbcmfqdiz5br";
42+
outputHash = pants13-native-engine-info.hash;
4343
} ''
4444
native_version=$(curl -k -L https://raw.githubusercontent.com/pantsbuild/pants/release_${pants13-version}/src/python/pants/engine/subsystem/native_engine_version)
45-
curl -kLO "https://dl.bintray.com/pantsbuild/bin/build-support/bin/native-engine/${pants13-native-engine-prefix}/$native_version/native_engine.so"
45+
curl -kLO "https://dl.bintray.com/pantsbuild/bin/build-support/bin/native-engine/${pants13-native-engine-info.prefix}/$native_version/native_engine.so"
4646
4747
# Ugh it tries to "download" from this prefix so let's just replicate their directory structure for now...
48-
mkdir -p $out/bin/native-engine/${pants13-native-engine-prefix}/$native_version/
48+
mkdir -p $out/bin/native-engine/${pants13-native-engine-info.prefix}/$native_version/
4949
5050
# These should behave the same way in Nix land and we try not to differentiate between OS revisions...
5151
mkdir -p $out/bin/native-engine/mac/
5252
ln -s 10.11 $out/bin/native-engine/mac/10.10
5353
ln -s 10.11 $out/bin/native-engine/mac/10.12
5454
55-
cp native_engine.so $out/bin/native-engine/${pants13-native-engine-prefix}/$native_version/
55+
cp native_engine.so $out/bin/native-engine/${pants13-native-engine-info.prefix}/$native_version/
5656
'';
5757
in {
5858
pants =

0 commit comments

Comments
 (0)
Please sign in to comment.