1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-20 16:01:07 +01:00

Merge remote-tracking branch 'origin/2.30-maintenance' into sync-2.30.0

This commit is contained in:
Eelco Dolstra 2025-07-07 19:22:39 +02:00
commit 175406c313
284 changed files with 9123 additions and 4178 deletions

View file

@ -151,8 +151,11 @@ nix-build --substituters "file://$cacheDir" --no-require-sigs dependencies.nix -
grepQuiet "don't know how to build" "$TEST_ROOT/log"
grepQuiet "building.*input-1" "$TEST_ROOT/log"
grepQuiet "building.*input-2" "$TEST_ROOT/log"
grepQuiet "copying path.*input-0" "$TEST_ROOT/log"
grepQuiet "copying path.*top" "$TEST_ROOT/log"
# Removed for now since 299141ecbd08bae17013226dbeae71e842b4fdd7 / issue #77 is reverted
#grepQuiet "copying path.*input-0" "$TEST_ROOT/log"
#grepQuiet "copying path.*top" "$TEST_ROOT/log"
# Create a signed binary cache.

View file

@ -12,7 +12,6 @@ requiresUnprivilegedUserNamespaces
[[ $busybox =~ busybox ]] || skipTest "no busybox"
unset NIX_STORE_DIR
unset NIX_STATE_DIR
# We first build a dependency of the derivation we eventually want to
# build.

View file

@ -9,7 +9,6 @@ requiresUnprivilegedUserNamespaces
[[ "$busybox" =~ busybox ]] || skipTest "no busybox"
unset NIX_STORE_DIR
unset NIX_STATE_DIR
remoteDir=$TEST_ROOT/remote

View file

@ -8,7 +8,6 @@ requiresUnprivilegedUserNamespaces
# Avoid store dir being inside sandbox build-dir
unset NIX_STORE_DIR
unset NIX_STATE_DIR
function join_by { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; }

View file

@ -22,6 +22,11 @@ clearStore
nix-build dependencies.nix --no-out-link
nix-build dependencies.nix --no-out-link --check
# Make sure checking just one output works (#13293)
nix-build multiple-outputs.nix -A a --no-out-link
nix-store --delete "$(nix-build multiple-outputs.nix -A a.second --no-out-link)"
nix-build multiple-outputs.nix -A a.first --no-out-link --check
# Build failure exit codes (100, 104, etc.) are from
# doc/manual/source/command-ref/status-build-failure.md

View file

@ -18,4 +18,9 @@ clearStore
drvDep=$(nix-instantiate ./text-hashed-output.nix -A producingDrv)
expectStderr 1 nix build "${drvDep}^out^out" --no-link | grepQuiet "Building dynamic derivations in one shot is not yet implemented"
# Store layer needs bugfix
requireDaemonNewerThan "2.30pre20250515"
out2=$(nix build "${drvDep}^out^out" --no-link)
test $out1 == $out2

View file

@ -3,7 +3,7 @@
source common.sh
# Store layer needs bugfix
requireDaemonNewerThan "2.27pre20250205"
requireDaemonNewerThan "2.30pre20250515"
TODO_NixOS # can't enable a sandbox feature easily
@ -13,4 +13,4 @@ restartDaemon
NIX_BIN_DIR="$(dirname "$(type -p nix)")"
export NIX_BIN_DIR
expectStderr 1 nix build -L --file ./non-trivial.nix --no-link | grepQuiet "Building dynamic derivations in one shot is not yet implemented"
nix build -L --file ./non-trivial.nix --no-link

View file

@ -4,8 +4,11 @@ source common.sh
out1=$(nix-build ./text-hashed-output.nix -A hello --no-out-link)
# Store layer needs bugfix
requireDaemonNewerThan "2.30pre20250515"
clearStore
expectStderr 1 nix-build ./text-hashed-output.nix -A wrapper --no-out-link | grepQuiet "Building dynamic derivations in one shot is not yet implemented"
out2=$(nix-build ./text-hashed-output.nix -A wrapper --no-out-link)
# diff -r $out1 $out2
diff -r $out1 $out2

View file

@ -3,9 +3,7 @@
source common.sh
# Store layer needs bugfix
requireDaemonNewerThan "2.27pre20250205"
skipTest "dyn drv input scheduling had to be reverted for 2.27"
requireDaemonNewerThan "2.30pre20250515"
expected=100
if [[ -v NIX_DAEMON_PACKAGE ]]; then expected=1; fi # work around the daemon not returning a 100 status correctly

View file

@ -12,7 +12,7 @@ repo=$TEST_ROOT/./git
export _NIX_FORCE_HTTP=1
rm -rf $repo ${repo}-tmp $TEST_HOME/.cache/nix $TEST_ROOT/worktree $TEST_ROOT/shallow $TEST_ROOT/minimal
rm -rf $repo ${repo}-tmp $TEST_HOME/.cache/nix $TEST_ROOT/worktree $TEST_ROOT/minimal
git init $repo
git -C $repo config user.email "foobar@example.com"
@ -216,18 +216,6 @@ git -C $TEST_ROOT/minimal fetch $repo $rev2
git -C $TEST_ROOT/minimal checkout $rev2
[[ $(nix eval --impure --raw --expr "(builtins.fetchGit { url = $TEST_ROOT/minimal; }).rev") = $rev2 ]]
# Fetching a shallow repo shouldn't work by default, because we can't
# return a revCount.
git clone --depth 1 file://$repo $TEST_ROOT/shallow
(! nix eval --impure --raw --expr "(builtins.fetchGit { url = $TEST_ROOT/shallow; ref = \"dev\"; }).outPath")
# But you can request a shallow clone, which won't return a revCount.
path6=$(nix eval --impure --raw --expr "(builtins.fetchTree { type = \"git\"; url = \"file://$TEST_ROOT/shallow\"; ref = \"dev\"; shallow = true; }).outPath")
[[ $path3 = $path6 ]]
[[ $(nix eval --impure --expr "(builtins.fetchTree { type = \"git\"; url = \"file://$TEST_ROOT/shallow\"; ref = \"dev\"; shallow = true; }).revCount or 123") == 123 ]]
expectStderr 1 nix eval --expr 'builtins.fetchTree { type = "git"; url = "file:///foo"; }' | grepQuiet "'fetchTree' doesn't fetch unlocked input"
# Explicit ref = "HEAD" should work, and produce the same outPath as without ref
path7=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = \"file://$repo\"; ref = \"HEAD\"; }).outPath")
path8=$(nix eval --impure --raw --expr "(builtins.fetchGit { url = \"file://$repo\"; }).outPath")
@ -292,17 +280,20 @@ path11=$(nix eval --impure --raw --expr "(builtins.fetchGit ./.).outPath")
empty="$TEST_ROOT/empty"
git init "$empty"
emptyAttrs='{ lastModified = 0; lastModifiedDate = "19700101000000"; narHash = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="; rev = "0000000000000000000000000000000000000000"; revCount = 0; shortRev = "0000000"; submodules = false; }'
[[ $(nix eval --impure --expr "builtins.removeAttrs (builtins.fetchGit $empty) [\"outPath\"]") = $emptyAttrs ]]
emptyAttrs="{ lastModified = 0; lastModifiedDate = \"19700101000000\"; narHash = \"sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=\"; rev = \"0000000000000000000000000000000000000000\"; revCount = 0; shortRev = \"0000000\"; submodules = false; }"
result=$(nix eval --impure --expr "builtins.removeAttrs (builtins.fetchGit $empty) [\"outPath\"]")
[[ "$result" = "$emptyAttrs" ]]
echo foo > "$empty/x"
[[ $(nix eval --impure --expr "builtins.removeAttrs (builtins.fetchGit $empty) [\"outPath\"]") = $emptyAttrs ]]
result=$(nix eval --impure --expr "builtins.removeAttrs (builtins.fetchGit $empty) [\"outPath\"]")
[[ "$result" = "$emptyAttrs" ]]
git -C "$empty" add x
[[ $(nix eval --impure --expr "builtins.removeAttrs (builtins.fetchGit $empty) [\"outPath\"]") = '{ lastModified = 0; lastModifiedDate = "19700101000000"; narHash = "sha256-wzlAGjxKxpaWdqVhlq55q5Gxo4Bf860+kLeEa/v02As="; rev = "0000000000000000000000000000000000000000"; revCount = 0; shortRev = "0000000"; submodules = false; }' ]]
expected_attrs="{ lastModified = 0; lastModifiedDate = \"19700101000000\"; narHash = \"sha256-wzlAGjxKxpaWdqVhlq55q5Gxo4Bf860+kLeEa/v02As=\"; rev = \"0000000000000000000000000000000000000000\"; revCount = 0; shortRev = \"0000000\"; submodules = false; }"
result=$(nix eval --impure --expr "builtins.removeAttrs (builtins.fetchGit $empty) [\"outPath\"]")
[[ "$result" = "$expected_attrs" ]]
# Test a repo with an empty commit.
git -C "$empty" rm -f x

