mirror of
https://github.com/NixOS/nix
synced 2025-07-08 19:23:54 +02:00
Fixed issue 65
lockfile updating
This commit is contained in:
parent
b531695331
commit
d9ad3723d5
6 changed files with 90 additions and 75 deletions
|
@ -9,11 +9,11 @@ clearStore
|
|||
|
||||
registry=$TEST_ROOT/registry.json
|
||||
|
||||
flake1=$TEST_ROOT/flake1
|
||||
flake2=$TEST_ROOT/flake2
|
||||
flake3=$TEST_ROOT/flake3
|
||||
flake1Dir=$TEST_ROOT/flake1
|
||||
flake2Dir=$TEST_ROOT/flake2
|
||||
flake3Dir=$TEST_ROOT/flake3
|
||||
|
||||
for repo in $flake1 $flake2 $flake3; do
|
||||
for repo in $flake1Dir $flake2Dir $flake3Dir; do
|
||||
rm -rf $repo
|
||||
mkdir $repo
|
||||
git -C $repo init
|
||||
|
@ -21,7 +21,7 @@ for repo in $flake1 $flake2 $flake3; do
|
|||
git -C $repo config user.name "Foobar"
|
||||
done
|
||||
|
||||
cat > $flake1/flake.nix <<EOF
|
||||
cat > $flake1Dir/flake.nix <<EOF
|
||||
{
|
||||
name = "flake1";
|
||||
|
||||
|
@ -36,11 +36,11 @@ cat > $flake1/flake.nix <<EOF
|
|||
}
|
||||
EOF
|
||||
|
||||
cp ./simple.nix ./simple.builder.sh ./config.nix $flake1/
|
||||
git -C $flake1 add flake.nix simple.nix simple.builder.sh config.nix
|
||||
git -C $flake1 commit -m 'Initial'
|
||||
cp ./simple.nix ./simple.builder.sh ./config.nix $flake1Dir/
|
||||
git -C $flake1Dir add flake.nix simple.nix simple.builder.sh config.nix
|
||||
git -C $flake1Dir commit -m 'Initial'
|
||||
|
||||
cat > $flake2/flake.nix <<EOF
|
||||
cat > $flake2Dir/flake.nix <<EOF
|
||||
{
|
||||
name = "flake2";
|
||||
|
||||
|
@ -56,8 +56,8 @@ cat > $flake2/flake.nix <<EOF
|
|||
}
|
||||
EOF
|
||||
|
||||
git -C $flake2 add flake.nix
|
||||
git -C $flake2 commit -m 'Initial'
|
||||
git -C $flake2Dir add flake.nix
|
||||
git -C $flake2Dir commit -m 'Initial'
|
||||
|
||||
cat > $flake3/flake.nix <<EOF
|
||||
{
|
||||
|
@ -82,13 +82,13 @@ cat > $registry <<EOF
|
|||
{
|
||||
"flakes": {
|
||||
"flake1": {
|
||||
"uri": "file://$flake1"
|
||||
"uri": "file://$flake1Dir"
|
||||
},
|
||||
"flake2": {
|
||||
"uri": "file://$flake2"
|
||||
"uri": "file://$flake2Dir"
|
||||
},
|
||||
"flake3": {
|
||||
"uri": "file://$flake3"
|
||||
"uri": "file://$flake3Dir"
|
||||
},
|
||||
"nixpkgs": {
|
||||
"uri": "flake1"
|
||||
|
@ -121,13 +121,12 @@ nix build -o $TEST_ROOT/result --flake-registry $registry flake1:
|
|||
(! nix build -o $TEST_ROOT/result --flake-registry $registry flake2:bar)
|
||||
|
||||
# But should succeed in impure mode.
|
||||
# FIXME: this currently fails.
|
||||
#nix build -o $TEST_ROOT/result --flake-registry $registry flake2:bar --impure
|
||||
nix build -o $TEST_ROOT/result --flake-registry $registry flake2:bar --impure
|
||||
|
||||
# Test automatic lock file generation.
|
||||
nix build -o $TEST_ROOT/result --flake-registry $registry $flake2:bar
|
||||
[[ -e $flake2/flake.lock ]]
|
||||
git -C $flake2 commit flake.lock -m 'Add flake.lock'
|
||||
nix build -o $TEST_ROOT/result --flake-registry $registry $flake2Dir:bar
|
||||
[[ -e $flake2Dir/flake.lock ]]
|
||||
git -C $flake2Dir commit flake.lock -m 'Add flake.lock'
|
||||
|
||||
# Rerunning the build should not change the lockfile.
|
||||
#nix build -o $TEST_ROOT/result --flake-registry $registry $flake2:bar
|
||||
|
@ -137,7 +136,7 @@ git -C $flake2 commit flake.lock -m 'Add flake.lock'
|
|||
nix build -o $TEST_ROOT/result --flake-registry $registry flake2:bar
|
||||
|
||||
# Or without a registry.
|
||||
nix build -o $TEST_ROOT/result file://$flake2:bar
|
||||
nix build -o $TEST_ROOT/result file://$flake2Dir:bar
|
||||
|
||||
# Test whether indirect dependencies work.
|
||||
#nix build -o $TEST_ROOT/result --flake-registry $registry $flake3:xyzzy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue