about summary refs log tree commit diff
path: root/third_party/nix/tests/fetchurl.sh
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-05-18T15·39+0200
committerclbot <clbot@tvl.fyi>2022-05-19T14·08+0000
commitd127f9bd0e7b9b2e0df2de8a2227f77c0907468d (patch)
tree68455040d88b8e0c2817601db88ede450873ff8e /third_party/nix/tests/fetchurl.sh
parentc85291c602ac666421627d6934ebc6d5be1b93e1 (diff)
chore(3p/nix): unvendor tvix 0.1 r/4098
Nothing is using this now, and we'll likely never pick this up again,
but we learned a lot in the process.

Every now and then this breaks in some bizarre way on channel bumps
and it's just a waste of time to maintain that.

Change-Id: Idcf2f5acd4ca7070ce18d7149cbfc0d967dc0a44
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5632
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'third_party/nix/tests/fetchurl.sh')
-rw-r--r--third_party/nix/tests/fetchurl.sh78
1 files changed, 0 insertions, 78 deletions
diff --git a/third_party/nix/tests/fetchurl.sh b/third_party/nix/tests/fetchurl.sh
deleted file mode 100644
index 7319ced2b599..000000000000
--- a/third_party/nix/tests/fetchurl.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-source common.sh
-
-clearStore
-
-# Test fetching a flat file.
-hash=$(nix-hash --flat --type sha256 ./fetchurl.sh)
-
-outPath=$(nix-build '<nix/fetchurl.nix>' --argstr url file://$(pwd)/fetchurl.sh --argstr sha256 $hash --no-out-link --hashed-mirrors '')
-
-cmp $outPath fetchurl.sh
-
-# Now using a base-64 hash.
-clearStore
-
-hash=$(nix hash-file --type sha512 --base64 ./fetchurl.sh)
-
-outPath=$(nix-build '<nix/fetchurl.nix>' --argstr url file://$(pwd)/fetchurl.sh --argstr sha512 $hash --no-out-link --hashed-mirrors '')
-
-cmp $outPath fetchurl.sh
-
-# Now using an SRI hash.
-clearStore
-
-hash=$(nix hash-file ./fetchurl.sh)
-
-[[ $hash =~ ^sha256- ]]
-
-outPath=$(nix-build '<nix/fetchurl.nix>' --argstr url file://$(pwd)/fetchurl.sh --argstr hash $hash --no-out-link --hashed-mirrors '')
-
-cmp $outPath fetchurl.sh
-
-# Test the hashed mirror feature.
-clearStore
-
-hash=$(nix hash-file --type sha512 --base64 ./fetchurl.sh)
-hash32=$(nix hash-file --type sha512 --base16 ./fetchurl.sh)
-
-mirror=$TMPDIR/hashed-mirror
-rm -rf $mirror
-mkdir -p $mirror/sha512
-ln -s $(pwd)/fetchurl.sh $mirror/sha512/$hash32
-
-outPath=$(nix-build '<nix/fetchurl.nix>' --argstr url file:///no-such-dir/fetchurl.sh --argstr sha512 $hash --no-out-link --hashed-mirrors "file://$mirror")
-
-# Test hashed mirrors with an SRI hash.
-nix-build '<nix/fetchurl.nix>' --argstr url file:///no-such-dir/fetchurl.sh --argstr hash $(nix to-sri --type sha512 $hash) \
-          --argstr name bla --no-out-link --hashed-mirrors "file://$mirror"
-
-# Test unpacking a NAR.
-rm -rf $TEST_ROOT/archive
-mkdir -p $TEST_ROOT/archive
-cp ./fetchurl.sh $TEST_ROOT/archive
-chmod +x $TEST_ROOT/archive/fetchurl.sh
-ln -s foo $TEST_ROOT/archive/symlink
-nar=$TEST_ROOT/archive.nar
-nix-store --dump $TEST_ROOT/archive > $nar
-
-hash=$(nix-hash --flat --type sha256 $nar)
-
-outPath=$(nix-build '<nix/fetchurl.nix>' --argstr url file://$nar --argstr sha256 $hash \
-          --arg unpack true --argstr name xyzzy --no-out-link)
-
-echo $outPath | grep -q 'xyzzy'
-
-test -x $outPath/fetchurl.sh
-test -L $outPath/symlink
-
-nix-store --delete $outPath
-
-# Test unpacking a compressed NAR.
-narxz=$TEST_ROOT/archive.nar.xz
-rm -f $narxz
-xz --keep $nar
-outPath=$(nix-build '<nix/fetchurl.nix>' --argstr url file://$narxz --argstr sha256 $hash \
-          --arg unpack true --argstr name xyzzy --no-out-link)
-
-test -x $outPath/fetchurl.sh
-test -L $outPath/symlink