View file

@ -0,0 +1,67 @@
#!/usr/bin/env bash
# shellcheck source=common.sh
source common.sh
requireGit
# Create a test repo with multiple commits for all our tests
git init "$TEST_ROOT/shallow-parent"
git -C "$TEST_ROOT/shallow-parent" config user.email "foobar@example.com"
git -C "$TEST_ROOT/shallow-parent" config user.name "Foobar"
# Add several commits to have history
echo "{ outputs = _: {}; }" > "$TEST_ROOT/shallow-parent/flake.nix"
echo "" > "$TEST_ROOT/shallow-parent/file.txt"
git -C "$TEST_ROOT/shallow-parent" add file.txt flake.nix
git -C "$TEST_ROOT/shallow-parent" commit -m "First commit"
echo "second" > "$TEST_ROOT/shallow-parent/file.txt"
git -C "$TEST_ROOT/shallow-parent" commit -m "Second commit" -a
echo "third" > "$TEST_ROOT/shallow-parent/file.txt"
git -C "$TEST_ROOT/shallow-parent" commit -m "Third commit" -a
# Add a branch for testing ref fetching
git -C "$TEST_ROOT/shallow-parent" checkout -b dev
echo "branch content" > "$TEST_ROOT/shallow-parent/branch-file.txt"
git -C "$TEST_ROOT/shallow-parent" add branch-file.txt
git -C "$TEST_ROOT/shallow-parent" commit -m "Branch commit"
# Make a shallow clone (depth=1)
git clone --depth 1 "file://$TEST_ROOT/shallow-parent" "$TEST_ROOT/shallow-clone"
# Test 1: Fetching a shallow repo shouldn't work by default, because we can't
# return a revCount.
(! nix eval --impure --raw --expr "(builtins.fetchGit { url = \"$TEST_ROOT/shallow-clone\"; ref = \"dev\"; }).outPath")
# Test 2: But you can request a shallow clone, which won't return a revCount.
path=$(nix eval --impure --raw --expr "(builtins.fetchTree { type = \"git\"; url = \"file://$TEST_ROOT/shallow-clone\"; ref = \"dev\"; shallow = true; }).outPath")
# Verify file from dev branch exists
[[ -f "$path/branch-file.txt" ]]
# Verify revCount is missing
[[ $(nix eval --impure --expr "(builtins.fetchTree { type = \"git\"; url = \"file://$TEST_ROOT/shallow-clone\"; ref = \"dev\"; shallow = true; }).revCount or 123") == 123 ]]
# Test 3: Check unlocked input error message
expectStderr 1 nix eval --expr 'builtins.fetchTree { type = "git"; url = "file:///foo"; }' | grepQuiet "'fetchTree' doesn't fetch unlocked input"
# Test 4: Regression test for revCount in worktrees derived from shallow clones
# Add a worktree to the shallow clone
git -C "$TEST_ROOT/shallow-clone" worktree add "$TEST_ROOT/shallow-worktree"
# Prior to the fix, this would error out because of the shallow clone's
# inability to find parent commits. Now it should return an error.
if nix eval --impure --expr "(builtins.fetchGit { url = \"file://$TEST_ROOT/shallow-worktree\"; }).revCount" 2>/dev/null; then
echo "fetchGit unexpectedly succeeded on shallow clone" >&2
exit 1
fi
# Also verify that fetchTree fails similarly
if nix eval --impure --expr "(builtins.fetchTree { type = \"git\"; url = \"file://$TEST_ROOT/shallow-worktree\"; }).revCount" 2>/dev/null; then
echo "fetchTree unexpectedly succeeded on shallow clone" >&2
exit 1
fi
# Verify that we can shallow fetch the worktree
git -C "$TEST_ROOT/shallow-worktree" rev-list --count HEAD >/dev/null
nix eval --impure --raw --expr "(builtins.fetchGit { url = \"file://$TEST_ROOT/shallow-worktree\"; shallow = true; }).rev"

View file

@ -37,11 +37,20 @@ cat > "$flake3Dir/flake.nix" <<EOF
url = "$nonFlakeDir/README.md";
flake = false;
};
nonFlakeFile3 = {
url = "$nonFlakeDir?dir=README.md";
flake = false;
};
relativeNonFlakeFile = {
url = ./config.nix;
flake = false;
};
};
description = "Fnord";
outputs = inputs: rec {
inherit inputs;
packages.$system.xyzzy = inputs.flake2.packages.$system.bar;
packages.$system.sth = inputs.flake1.packages.$system.foo;
packages.$system.fnord =
@ -88,6 +97,44 @@ mv "$flake2Dir.tmp" "$flake2Dir"
mv "$nonFlakeDir.tmp" "$nonFlakeDir"
_NIX_TEST_BARF_ON_UNCACHEABLE='' nix build -o "$TEST_ROOT/result" flake3#xyzzy flake3#fnord
# Check non-flake inputs have a sourceInfo and an outPath
#
# This may look redundant, but the other checks below happen in a command
# substitution subshell, so failures there will not exit this shell
export _NIX_TEST_BARF_ON_UNCACHEABLE='' # FIXME
nix eval --raw flake3#inputs.nonFlake.outPath
nix eval --raw flake3#inputs.nonFlake.sourceInfo.outPath
nix eval --raw flake3#inputs.nonFlakeFile.outPath
nix eval --raw flake3#inputs.nonFlakeFile.sourceInfo.outPath
nix eval --raw flake3#inputs.nonFlakeFile2.outPath
nix eval --raw flake3#inputs.nonFlakeFile2.sourceInfo.outPath
nix eval --raw flake3#inputs.nonFlakeFile3.outPath
nix eval --raw flake3#inputs.nonFlakeFile3.sourceInfo.outPath
nix eval --raw flake3#inputs.relativeNonFlakeFile.outPath
nix eval --raw flake3#inputs.relativeNonFlakeFile.sourceInfo.outPath
# Check non-flake file inputs have the expected outPaths
[[
$(nix eval --raw flake3#inputs.nonFlake.outPath) \
= $(nix eval --raw flake3#inputs.nonFlake.sourceInfo.outPath)
]]
[[
$(nix eval --raw flake3#inputs.nonFlakeFile.outPath) \
= $(nix eval --raw flake3#inputs.nonFlakeFile.sourceInfo.outPath)
]]
[[
$(nix eval --raw flake3#inputs.nonFlakeFile2.outPath) \
= $(nix eval --raw flake3#inputs.nonFlakeFile2.sourceInfo.outPath)
]]
[[
$(nix eval --raw flake3#inputs.nonFlakeFile3.outPath) \
= $(nix eval --raw flake3#inputs.nonFlakeFile3.sourceInfo.outPath)/README.md
]]
[[
$(nix eval --raw flake3#inputs.relativeNonFlakeFile.outPath) \
= $(nix eval --raw flake3#inputs.relativeNonFlakeFile.sourceInfo.outPath)/config.nix
]]
# Make branch "removeXyzzy" where flake3 doesn't have xyzzy anymore
git -C "$flake3Dir" checkout -b removeXyzzy
rm "$flake3Dir/flake.nix"

View file

@ -131,3 +131,46 @@ EOF
# would fail:
nix eval .#ok
)
# https://github.com/NixOS/nix/issues/13164
mkdir -p "$TEST_ROOT/issue-13164/nested-flake1/nested-flake2"
(
cd "$TEST_ROOT/issue-13164"
git init
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
cat >flake.nix <<EOF
{
inputs.nestedFlake1.url = "path:./nested-flake1";
outputs = { self, nestedFlake1 }: {
inherit nestedFlake1;
};
}
EOF
cat >nested-flake1/flake.nix <<EOF
{
inputs.nestedFlake2.url = "path:./nested-flake2";
outputs = { self, nestedFlake2 }: {
name = "nestedFlake1";
inherit nestedFlake2;
};
}
EOF
cat >nested-flake1/nested-flake2/flake.nix <<EOF
{
outputs = { self }: {
name = "nestedFlake2";
};
}
EOF
git add .
git commit -m "Initial commit"
# I don't understand why two calls are necessary to reproduce the issue.
nix eval --json .#nestedFlake1.nestedFlake2 --no-eval-cache
nix eval --json .#nestedFlake1.nestedFlake2 --no-eval-cache
)

View file

@ -0,0 +1,101 @@
#!/usr/bin/env bash
source common.sh
set +x
expect_trace() {
expr="$1"
expect="$2"
actual=$(
nix-instantiate \
--eval-profiler flamegraph \
--eval-profiler-frequency 0 \
--eval-profile-file /dev/stdout \
--expr "$expr" |
grep "«string»" || true
)
echo -n "Tracing expression '$expr'"
msg=$(
diff -swB \
<(echo "$expect") \
<(echo "$actual")
) && result=0 || result=$?
if [ "$result" -eq 0 ]; then
echo " ok."
else
echo " failed. difference:"
echo "$msg"
return "$result"
fi
}
# lambda
expect_trace 'let f = arg: arg; in f 1' "
«string»:1:22:f 1
"
# unnamed lambda
expect_trace '(arg: arg) 1' "
«string»:1:1 1
"
# primop
expect_trace 'builtins.head [0 1]' "
«string»:1:1:primop head 1
"
# primop application
expect_trace 'let a = builtins.all (let f = x: x; in f); in a [1]' "
«string»:1:9:primop all 1
«string»:1:47:primop all 1
«string»:1:47:primop all;«string»:1:31:f 1
"
# functor
expect_trace '{__functor = x: arg: arg;} 1' "
«string»:1:1:functor 1
«string»:1:1:functor;«string»:1:2 1
"
# failure inside a tryEval
expect_trace 'builtins.tryEval (throw "example")' "
«string»:1:1:primop tryEval 1
«string»:1:1:primop tryEval;«string»:1:19:primop throw 1
"
# Missing argument to a formal function
expect_trace 'let f = ({ x }: x); in f { }' "
«string»:1:24:f 1
"
# Too many arguments to a formal function
expect_trace 'let f = ({ x }: x); in f { x = "x"; y = "y"; }' "
«string»:1:24:f 1
"
# Not enough arguments to a lambda
expect_trace 'let f = (x: y: x + y); in f 1' "
«string»:1:27:f 1
"
# Too many arguments to a lambda
expect_trace 'let f2 = (x: x); in f2 1 2' "
«string»:1:21:f2 1
"
# Not a function
expect_trace '1 2' "
«string»:1:1 1
"
# Derivation
expect_trace 'builtins.derivationStrict { name = "somepackage"; }' "
«string»:1:1:primop derivationStrict:somepackage 1
"
# Derivation without name attr
expect_trace 'builtins.derivationStrict { }' "
«string»:1:1:primop derivationStrict 1
"

View file

@ -34,13 +34,38 @@ cat << EOF > flake.nix
}
EOF
mkdir subflake
cp ./simple.nix ./simple.builder.sh ./formatter.simple.sh "${config_nix}" "$TEST_HOME/subflake"
cat << EOF > subflake/flake.nix
{
outputs = _: {
formatter.$system =
with import ./config.nix;
mkDerivation {
name = "formatter";
buildCommand = ''
mkdir -p \$out/bin
echo "#! ${shell}" > \$out/bin/formatter
cat \${./formatter.simple.sh} >> \$out/bin/formatter
chmod +x \$out/bin/formatter
'';
};
};
}
EOF
# No arguments check
[[ "$(nix fmt)" = "Formatting(0):" ]]
[[ "$(nix formatter run)" = "Formatting(0):" ]]
[[ "$(nix fmt)" = "PRJ_ROOT=$TEST_HOME Formatting(0):" ]]
[[ "$(nix formatter run)" = "PRJ_ROOT=$TEST_HOME Formatting(0):" ]]
# Argument forwarding check
nix fmt ./file ./folder | grep 'Formatting(2): ./file ./folder'
nix formatter run ./file ./folder | grep 'Formatting(2): ./file ./folder'
nix fmt ./file ./folder | grep "PRJ_ROOT=$TEST_HOME Formatting(2): ./file ./folder"
nix formatter run ./file ./folder | grep "PRJ_ROOT=$TEST_HOME Formatting(2): ./file ./folder"
# test subflake
cd subflake
nix fmt ./file | grep "PRJ_ROOT=$TEST_HOME/subflake Formatting(1): ./file"
# Build checks
## Defaults to a ./result.

View file

@ -1,2 +1,2 @@
#!/usr/bin/env bash
echo "Formatting(${#}):" "${@}"
echo "PRJ_ROOT=$PRJ_ROOT Formatting(${#}):" "${@}"

View file

@ -0,0 +1 @@
[ null null null null null null null null null null [ ] [ ] null null null null [ "gnu" "m4/m4-1.4.19.tar.bz2" ] null [ "cpan" "src/5.0/perl-5.40.0.tar.gz" ] null null null [ "10" "" ] [ "11" "" ] [ "36" ] null [ "exec" ] [ ] null [ "26" ] null [ "26" ] null [ ] null null null null null [ "meson.patch?h=mingw-w64-xorgproto&id=7b817efc3144a50e6766817c4ca7242f8ce49307" ] null null [ "xmlto" ] null null [ "exec" ] null null [ ] [ ] null null [ "coconutbattery-4.0.2,152" ] [ "12" "0" ] [ "12" "8" ] [ "8" "9" "5" "30" ] [ "9" "7" "1" "26" ] null null [ ] [ ] null [ ] null [ ] null null [ null null "draupnir" ] [ ] [ ] null null [ null null "renderer" ] [ ] [ ] [ null ] null [ null ] null null null [ ] [ ] [ "p" ] [ "p" ] [ "systemtap" ] null [ ] null null [ ] null [ "20220722-71c783507536-b7eae18423ef" ] [ "20220726-bac6d66b5ca1-5b966f2f136c" ] [ ] [ "0.3.2308" ] null null null [ "17.0.14+" "7" ] null [ null ] [ null ] null null [ "21.0.7+" "6" ] null null [ ] [ ] [ "8u442" "06" ] [ ] [ "jna" "5.6.0" null null ] [ "jna" "5.6.0" null null ] [ ] [ ] null [ "2" ] null [ ] [ ] null null [ ] [ ] null null [ ] null [ ] [ "https://github.com/GRA0007/google-cloud-rs.git" null null null "4a2db92efd57a896e14d18877458c6ae43418aec" ] [ "https://github.com/GRA0007/google-cloud-rs.git" null null null "4a2db92efd57a896e14d18877458c6ae43418aec" ] null [ ] null [ "rejeep" "ansi.el" ] null [ "rejeep" "commander.el" ] null [ "2.2.4" "20231021.200112" "6" ] [ "2.2.4" "20231021.200112" "6" ] [ ] [ ] null null [ "" ] [ "" ".git" ] [ "" "\\.git" ] null null null [ "" "__pycache__" ] [ "" "__pycache__" ] null null null [ "" ] null null [ ] [ ] [ ] [ "8u442" "06" ] [ ] [ ] [ "simulator" ] null null null null null null [ "notify-send" ] [ "playlistmanager" ] [ ] [ ] null null null null [ "name" ] [ "name" ] null null null null [ "pypy" "27" ] [ "pypy" "310" ] [ "refs/heads/master" ] null [ "refs/heads/master" ] null null [ ] null null null null [ ] [ ] [ ] [ ] [ "b7eae18423ef" ] [ "20220726-bac6d66b5ca1-5b966f2f136c" ] null null [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ "" ] [ ] ]

View file

@ -0,0 +1,938 @@
# Derived from nixpkgs f870c6ccc8951fc48aeb293cf3e98ade6ac42668 by instrumenting
# builtins.match to collect at most 2 non-matching and 2 matching cases of every
# regex used when running:
# `nix-env --query --available --out-path --eval-system x86_64-linux`.
builtins.map
(
list:
let
re = builtins.head list;
str = builtins.elemAt list 1;
in
builtins.match re str
)
[
[
''(.*)e?abi.*''
''linux''
]
[
''(.*)e?abi.*''
''linux''
]
[
''.*-none.*''
''x86_64-unknown-linux-gnu''
]
[
''.*nvptx.*''
''x86_64-unknown-linux-gnu''
]
[
''.*switch.*''
''x86_64-unknown-linux-gnu''
]
[
''.*-uefi.*''
''x86_64-unknown-linux-gnu''
]
[
''.*-none.*''
''x86_64-unknown-linux-gnu''
]
[
''.*nvptx.*''
''x86_64-unknown-linux-gnu''
]
[
''.*switch.*''
''x86_64-unknown-linux-gnu''
]
[
''.*-uefi.*''
''x86_64-unknown-linux-gnu''
]
[
''[[:alnum:]+_?=-][[:alnum:]+._?=-]*''
''bootstrap-stage0-glibc-bootstrapFiles''
]
[
''[[:alnum:]+_?=-][[:alnum:]+._?=-]*''
''glibc-2.40-66''
]
[
''mirror://([a-z]+)/(.*)''
''https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz''
]
[
''mirror://([a-z]+)/(.*)''
''https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=948ae97ca5703224bd3eada06b7a69f40dd15a02''
]
[
''.*/.*''
''mktemp''
]
[
''.*/.*''
''rm''
]
[
''mirror://([a-z]+)/(.*)''
''mirror://gnu/m4/m4-1.4.19.tar.bz2''
]
[
''5\.[0-9]*[13579]\..+''
''5.40.0''
]
[
''mirror://([a-z]+)/(.*)''
''mirror://cpan/src/5.0/perl-5.40.0.tar.gz''
]
[
''5\.[0-9]*[13579]\..+''
''5.40.0''
]
[
''^([0-9][0-9\.]*)(.*)$''
''addons''
]
[
''^([0-9][0-9\.]*)(.*)$''
''extras''
]
[
''^([0-9][0-9\.]*)(.*)$''
''10''
]
[
''^([0-9][0-9\.]*)(.*)$''
''11''
]
[
''[[:space:]]*0*(-?[[:digit:]]+)[[:space:]]*''
''36''
]
[
''0+''
''36''
]
[
''/bin/([^/]+)''
''/bin/exec''
]
[
''[[:alnum:],._+:@%/-]+''
''/bin/exec''
]
[
''[[:alnum:],._+:@%/-]+''
''''
]
[
''[[:space:]]*(-?[[:digit:]]+)[[:space:]]*''
''26''
]
[
''0[[:digit:]]+''
''26''
]
[
''[[:space:]]*(-?[[:digit:]]+)[[:space:]]*''
''26''
]
[
''0[[:digit:]]+''
''26''
]
[
''[[:alnum:],._+:@%/-]+''
''@tcl@''
]
[
''[[:alnum:],._+:@%/-]+''
''@[a-zA-Z_][0-9A-Za-z_'-]*@''
]
[
''.*pypy.*''
''/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/bin/python3.12''
]
[
''(.*/)?\.\.(/.*)?''
''package.nix''
]
[
''/bin/([^/]+)''
''''
]
[
''[[:alnum:]+_?=-][[:alnum:]+._?=-]*''
''meson.patch?h=mingw-w64-xorgproto&id=7b817efc3144a50e6766817c4ca7242f8ce49307''
]
[
''\.*(.*)''
''meson.patch?h=mingw-w64-xorgproto&id=7b817efc3144a50e6766817c4ca7242f8ce49307''
]
[
''/bin/([^/]+)''
''''
]
[
''.*-rc.*''
''2.49.0''
]
[
''(.*)\.git''
''xmlto.git''
]
[
''[a-f0-9]*''
''0.0.29''
]
[
''.*-rc.*''
''2.49.0''
]
[
''/bin/([^/]+)''
''/bin/exec''
]
[
''.*-polly.*''
''/nix/store/0yxfdnfxbzczjxhgdpac81jnas194wfj-gnu-install-dirs.patch''
]
[
''.*-polly.*''
''/nix/store/jh2pda7psaasq85b2rrigmkjdbl8d0a1-llvm-lit-cfg-add-libs-to-dylib-path.patch''
]
[
''.*-polly.*''
''/nix/store/x868j4ih7wqiivf6wr9m4g424jav0hpq-gnu-install-dirs-polly.patch''
]
[
''.*-polly.*''
''/nix/store/gr73nf6sca9nyzl88x58y3qxrav04yhd-polly-lit-cfg-add-libs-to-dylib-path.patch''
]
[
''(.*/)?\.\.(/.*)?''
''package.nix''
]
[
''[[:alnum:]+_?=-][[:alnum:]+._?=-]*''
''coconutbattery-4.0.2,152''
]
[
''\.*(.*)''
''coconutbattery-4.0.2,152''
]
[
''^([[:digit:]]+)\.([[:digit:]]+)$''
''12.0''
]
[
''^([[:digit:]]+)\.([[:digit:]]+)$''
''12.8''
]
[
''^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$''
''8.9.5.30''
]
[
''^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)$''
''9.7.1.26''
]
[
''^/.*''
''8.20''
]
[
''^/.*''
''8.20''
]
[
''^github.*''
''github.com''
]
[
''^github.*''
''github.com''
]
[
''^github.*''
''gitlab.inria.fr''
]
[
''^gitlab.*''
''gitlab.inria.fr''
]
[
''^github.*''
''gitlab.inria.fr''
]
[
''^gitlab.*''
''gitlab.inria.fr''
]
[
''^gitlab.*''
''sf.snu.ac.kr''
]
[
''^gitlab.*''
''sf.snu.ac.kr''
]
[
''^(@([^/]+)/)?([^/]+)$''
''draupnir''
]
[
''^[[:digit:]].*''
''0xproto''
]
[
''^[[:digit:]].*''
''3270''
]
[
''^[[:digit:]].*''
''adwaita-mono''
]
[
''^[[:digit:]].*''
''agave''
]
[
''^(@([^/]+)/)?([^/]+)$''
''renderer''
]
[
''[^[:space:]]*''
''900,906,908,1010,1012,1030''
]
[
''[^[:space:]]*''
''''
]
[
''.*[0-9]_LIN(UX)?.sh''
''Wolfram_14.2.1_LIN.sh''
]
[
''.*[0-9]_LIN(UX)?.sh''
''Wolfram_14.2.1_LIN_Bndl.sh''
]
[
''.*[0-9]_LIN(UX)?.sh''
''Wolfram_14.2.0_LIN.sh''
]
[
''.*[0-9]_LIN(UX)?.sh''
''Wolfram_14.2.0_LIN_Bndl.sh''
]
[
''[A-Z]''
''b''
]
[
''[A-Z]''
''l''
]
[
''[A-Z]''
''E''
]
[
''[A-Z]''
''T''
]
[
''([0-9A-Za-z._])[0-9A-Za-z._-]*''
''pythoncheck.sh''
]
[
''([0-9A-Za-z._])[0-9A-Za-z._-]*''
''pythoncheck.sh''
]
[
''(.*)\.git''
''systemtap.git''
]
[
''[a-f0-9]*''
''release-5.2''
]
[
''[a-f0-9]*''
''b7a857659f8485ee3c6769c27a3e74b0af910746''
]
[
''.*pypy.*''
''/nix/store/8w718rm43x7z73xhw9d6vh8s4snrq67h-python3-3.12.10/bin/python3.12''
]
[
''(.*)\.git''
''gn''
]
[
''[a-f0-9]*''
''df98b86690c83b81aedc909ded18857296406159''
]
[
''.*-rc\..*''
''22.14.0''
]
[
''.*/linux-gecko-(.*).tar.bz2''
''https://static.replay.io/downloads/linux-gecko-20220722-71c783507536-b7eae18423ef.tar.bz2''
]
[
''.*/linux-node-(.*)''
''https://static.replay.io/downloads/linux-node-20220726-bac6d66b5ca1-5b966f2f136c''
]
[
''.*-DSQLITE_ENABLE_FTS3.*''
''-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS3_TOKENIZER -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_STMT_SCANSTATUS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_SOUNDEX -DSQLITE_SECURE_DELETE -DSQLITE_MAX_VARIABLE_NUMBER=250000 -DSQLITE_MAX_EXPR_DEPTH=10000''
]
[
''
[
]*(.*[^
])[
]*''
''
0.3.2308
''
]
[
''(.*)\.git''
''rtmpdump''
]
[
''.*;.*''
''Game''
]
[
''.*;.*''
''Game''
]
[
''(.+)+(.+)''
''17.0.14+7''
]
[
''^#(.*)$''
''20240715''
]
[
''[[:alpha:]_][[:alnum:]_]*(\.[[:alpha:]_][[:alnum:]_]*)*''
''external_deps_dirs''
]
[
''[[:alpha:]_][[:alnum:]_]*(\.[[:alpha:]_][[:alnum:]_]*)*''
''local_cache''
]
[
''^#(.*)$''
''20240715''
]
[
''.*-rc\..*''
''20.19.2''
]
[
''(.+)+(.+)''
''21.0.7+6''
]
[
''.*llvm-tblgen.*''
''-DLLVM_INSTALL_PACKAGE_DIR:STRING=/02qcpld1y6xhs5gz9bchpxaw0xdhmsp5dv88lh25r2ss44kh8dxz/lib/cmake/llvm''
]
[
''.*llvm-tblgen.*''
''-DLLVM_ENABLE_RTTI:BOOL=TRUE''
]
[
''.*llvm-tblgen.*''
''-DLLVM_TABLEGEN:STRING=/nix/store/xp9hkw8nsw9p81d69yvcg1yr6f7vh71c-llvm-tblgen-18.1.8/bin/llvm-tblgen''
]
[
''.*llvm-tblgen.*''
''-DLLVM_TABLEGEN_EXE:STRING=/nix/store/xp9hkw8nsw9p81d69yvcg1yr6f7vh71c-llvm-tblgen-18.1.8/bin/llvm-tblgen''
]
[
''(.+)-b(.+)''
''8u442-b06''
]
[
''.*-DSQLITE_ENABLE_FTS3.*''
''-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS3_TOKENIZER -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_STMT_SCANSTATUS -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_SOUNDEX -DSQLITE_SECURE_DELETE -DSQLITE_MAX_VARIABLE_NUMBER=250000 -DSQLITE_MAX_EXPR_DEPTH=10000''
]
[
''([^/]*)/([^/]*)(/SNAPSHOT)?(/.*)?''
''jna/5.6.0''
]
[
''([^/]*)/([^/]*)(/SNAPSHOT)?(/.*)?''
''jna/5.6.0''
]
[
''[0-9]+''
''2''
]
[
''[0-9]+''
''3''
]
[
''[0-9]+''
''unstable''
]
[
''[[:space:]]*0*(-?[[:digit:]]+)[[:space:]]*''
''2''
]
[
''0+''
''2''
]
[
''0+''
''0''
]
[
''.*org/eclipse/jdt/ecj.*''
''https://repo.maven.apache.org/maven2/org/eclipse/jdt/ecj/maven-metadata.xml''
]
[
''.*[<>"'&].*''
''org.eclipse.jdt''
]
[
''.*[<>"'&].*''
''20241203050026''
]
[
''[a-zA-Z_][a-zA-Z0-9_'-]*''
''cpu''
]
[
''[a-zA-Z_][a-zA-Z0-9_'-]*''
''bits''
]
[
''armv[67]l-linux''
''x86_64-linux''
]
[
''armv[67]l-linux''
''x86_64-linux''
]
[
''0+''
''0''
]
[
''[0-9]+''
''rc''
]
[
''.*tensorflow_cpu.*''
''https://storage.googleapis.com/tensorflow/versions/2.19.0/tensorflow_cpu-2.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl''
]
[
''git\+([^?]+)(\?(rev|tag|branch)=(.*))?#(.*)''
''git+https://github.com/GRA0007/google-cloud-rs.git#4a2db92efd57a896e14d18877458c6ae43418aec''
]
[
''git\+([^?]+)(\?(rev|tag|branch)=(.*))?#(.*)''
''git+https://github.com/GRA0007/google-cloud-rs.git#4a2db92efd57a896e14d18877458c6ae43418aec''
]
[
''mpv[-_](.*)''
''detect-image''
]
[
''.*org/bouncycastle/bcutil-lts8on.*''
''https://plugins.gradle.org/m2/org/bouncycastle/bcutil-lts8on/maven-metadata.xml''
]
[
''^.*-unstable-([[:digit:]]{4})-([[:digit:]]{2})-([[:digit:]]{2})$''
''0.9.0''
]
[
''(.+)/(.+)''
''rejeep/ansi.el''
]
[
''^.*-unstable-([[:digit:]]{4})-([[:digit:]]{2})-([[:digit:]]{2})$''
''20230306.1823''
]
[
''(.+)/(.+)''
''rejeep/commander.el''
]
[
''mpv[-_](.*)''
''equalizer''
]
[
''(.*)-([^-]*)-([^-]*)''
''2.2.4-20231021.200112-6''
]
[
''(.*)-([^-]*)-([^-]*)''
''2.2.4-20231021.200112-6''
]
[
''.*com/badlogicgames/gdx-controllers/gdx-controllers-core.*''
''https://oss.sonatype.org/content/repositories/snapshots/com/badlogicgames/gdx-controllers/gdx-controllers-core/2.2.4-SNAPSHOT/maven-metadata.xml''
]
[
''.*com/badlogicgames/gdx-controllers/gdx-controllers-desktop.*''
''https://oss.sonatype.org/content/repositories/snapshots/com/badlogicgames/gdx-controllers/gdx-controllers-desktop/2.2.4-SNAPSHOT/maven-metadata.xml''
]
[
''^(#.*|$)''
''.git''
]
[
''^(#.*|$)''
''__pycache__''
]
[
''^(#.*|$)''
''''
]
[
''^(!?)(.*)''
''.git''
]
[
''^(/?)(.*)''
''\.git''
]
[
''.+/.+''
''\.git''
]
[
''^(.*)/$''
''(^|.*/)\.git''
]
[
''(^|.*/)\.git''
''.flake8''
]
[
''^(!?)(.*)''
''__pycache__''
]
[
''^(/?)(.*)''
''__pycache__''
]
[
''.+/.+''
''__pycache__''
]
[
''^(.*)/$''
''(^|.*/)__pycache__''
]
[
''(^|.*/)__pycache__''
''.flake8''
]
[
''^(#.*|$)''
''''
]
[
''(^|.*/)\.git''
''.gitignore''
]
[
''(^|.*/)__pycache__''
''.gitignore''
]
[
''^[a-fA-F0-9]{40}$''
''3a667bdb3d7f0955a5a51c8468eac83210c1439e''
]
[
''.*com/android/tools/build/gradle.*''
''https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/maven-metadata.xml''
]
[
''^[a-fA-F0-9]{40}$''
''dc0a228a5544988d4a920cfb40be9cd28db41423''
]
[
''(.+)-b(.+)''
''8u442-b06''
]
[
''.*com/tobiasdiez/easybind.*''
''https://oss.sonatype.org/content/groups/public/com/tobiasdiez/easybind/2.2.1-SNAPSHOT/maven-metadata.xml''
]
[
''.*org/hamcrest/hamcrest.*''
''https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest/maven-metadata.xml''
]
[
''^.*CONFIG_BOARD_DIRECTORY="([a-zA-Z0-9_]+)".*$''
''
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
# CONFIG_MACH_STM32 is not set
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RPXXXX is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
CONFIG_MACH_SIMU=y
CONFIG_BOARD_DIRECTORY="simulator"
CONFIG_CLOCK_FREQ=20000000
CONFIG_SERIAL=y
CONFIG_SIMULATOR_SELECT=y
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_ADC=y
CONFIG_WANT_SPI=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_WANT_HARD_PWM=y
CONFIG_WANT_BUTTONS=y
CONFIG_WANT_TMCUART=y
CONFIG_WANT_NEOPIXEL=y
CONFIG_WANT_PULSE_COUNTER=y
CONFIG_WANT_ST7920=y
CONFIG_WANT_HD44780=y
CONFIG_WANT_ADXL345=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_THERMOCOUPLE=y
CONFIG_WANT_HX71X=y
CONFIG_WANT_ADS1220=y
CONFIG_WANT_SENSOR_ANGLE=y
CONFIG_NEED_SENSOR_BULK=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_INLINE_STEPPER_HACK=y
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_HARD_PWM=y
''
]
[
''[^.]*[.][^.]*-.*''
''5.15.183-rt85''
]
[
''[^.]*[.][^.]*-.*''
''6.1.134-rt51''
]
[
''^\.sw[a-z]$''
''package.nix''
]
[
''^\..*\.sw[a-z]$''
''package.nix''
]
[
''^\.sw[a-z]$''
''pyproject.toml''
]
[
''^\..*\.sw[a-z]$''
''pyproject.toml''
]
[
''mpv[-_](.*)''
''mpv-notify-send''
]
[
''mpv[-_](.*)''
''mpv-playlistmanager''
]
[
''.*ch/qos/logback/logback-core.*''
''https://repo.maven.apache.org/maven2/ch/qos/logback/logback-core/maven-metadata.xml''
]
[
''.*commons-codec/commons-codec.*''
''https://repo.maven.apache.org/maven2/commons-codec/commons-codec/maven-metadata.xml''
]
[
''/[0-9a-z]{52}''
''/run/opengl-driver''
]
[
''/[0-9a-z]{52}''
''/dev/dri''
]
[
''<(.*)>''
''_module''
]
[
''<(.*)>''
''args''
]
[
''<(.*)>''
''<name>''
]
[
''<(.*)>''
''<name>''
]
[
''[a-zA-Z_][a-zA-Z0-9_'-]*''
''2bwm''
]
[
''[a-zA-Z_][a-zA-Z0-9_'-]*''
''pm.max_children''
]
[
''(pypy|python)([[:digit:]]*)''
''override''
]
[
''(pypy|python)([[:digit:]]*)''
''overrideDerivation''
]
[
''(pypy|python)([[:digit:]]*)''
''pypy27''
]
[
''(pypy|python)([[:digit:]]*)''
''pypy310''
]
[
''^ref: (.*)$''
''ref: refs/heads/master''
]
[
''^ref: (.*)$''
''f870c6ccc8951fc48aeb293cf3e98ade6ac42668''
]
[
''^ref: (.*)$''
''ref: refs/heads/master''
]
[
''^ref: (.*)$''
''f870c6ccc8951fc48aeb293cf3e98ade6ac42668''
]
[
''.*\.post[0-9]+''
''1.7.2''
]
[
''.*tensorflow_cpu.*''
''https://storage.googleapis.com/tensorflow/versions/2.19.0/tensorflow_cpu-2.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl''
]
[
''.*tensorflow_cpu.*''
''https://storage.googleapis.com/tensorflow/versions/2.19.0/tensorflow-2.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl''
]
[
''.*\.post[0-9]+''
''1.7.2''
]
[
''.*darwin.*''
''i686-cygwin''
]
[
''.*darwin.*''
''x86_64-cygwin''
]
[
''.*darwin.*''
''x86_64-darwin''
]
[
''.*darwin.*''
''aarch64-darwin''
]
[
''.*com/badlogicgames/gdx-controllers/gdx-controllers-core.*''
''https://oss.sonatype.org/content/repositories/snapshots/com/badlogicgames/gdx-controllers/gdx-controllers-core/2.2.4-SNAPSHOT/maven-metadata.xml''
]
[
''.*com/badlogicgames/gdx-controllers/gdx-controllers-desktop.*''
''https://oss.sonatype.org/content/repositories/snapshots/com/badlogicgames/gdx-controllers/gdx-controllers-desktop/2.2.4-SNAPSHOT/maven-metadata.xml''
]
[
''.*/linux-recordreplay-(.*).tgz''
''https://static.replay.io/downloads/linux-recordreplay-b7eae18423ef.tgz''
]
[
''.*/linux-node-(.*)''
''https://static.replay.io/downloads/linux-node-20220726-bac6d66b5ca1-5b966f2f136c''
]
[
''.*-large-wordlist.*''
''hunspell-dict-cs-cz-libreoffice-6.3.0.4''
]
[
''.*-large-wordlist.*''
''hunspell-dict-da-dk-2.5.189''
]
[
''.*-large-wordlist.*''
''hunspell-dict-en-au-large-wordlist-2018.04.16''
]
[
''.*-large-wordlist.*''
''hunspell-dict-en-ca-large-wordlist-2018.04.16''
]
[
''.*com/fazecast/jSerialComm.*''
''https://oss.sonatype.org/content/repositories/snapshots/com/fazecast/jSerialComm/2.11.1-SNAPSHOT/maven-metadata.xml''
]
[
''.*net/java/dev/jna/jna-platform.*''
''https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna-platform/5.1.1-SNAPSHOT/maven-metadata.xml''
]
[
''.*net/java/dev/jna/jna-platform.*''
''https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna-platform/maven-metadata.xml''
]
[
''.*net/java/dev/jna/jna.*''
''https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna/5.1.1-SNAPSHOT/maven-metadata.xml''
]
[
''.*net/java/dev/jna/jna.*''
''https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/jna/maven-metadata.xml''
]
[
''.*org/java-websocket/Java-WebSocket.*''
''https://oss.sonatype.org/content/repositories/snapshots/org/java-websocket/Java-WebSocket/1.3.10-SNAPSHOT/maven-metadata.xml''
]
[
''.*org/java-websocket/Java-WebSocket.*''
''https://oss.sonatype.org/content/repositories/snapshots/org/java-websocket/Java-WebSocket/maven-metadata.xml''
]
[
''.*com/melloware/jintellitype.*''
''https://repo.maven.apache.org/maven2/com/melloware/jintellitype/maven-metadata.xml''
]
[
''[0-9.]*([a-z]*)''
''2025.1.1''
]
[
''.*com/velocitypowered/velocity-brigadier.*''
''https://repo.papermc.io/repository/maven-public/com/velocitypowered/velocity-brigadier/1.0.0-SNAPSHOT/maven-metadata.xml''
]
]

View file

@ -1 +1 @@
[ [ 42 77 147 249 483 526 ] [ 526 483 249 147 77 42 ] [ "bar" "fnord" "foo" "xyzzy" ] [ { key = 1; value = "foo"; } { key = 1; value = "fnord"; } { key = 2; value = "bar"; } ] [ [ ] [ ] [ 1 ] [ 1 4 ] [ 1 5 ] [ 1 6 ] [ 2 ] [ 2 3 ] [ 3 ] [ 3 ] ] ]
[ [ 42 77 147 249 483 526 ] [ 526 483 249 147 77 42 ] [ "bar" "fnord" "foo" "xyzzy" ] [ { key = 1; value = "foo"; } { key = 1; value = "fnord"; } { key = 2; value = "bar"; } ] [ { key = 1; value = "foo"; } { key = 1; value = "foo2"; } { key = 1; value = "foo3"; } { key = 1; value = "foo4"; } { key = 1; value = "foo5"; } { key = 1; value = "foo6"; } { key = 1; value = "foo7"; } { key = 1; value = "foo8"; } { key = 2; value = "bar"; } { key = 2; value = "bar2"; } { key = 2; value = "bar3"; } { key = 2; value = "bar4"; } { key = 2; value = "bar5"; } { key = 3; value = "baz"; } { key = 3; value = "baz2"; } { key = 3; value = "baz3"; } { key = 3; value = "baz4"; } { key = 4; value = "biz1"; } ] [ [ ] [ ] [ 1 ] [ 1 4 ] [ 1 5 ] [ 1 6 ] [ 2 ] [ 2 3 ] [ 3 ] [ 3 ] ] ]

View file

@ -37,6 +37,80 @@ with builtins;
value = "fnord";
}
])
(sort (x: y: x.key < y.key) [
{
key = 1;
value = "foo";
}
{
key = 2;
value = "bar";
}
{
key = 1;
value = "foo2";
}
{
key = 2;
value = "bar2";
}
{
key = 2;
value = "bar3";
}
{
key = 2;
value = "bar4";
}
{
key = 1;
value = "foo3";
}
{
key = 3;
value = "baz";
}
{
key = 3;
value = "baz2";
}
{
key = 1;
value = "foo4";
}
{
key = 3;
value = "baz3";
}
{
key = 1;
value = "foo5";
}
{
key = 1;
value = "foo6";
}
{
key = 2;
value = "bar5";
}
{
key = 3;
value = "baz4";
}
{
key = 1;
value = "foo7";
}
{
key = 4;
value = "biz1";
}
{
key = 1;
value = "foo8";
}
])
(sort lessThan [
[
1

View file

@ -33,3 +33,12 @@ if isDaemonNewer "2.26"; then
# Build works despite ill-formed structured build log entries.
expectStderr 0 nix build -f ./logging/unusual-logging.nix --no-link | grepQuiet 'warning: Unable to handle a JSON message from the derivation builder:'
fi
# Test json-log-path.
if [[ "$NIX_REMOTE" != "daemon" ]]; then
clearStore
nix build -vv --file dependencies.nix --no-link --json-log-path "$TEST_ROOT/log.json" 2>&1 | grepQuiet 'building.*dependencies-top.drv'
jq < "$TEST_ROOT/log.json"
grep '{"action":"start","fields":\[".*-dependencies-top.drv","",1,1\],"id":.*,"level":3,"parent":0' "$TEST_ROOT/log.json" >&2
(( $(grep '{"action":"msg","level":5,"msg":"executing builder .*"}' "$TEST_ROOT/log.json" | wc -l) == 5 ))
fi

View file

@ -73,6 +73,7 @@ suites = [
'gc-runtime.sh',
'tarball.sh',
'fetchGit.sh',
'fetchGitShallow.sh',
'fetchurl.sh',
'fetchPath.sh',
'fetchTree-file.sh',
@ -133,6 +134,7 @@ suites = [
'post-hook.sh',
'function-trace.sh',
'formatter.sh',
'flamegraph-profiler.sh',
'eval-store.sh',
'why-depends.sh',
'derivation-json.sh',

View file

@ -3,6 +3,7 @@ libplugintest = shared_module(
'plugintest.cc',
dependencies : [
dependency('nix-expr'),
# hack for trailing newline
],
build_by_default : false,
)

View file

@ -67,7 +67,7 @@ testRepl () {
# Simple test, try building a drv
testRepl
# Same thing (kind-of), but with a remote store.
testRepl --store "$TEST_ROOT/store?real=$NIX_STORE_DIR"
testRepl --store "$TEST_ROOT/other-root?real=$NIX_STORE_DIR"
# Remove ANSI escape sequences. They can prevent grep from finding a match.
stripColors () {
@ -157,7 +157,33 @@ foo + baz
' "3" \
./flake ./flake\#bar
# Test the `:reload` mechanism with flakes:
testReplResponse $'
:a { a = 1; b = 2; longerName = 3; "with spaces" = 4; }
' 'Added 4 variables.
a, b, longerName, "with spaces"
'
cat <<EOF > attribute-set.nix
{
a = 1;
b = 2;
longerName = 3;
"with spaces" = 4;
}
EOF
testReplResponse '
:l ./attribute-set.nix
' 'Added 4 variables.
a, b, longerName, "with spaces"
'
testReplResponseNoRegex $'
:a builtins.foldl\' (x: y: x // y) {} (map (x: { ${builtins.toString x} = x; }) (builtins.genList (x: x) 23))
' 'Added 23 variables.
"0", "1", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2", "20", "21", "22", "3", "4", "5", "6"
... and 3 more; view with :ll'
# Test the `:reload` mechansim with flakes:
# - Eval `./flake#changingThing`
# - Modify the flake
# - Re-eval it
@ -278,6 +304,12 @@ testReplResponseNoRegex '
}
'
# Don't prompt for more input when getting unexpected EOF in imported files.
testReplResponse "
import $testDir/lang/parse-fail-eof-pos.nix
" \
'.*error: syntax error, unexpected end of file.*'
# TODO: move init to characterisation/framework.sh
badDiff=0
badExitCode=0
@ -323,7 +355,8 @@ runRepl () {
-e "s@$testDir@/path/to/tests/functional@g" \
-e "s@$testDirNoUnderscores@/path/to/tests/functional@g" \
-e "s@$nixVersion@<nix version>@g" \
-e "s@Added [0-9]* variables@Added <number omitted> variables@g" \
-e "/Added [0-9]* variables/{s@ [0-9]* @ <number omitted> @;n;d}" \
-e '/\.\.\. and [0-9]* more; view with :ll/d' \
| grep -vF $'warning: you don\'t have Internet access; disabling some network-dependent features' \
;
}

View file

@ -40,3 +40,14 @@ jsonOut="$(nix print-dev-env -f structured-attrs-shell.nix --json)"
test "$(<<<"$jsonOut" jq '.structuredAttrs|keys|.[]' -r)" = "$(printf ".attrs.json\n.attrs.sh")"
test "$(<<<"$jsonOut" jq '.variables.outputs.value.out' -r)" = "$(<<<"$jsonOut" jq '.structuredAttrs.".attrs.json"' -r | jq -r '.outputs.out')"
# Hacky way of making structured attrs. We should preserve for now for back compat, but also deprecate.
hackyExpr='derivation { name = "a"; system = "foo"; builder = "/bin/sh"; __json = builtins.toJSON { a = 1; }; }'
# Check for deprecation message
expectStderr 0 nix-instantiate --expr "$hackyExpr" --eval --strict | grepQuiet "In derivation 'a': setting structured attributes via '__json' is deprecated, and may be disallowed in future versions of Nix. Set '__structuredAttrs = true' instead."
# Check it works with the expected structured attrs
hacky=$(nix-instantiate --expr "$hackyExpr")
nix derivation show "$hacky" | jq --exit-status '."'"$hacky"'".structuredAttrs | . == {"a": 1}'

View file

@ -14,7 +14,6 @@ execUnshare <<EOF
# Avoid store dir being inside sandbox build-dir
unset NIX_STORE_DIR
unset NIX_STATE_DIR
setLocalStore () {
export NIX_REMOTE=\$TEST_ROOT/\$1

View file

@ -3,6 +3,7 @@ libstoreconsumer_tester = executable(
'main.cc',
dependencies : [
dependency('nix-store'),
# hack for trailing newline
],
build_by_default : false,
)

View file

@ -40,5 +40,9 @@ in
# Test that /nix/store is available via an overlayfs mount.
machine.succeed("nix shell --store /tmp/nix ${pkgA} --command cowsay foo >&2")
# Building in /tmp should fail for security reasons.
err = machine.fail("nix build --offline --store /tmp/nix --expr 'builtins.derivation { name = \"foo\"; system = \"x86_64-linux\"; builder = \"/foo\"; }' 2>&1")
assert "is world-writable" in err
'';
}

View file

@ -1,21 +1,15 @@
# Test the container built by ../../docker.nix.
{
lib,
config,
nixpkgs,
hostPkgs,
...
}:
let
pkgs = config.nodes.machine.nixpkgs.pkgs;
nixImage = import ../../docker.nix {
inherit (config.nodes.machine.nixpkgs) pkgs;
};
nixUserImage = import ../../docker.nix {
inherit (config.nodes.machine.nixpkgs) pkgs;
nixImage = pkgs.callPackage ../../docker.nix { };
nixUserImage = pkgs.callPackage ../../docker.nix {
name = "nix-user";
uid = 1000;
gid = 1000;

View file

@ -104,15 +104,16 @@ in
# Wait for the build to be ready
# This is OK because it runs as root, so we can access everything
machine.wait_for_file("/tmp/nix-build-open-build-dir.drv-0/build/syncPoint")
machine.wait_until_succeeds("stat /nix/var/nix/builds/nix-build-open-build-dir.drv-*/build/syncPoint")
dir = machine.succeed("ls -d /nix/var/nix/builds/nix-build-open-build-dir.drv-*").strip()
# But Alice shouldn't be able to access the build directory
machine.fail("su alice -c 'ls /tmp/nix-build-open-build-dir.drv-0/build'")
machine.fail("su alice -c 'touch /tmp/nix-build-open-build-dir.drv-0/build/bar'")
machine.fail("su alice -c 'cat /tmp/nix-build-open-build-dir.drv-0/build/foo'")
machine.fail(f"su alice -c 'ls {dir}/build'")
machine.fail(f"su alice -c 'touch {dir}/build/bar'")
machine.fail(f"su alice -c 'cat {dir}/build/foo'")
# Tell the user to finish the build
machine.succeed("echo foo > /tmp/nix-build-open-build-dir.drv-0/build/syncPoint")
machine.succeed(f"echo foo > {dir}/build/syncPoint")
with subtest("Being able to execute stuff as the build user doesn't give access to the build dir"):
machine.succeed(r"""
@ -124,16 +125,17 @@ in
args = [ (builtins.storePath "${create-hello-world}") ];
}' >&2 &
""".strip())
machine.wait_for_file("/tmp/nix-build-innocent.drv-0/build/syncPoint")
machine.wait_until_succeeds("stat /nix/var/nix/builds/nix-build-innocent.drv-*/build/syncPoint")
dir = machine.succeed("ls -d /nix/var/nix/builds/nix-build-innocent.drv-*").strip()
# The build ran as `nixbld1` (which is the only build user on the
# machine), but a process running as `nixbld1` outside the sandbox
# shouldn't be able to touch the build directory regardless
machine.fail("su nixbld1 --shell ${pkgs.busybox-sandbox-shell}/bin/sh -c 'ls /tmp/nix-build-innocent.drv-0/build'")
machine.fail("su nixbld1 --shell ${pkgs.busybox-sandbox-shell}/bin/sh -c 'echo pwned > /tmp/nix-build-innocent.drv-0/build/result'")
machine.fail(f"su nixbld1 --shell ${pkgs.busybox-sandbox-shell}/bin/sh -c 'ls {dir}/build'")
machine.fail(f"su nixbld1 --shell ${pkgs.busybox-sandbox-shell}/bin/sh -c 'echo pwned > {dir}/build/result'")
# Finish the build
machine.succeed("echo foo > /tmp/nix-build-innocent.drv-0/build/syncPoint")
machine.succeed(f"echo foo > {dir}/build/syncPoint")
# Check that the build was not affected
machine.succeed(r"""