1
0
Fork 0

do not use leaveDotGit for artiq-src (WA hash reproducibility issues)

This commit is contained in:
Sebastien Bourdeauducq 2019-03-31 23:06:46 +08:00
parent 192f700dbc
commit fa68c48d01
1 changed files with 6 additions and 2 deletions

View File

@ -5,14 +5,18 @@ let
'' ''
cp --no-preserve=mode,ownership -R ${./artiq} $out cp --no-preserve=mode,ownership -R ${./artiq} $out
REV=`git --git-dir ${artiqSrc}/.git rev-parse HEAD` REV=`git --git-dir ${artiqSrc}/.git rev-parse HEAD`
HASH=`nix-hash --type sha256 --base32 ${artiqSrc}` ARTIQ_SRC_CLEAN=`mktemp -d`
cp -a ${artiqSrc}/. $ARTIQ_SRC_CLEAN
chmod -R 755 $ARTIQ_SRC_CLEAN/.git
chmod 755 $ARTIQ_SRC_CLEAN
rm -rf $ARTIQ_SRC_CLEAN/.git
HASH=`nix-hash --type sha256 --base32 $ARTIQ_SRC_CLEAN`
cat > $out/pkgs/artiq-src.nix << EOF cat > $out/pkgs/artiq-src.nix << EOF
{ fetchgit }: { fetchgit }:
fetchgit { fetchgit {
url = "git://github.com/m-labs/artiq.git"; url = "git://github.com/m-labs/artiq.git";
rev = "$REV"; rev = "$REV";
sha256 = "$HASH"; sha256 = "$HASH";
leaveDotGit = true;
} }
EOF EOF
echo \"5e.`cut -c1-8 <<< $REV`\" > $out/pkgs/artiq-version.nix echo \"5e.`cut -c1-8 <<< $REV`\" > $out/pkgs/artiq-version.nix