mirror of
https://github.com/NixOS/nix
synced 2025-07-08 06:53:54 +02:00
Remove manifest support
Manifests have been superseded by binary caches for years. This also gets rid of nix-pull, nix-generate-patches and bsdiff/bspatch.
This commit is contained in:
parent
af4fb6ef61
commit
867967265b
37 changed files with 20 additions and 2143 deletions
|
@ -1,7 +1,6 @@
|
|||
source common.sh
|
||||
|
||||
clearStore
|
||||
clearManifests
|
||||
clearCache
|
||||
|
||||
# Create the binary cache.
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
{ version }:
|
||||
|
||||
with import ./config.nix;
|
||||
|
||||
mkDerivation {
|
||||
name = "foo-${toString version}";
|
||||
builder = builtins.toFile "builder.sh"
|
||||
''
|
||||
mkdir $out
|
||||
(for ((n = 1; n < 100000; n++)); do echo $n; done) > $out/foo
|
||||
${if version != 1 then ''
|
||||
(for ((n = 100000; n < 110000; n++)); do echo $n; done) >> $out/foo
|
||||
'' else ""}
|
||||
${if version == 3 then ''
|
||||
echo foobar >> $out/foo
|
||||
'' else ""}
|
||||
'';
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
source common.sh
|
||||
|
||||
clearManifests
|
||||
|
||||
mkdir -p $TEST_ROOT/cache2 $TEST_ROOT/patches
|
||||
|
||||
RESULT=$TEST_ROOT/result
|
||||
|
||||
# Build version 1 and 2 of the "foo" package.
|
||||
nix-push --dest $TEST_ROOT/cache2 --manifest --bzip2 \
|
||||
$(nix-build -o $RESULT binary-patching.nix --arg version 1)
|
||||
mv $TEST_ROOT/cache2/MANIFEST $TEST_ROOT/manifest1
|
||||
|
||||
out2=$(nix-build -o $RESULT binary-patching.nix --arg version 2)
|
||||
nix-push --dest $TEST_ROOT/cache2 --manifest --bzip2 $out2
|
||||
mv $TEST_ROOT/cache2/MANIFEST $TEST_ROOT/manifest2
|
||||
|
||||
out3=$(nix-build -o $RESULT binary-patching.nix --arg version 3)
|
||||
nix-push --dest $TEST_ROOT/cache2 --manifest --bzip2 $out3
|
||||
mv $TEST_ROOT/cache2/MANIFEST $TEST_ROOT/manifest3
|
||||
|
||||
rm $RESULT
|
||||
|
||||
# Generate binary patches.
|
||||
nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
|
||||
file://$TEST_ROOT/patches $TEST_ROOT/manifest1 $TEST_ROOT/manifest2
|
||||
|
||||
nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
|
||||
file://$TEST_ROOT/patches $TEST_ROOT/manifest2 $TEST_ROOT/manifest3
|
||||
|
||||
grep -q "patch {" $TEST_ROOT/manifest3
|
||||
|
||||
# Get rid of versions 2 and 3.
|
||||
nix-store --delete $out2 $out3
|
||||
|
||||
# Pull the manifest containing the patches.
|
||||
clearManifests
|
||||
nix-pull file://$TEST_ROOT/manifest3
|
||||
|
||||
# Make sure that the download size prediction uses the patches rather
|
||||
# than the full download.
|
||||
nix-build -o $RESULT binary-patching.nix --arg version 3 --dry-run 2>&1 | grep -q "0.01 MiB"
|
||||
|
||||
# Now rebuild it. This should use the two patches generated above.
|
||||
rm -f $TEST_ROOT/var/log/nix/downloads
|
||||
nix-build -o $RESULT binary-patching.nix --arg version 3
|
||||
rm $RESULT
|
||||
[ "$(grep ' patch ' $TEST_ROOT/var/log/nix/downloads | wc -l)" -eq 2 ]
|
||||
|
||||
# Add a patch from version 1 directly to version 3.
|
||||
nix-generate-patches $TEST_ROOT/cache2 $TEST_ROOT/patches \
|
||||
file://$TEST_ROOT/patches $TEST_ROOT/manifest1 $TEST_ROOT/manifest3
|
||||
|
||||
# Rebuild version 3. This should use the direct patch rather than the
|
||||
# sequence of two patches.
|
||||
nix-store --delete $out2 $out3
|
||||
clearManifests
|
||||
rm $TEST_ROOT/var/log/nix/downloads
|
||||
nix-pull file://$TEST_ROOT/manifest3
|
||||
nix-build -o $RESULT binary-patching.nix --arg version 3
|
||||
[ "$(grep ' patch ' $TEST_ROOT/var/log/nix/downloads | wc -l)" -eq 1 ]
|
|
@ -54,10 +54,6 @@ clearStore() {
|
|||
rm -f "$NIX_STATE_DIR"/gcroots/ref
|
||||
}
|
||||
|
||||
clearManifests() {
|
||||
rm -f $NIX_STATE_DIR/manifests/*
|
||||
}
|
||||
|
||||
clearCache() {
|
||||
rm -rf "$cacheDir"
|
||||
}
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
source common.sh
|
||||
|
||||
# Note: this test expects to be run *after* nix-push.sh.
|
||||
|
||||
drvPath=$(nix-instantiate ./dependencies.nix)
|
||||
outPath=$(nix-store -q $drvPath)
|
||||
outPath=$(nix-store -r $drvPath)
|
||||
nix-push --dest $cacheDir $outPath
|
||||
|
||||
clearStore
|
||||
clearProfiles
|
||||
|
||||
cat > $TEST_ROOT/foo.nixpkg <<EOF
|
||||
NIXPKG1 file://$TEST_ROOT/cache/MANIFEST simple $system $drvPath $outPath
|
||||
NIXPKG1 - simple $system $drvPath $outPath file://$cacheDir
|
||||
EOF
|
||||
|
||||
nix-install-package --non-interactive -p $profiles/test $TEST_ROOT/foo.nixpkg
|
||||
|
|
|
@ -4,11 +4,11 @@ check:
|
|||
nix_tests = \
|
||||
init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \
|
||||
build-hook.sh substitutes.sh substitutes2.sh \
|
||||
fallback.sh nix-push.sh gc.sh gc-concurrent.sh nix-pull.sh \
|
||||
fallback.sh nix-push.sh gc.sh gc-concurrent.sh \
|
||||
referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \
|
||||
gc-runtime.sh install-package.sh check-refs.sh filter-source.sh \
|
||||
remote-store.sh export.sh export-graph.sh \
|
||||
binary-patching.sh timeout.sh secure-drv-outputs.sh nix-channel.sh \
|
||||
timeout.sh secure-drv-outputs.sh nix-channel.sh \
|
||||
multiple-outputs.sh import-derivation.sh fetchurl.sh optimise-store.sh \
|
||||
binary-cache.sh nix-profile.sh repair.sh dump-db.sh case-hack.sh \
|
||||
check-reqs.sh pass-as-file.sh tarball.sh
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
source common.sh
|
||||
|
||||
clearProfiles
|
||||
clearManifests
|
||||
|
||||
rm -f $TEST_ROOT/.nix-channels
|
||||
|
||||
|
@ -45,7 +44,6 @@ nix-env -i dependencies
|
|||
|
||||
|
||||
clearProfiles
|
||||
clearManifests
|
||||
rm -f $TEST_ROOT/.nix-channels
|
||||
|
||||
# Test updating from a tarball
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
source common.sh
|
||||
|
||||
pullCache () {
|
||||
echo "pulling cache..."
|
||||
nix-pull file://$TEST_ROOT/cache/MANIFEST
|
||||
}
|
||||
|
||||
clearStore
|
||||
clearManifests
|
||||
pullCache
|
||||
|
||||
drvPath=$(nix-instantiate dependencies.nix)
|
||||
outPath=$(nix-store -q $drvPath)
|
||||
|
||||
echo "building $outPath using substitutes..."
|
||||
nix-store -r $outPath
|
||||
|
||||
cat $outPath/input-2/bar
|
||||
|
||||
clearStore
|
||||
clearManifests
|
||||
pullCache
|
||||
|
||||
echo "building $drvPath using substitutes..."
|
||||
nix-store -r $drvPath
|
||||
|
||||
cat $outPath/input-2/bar
|
||||
|
||||
# Check that the derivers are set properly.
|
||||
test $(nix-store -q --deriver "$outPath") = "$drvPath"
|
||||
nix-store -q --deriver $(readLink $outPath/input-2) | grep -q -- "-input-2.drv"
|
||||
|
||||
clearManifests
|
|
@ -1,7 +1,6 @@
|
|||
source common.sh
|
||||
|
||||
clearStore
|
||||
clearManifests
|
||||
|
||||
startDaemon
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
source common.sh
|
||||
|
||||
clearStore
|
||||
clearManifests
|
||||
|
||||
startDaemon
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue