1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 02:43:54 +02:00

Rename a few configuration options

In particular, drop the "build-" and "gc-" prefixes which are
pointless. So now you can say

  nix build --no-sandbox

instead of

  nix build --no-build-use-sandbox
This commit is contained in:
Eelco Dolstra 2017-08-31 14:28:25 +02:00
parent 7d4a7136db
commit c2154d4c84
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
16 changed files with 113 additions and 104 deletions

View file

@ -13,7 +13,7 @@ rm -rf $TEST_ROOT/store0 $TEST_ROOT/store1
export NIX_CONF_DIR=$TEST_ROOT/etc2
mkdir -p $NIX_CONF_DIR
echo "
build-sandbox-paths = /nix/store
sandbox-paths = /nix/store
sandbox-build-dir = /build-tmp
" > $NIX_CONF_DIR/nix.conf

View file

@ -15,9 +15,7 @@ mkdir "$NIX_CONF_DIR"
cat > "$NIX_CONF_DIR"/nix.conf <<EOF
build-users-group =
gc-keep-outputs = false
gc-keep-derivations = false
env-keep-derivations = false
keep-derivations = false
fsync-metadata = false
EOF

View file

@ -16,7 +16,7 @@ rm -rf $TEST_ROOT/store0
export NIX_STORE_DIR=/my/store
export NIX_REMOTE="local?root=$TEST_ROOT/store0"
outPath=$(nix-build dependencies.nix --no-out-link --option build-sandbox-paths /nix/store)
outPath=$(nix-build dependencies.nix --no-out-link --option sandbox-paths /nix/store)
[[ $outPath =~ /my/store/.*-dependencies ]]

View file

@ -11,5 +11,5 @@ path=$(nix-build dependencies.nix --no-out-link)
clearStore
rm -rf $NIX_LOG_DIR
(! nix-store -l $path)
nix-build dependencies.nix --no-out-link --option build-compress-log true
nix-build dependencies.nix --no-out-link --option compress-build-log true
[ "$(nix-store -l $path)" = FOO ]

View file

@ -59,5 +59,5 @@ fi
echo "collecting garbage..."
rm $TEST_ROOT/result*
nix-store --gc --option gc-keep-derivations true --option gc-keep-outputs true
nix-store --gc --option keep-derivations true --option keep-outputs true
nix-store --gc --print-roots

View file

@ -20,7 +20,7 @@ makeTest {
startAll;
# Copying to /tmp should succeed.
$machine->succeed('nix-build --option build-use-sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" {} "
$machine->succeed('nix-build --option sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" {} "
mkdir -p $out
cp ${pkgs.coreutils}/bin/id /tmp/id
")\' ');
@ -30,7 +30,7 @@ makeTest {
$machine->succeed("rm /tmp/id");
# Creating a setuid binary should fail.
$machine->fail('nix-build --option build-use-sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" {} "
$machine->fail('nix-build --option sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" {} "
mkdir -p $out
cp ${pkgs.coreutils}/bin/id /tmp/id
chmod 4755 /tmp/id
@ -41,7 +41,7 @@ makeTest {
$machine->succeed("rm /tmp/id");
# Creating a setgid binary should fail.
$machine->fail('nix-build --option build-use-sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" {} "
$machine->fail('nix-build --option sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" {} "
mkdir -p $out
cp ${pkgs.coreutils}/bin/id /tmp/id
chmod 2755 /tmp/id
@ -52,7 +52,7 @@ makeTest {
$machine->succeed("rm /tmp/id");
# The checks should also work on 32-bit binaries.
$machine->fail('nix-build --option build-use-sandbox false -E \'(with import <nixpkgs> { system = "i686-linux"; }; runCommand "foo" {} "
$machine->fail('nix-build --option sandbox false -E \'(with import <nixpkgs> { system = "i686-linux"; }; runCommand "foo" {} "
mkdir -p $out
cp ${pkgs.coreutils}/bin/id /tmp/id
chmod 2755 /tmp/id
@ -63,7 +63,7 @@ makeTest {
$machine->succeed("rm /tmp/id");
# The tests above use fchmodat(). Test chmod() as well.
$machine->succeed('nix-build --option build-use-sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" { buildInputs = [ perl ]; } "
$machine->succeed('nix-build --option sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" { buildInputs = [ perl ]; } "
mkdir -p $out
cp ${pkgs.coreutils}/bin/id /tmp/id
perl -e \"chmod 0666, qw(/tmp/id) or die\"
@ -73,7 +73,7 @@ makeTest {
$machine->succeed("rm /tmp/id");
$machine->fail('nix-build --option build-use-sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" { buildInputs = [ perl ]; } "
$machine->fail('nix-build --option sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" { buildInputs = [ perl ]; } "
mkdir -p $out
cp ${pkgs.coreutils}/bin/id /tmp/id
perl -e \"chmod 04755, qw(/tmp/id) or die\"
@ -84,7 +84,7 @@ makeTest {
$machine->succeed("rm /tmp/id");
# And test fchmod().
$machine->succeed('nix-build --option build-use-sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" { buildInputs = [ perl ]; } "
$machine->succeed('nix-build --option sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" { buildInputs = [ perl ]; } "
mkdir -p $out
cp ${pkgs.coreutils}/bin/id /tmp/id
perl -e \"my \\\$x; open \\\$x, qw(/tmp/id); chmod 01750, \\\$x or die\"
@ -94,7 +94,7 @@ makeTest {
$machine->succeed("rm /tmp/id");
$machine->fail('nix-build --option build-use-sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" { buildInputs = [ perl ]; } "
$machine->fail('nix-build --option sandbox false -E \'(with import <nixpkgs> {}; runCommand "foo" { buildInputs = [ perl ]; } "
mkdir -p $out
cp ${pkgs.coreutils}/bin/id /tmp/id
perl -e \"my \\\$x; open \\\$x, qw(/tmp/id); chmod 04777, \\\$x or die\"

View file

@ -1,4 +1,4 @@
#! @ENV_PROG@ nix-shell
#! nix-shell -I nixpkgs=shell.nix --option build-use-substitutes false
#! nix-shell -I nixpkgs=shell.nix --option use-substitutes false
#! nix-shell --pure -i bash -p foo bar
echo "$(foo) $(bar) $@"

View file

@ -15,7 +15,7 @@ if ! echo "$messages" | grep -q "timed out"; then
exit 1
fi
if nix-build -Q timeout.nix -A infiniteLoop --option build-max-log-size 100; then
if nix-build -Q timeout.nix -A infiniteLoop --option max-build-log-size 100; then
echo "build should have failed"
exit 1
fi
@ -30,7 +30,7 @@ if nix-build timeout.nix -A closeLog; then
exit 1
fi
if nix build -f timeout.nix silent --option build-max-silent-time 2; then
if nix build -f timeout.nix silent --max-silent-time 2; then
echo "build should have failed"
exit 1
fi