Compare commits
16 Commits
fetchFinal
...
2.30.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
857365c859 | ||
|
|
9497b593c6 | ||
|
|
1cf202650a | ||
|
|
eb3c004972 | ||
|
|
382e25405a | ||
|
|
c8cab890fa | ||
|
|
7119d594fc | ||
|
|
f880135ff8 | ||
|
|
37487eec8e | ||
|
|
ed8f7df56d | ||
|
|
8b0cfaed9b | ||
|
|
dcc4b7c6fd | ||
|
|
65b9e019dd | ||
|
|
48c7e5e14f | ||
|
|
f7c95fde88 | ||
|
|
812e069302 |
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@@ -14,6 +14,8 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
install_url: "https://releases.nixos.org/nix/nix-2.29.1/install"
|
||||
- run: nix --experimental-features 'nix-command flakes' flake show --all-systems --json
|
||||
|
||||
tests:
|
||||
@@ -36,6 +38,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
install_url: "https://releases.nixos.org/nix/nix-2.29.1/install"
|
||||
# The sandbox would otherwise be disabled by default on Darwin
|
||||
extra_nix_config: |
|
||||
sandbox = true
|
||||
|
||||
13
docker.nix
13
docker.nix
@@ -184,11 +184,14 @@ let
|
||||
} " = ";
|
||||
};
|
||||
|
||||
nixConfContents = toConf {
|
||||
sandbox = false;
|
||||
build-users-group = "nixbld";
|
||||
trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
|
||||
};
|
||||
nixConfContents = toConf (
|
||||
{
|
||||
sandbox = false;
|
||||
build-users-group = "nixbld";
|
||||
trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
|
||||
}
|
||||
// nixConf
|
||||
);
|
||||
|
||||
userHome = if uid == 0 then "/root" else "/home/${uname}";
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
officialRelease = false;
|
||||
officialRelease = true;
|
||||
|
||||
linux32BitSystems = [ "i686-linux" ];
|
||||
linux64BitSystems = [
|
||||
|
||||
@@ -834,8 +834,13 @@ install_from_extracted_nix() {
|
||||
(
|
||||
cd "$EXTRACTED_NIX_PATH"
|
||||
|
||||
_sudo "to copy the basic Nix files to the new store at $NIX_ROOT/store" \
|
||||
cp -RPp ./store/* "$NIX_ROOT/store/"
|
||||
if is_os_darwin; then
|
||||
_sudo "to copy the basic Nix files to the new store at $NIX_ROOT/store" \
|
||||
cp -RPp ./store/* "$NIX_ROOT/store/"
|
||||
else
|
||||
_sudo "to copy the basic Nix files to the new store at $NIX_ROOT/store" \
|
||||
cp -RP --preserve=ownership,timestamps ./store/* "$NIX_ROOT/store/"
|
||||
fi
|
||||
|
||||
_sudo "to make the new store non-writable at $NIX_ROOT/store" \
|
||||
chmod -R ugo-w "$NIX_ROOT/store/"
|
||||
|
||||
@@ -167,7 +167,11 @@ for i in $(cd "$self/store" >/dev/null && echo ./*); do
|
||||
rm -rf "$i_tmp"
|
||||
fi
|
||||
if ! [ -e "$dest/store/$i" ]; then
|
||||
cp -RPp "$self/store/$i" "$i_tmp"
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
cp -RPp "$self/store/$i" "$i_tmp"
|
||||
else
|
||||
cp -RP --preserve=ownership,timestamps "$self/store/$i" "$i_tmp"
|
||||
fi
|
||||
chmod -R a-w "$i_tmp"
|
||||
chmod +w "$i_tmp"
|
||||
mv "$i_tmp" "$dest/store/$i"
|
||||
|
||||
@@ -1602,7 +1602,7 @@ void EvalState::callFunction(Value & fun, std::span<Value *> args, Value & vRes,
|
||||
symbols[i.name])
|
||||
.atPos(lambda.pos)
|
||||
.withTrace(pos, "from call site")
|
||||
.withFrame(*fun.lambda().env, lambda)
|
||||
.withFrame(*vCur.lambda().env, lambda)
|
||||
.debugThrow();
|
||||
}
|
||||
env2.values[displ++] = i.def->maybeThunk(*this, env2);
|
||||
@@ -1629,7 +1629,7 @@ void EvalState::callFunction(Value & fun, std::span<Value *> args, Value & vRes,
|
||||
.atPos(lambda.pos)
|
||||
.withTrace(pos, "from call site")
|
||||
.withSuggestions(suggestions)
|
||||
.withFrame(*fun.lambda().env, lambda)
|
||||
.withFrame(*vCur.lambda().env, lambda)
|
||||
.debugThrow();
|
||||
}
|
||||
unreachable();
|
||||
|
||||
@@ -124,7 +124,7 @@ static void prim_fetchClosure(EvalState & state, const PosIdx pos, Value * * arg
|
||||
for (auto & attr : *args[0]->attrs()) {
|
||||
const auto & attrName = state.symbols[attr.name];
|
||||
auto attrHint = [&]() -> std::string {
|
||||
return "while evaluating the '" + attrName + "' attribute passed to builtins.fetchClosure";
|
||||
return fmt("while evaluating the attribute '%s' passed to builtins.fetchClosure", attrName);
|
||||
};
|
||||
|
||||
if (attrName == "fromPath") {
|
||||
|
||||
@@ -715,16 +715,12 @@ LockedFlake lockFlake(
|
||||
Finally cleanup([&]() { parents.pop_back(); });
|
||||
|
||||
/* Recursively process the inputs of this
|
||||
flake. Also, unless we already have this flake
|
||||
in the top-level lock file, use this flake's
|
||||
own lock file. */
|
||||
flake, using its own lock file. */
|
||||
nodePaths.emplace(childNode, inputFlake.path.parent());
|
||||
computeLocks(
|
||||
inputFlake.inputs, childNode, inputAttrPath,
|
||||
oldLock
|
||||
? std::dynamic_pointer_cast<const Node>(oldLock)
|
||||
: readLockFile(state.fetchSettings, inputFlake.lockFilePath()).root.get_ptr(),
|
||||
oldLock ? followsPrefix : inputAttrPath,
|
||||
readLockFile(state.fetchSettings, inputFlake.lockFilePath()).root.get_ptr(),
|
||||
inputAttrPath,
|
||||
inputFlake.path,
|
||||
false);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ bool useBuildUsers()
|
||||
#ifdef __linux__
|
||||
static bool b = (settings.buildUsersGroup != "" || settings.autoAllocateUids) && isRootUser();
|
||||
return b;
|
||||
#elif defined(__APPLE__) && defined(__FreeBSD__)
|
||||
#elif defined(__APPLE__) || defined(__FreeBSD__)
|
||||
static bool b = settings.buildUsersGroup != "" && isRootUser();
|
||||
return b;
|
||||
#else
|
||||
|
||||
@@ -432,3 +432,41 @@ nix flake metadata "$flake2Dir" --reference-lock-file $TEST_ROOT/flake2-overridd
|
||||
|
||||
# reference-lock-file can only be used if allow-dirty is set.
|
||||
expectStderr 1 nix flake metadata "$flake2Dir" --no-allow-dirty --reference-lock-file $TEST_ROOT/flake2-overridden.lock
|
||||
|
||||
# After changing an input (flake2 from newFlake2Rev to prevFlake2Rev), we should have the transitive inputs locked by revision $prevFlake2Rev of flake2.
|
||||
prevFlake1Rev=$(nix flake metadata --json "$flake1Dir" | jq -r .revision)
|
||||
prevFlake2Rev=$(nix flake metadata --json "$flake2Dir" | jq -r .revision)
|
||||
|
||||
echo "# bla" >> "$flake1Dir/flake.nix"
|
||||
git -C "$flake1Dir" commit flake.nix -m 'bla'
|
||||
|
||||
nix flake update --flake "$flake2Dir"
|
||||
git -C "$flake2Dir" commit flake.lock -m 'bla'
|
||||
|
||||
newFlake1Rev=$(nix flake metadata --json "$flake1Dir" | jq -r .revision)
|
||||
newFlake2Rev=$(nix flake metadata --json "$flake2Dir" | jq -r .revision)
|
||||
|
||||
cat > "$flake3Dir/flake.nix" <<EOF
|
||||
{
|
||||
inputs.flake2.url = "flake:flake2/master/$newFlake2Rev";
|
||||
|
||||
outputs = { self, flake2 }: {
|
||||
};
|
||||
}
|
||||
EOF
|
||||
git -C "$flake3Dir" commit flake.nix -m 'bla'
|
||||
|
||||
rm "$flake3Dir/flake.lock"
|
||||
nix flake lock "$flake3Dir"
|
||||
[[ "$(nix flake metadata --json "$flake3Dir" | jq -r .locks.nodes.flake1.locked.rev)" = $newFlake1Rev ]]
|
||||
|
||||
cat > "$flake3Dir/flake.nix" <<EOF
|
||||
{
|
||||
inputs.flake2.url = "flake:flake2/master/$prevFlake2Rev";
|
||||
|
||||
outputs = { self, flake2 }: {
|
||||
};
|
||||
}
|
||||
EOF
|
||||
|
||||
[[ "$(nix flake metadata --json "$flake3Dir" | jq -r .locks.nodes.flake1.locked.rev)" = $prevFlake1Rev ]]
|
||||
|
||||
12
tests/functional/lang/eval-fail-missing-arg-import.err.exp
Normal file
12
tests/functional/lang/eval-fail-missing-arg-import.err.exp
Normal file
@@ -0,0 +1,12 @@
|
||||
error:
|
||||
… from call site
|
||||
at /pwd/lang/eval-fail-missing-arg-import.nix:1:1:
|
||||
1| import ./non-eval-trivial-lambda-formals.nix { }
|
||||
| ^
|
||||
2|
|
||||
|
||||
error: function 'anonymous lambda' called without required argument 'a'
|
||||
at /pwd/lang/non-eval-trivial-lambda-formals.nix:1:1:
|
||||
1| { a }: a
|
||||
| ^
|
||||
2|
|
||||
1
tests/functional/lang/eval-fail-missing-arg-import.nix
Normal file
1
tests/functional/lang/eval-fail-missing-arg-import.nix
Normal file
@@ -0,0 +1 @@
|
||||
import ./non-eval-trivial-lambda-formals.nix { }
|
||||
@@ -0,0 +1,13 @@
|
||||
error:
|
||||
… from call site
|
||||
at /pwd/lang/eval-fail-undeclared-arg-import.nix:1:1:
|
||||
1| import ./non-eval-trivial-lambda-formals.nix {
|
||||
| ^
|
||||
2| a = "a";
|
||||
|
||||
error: function 'anonymous lambda' called with unexpected argument 'b'
|
||||
at /pwd/lang/non-eval-trivial-lambda-formals.nix:1:1:
|
||||
1| { a }: a
|
||||
| ^
|
||||
2|
|
||||
Did you mean a?
|
||||
@@ -0,0 +1,4 @@
|
||||
import ./non-eval-trivial-lambda-formals.nix {
|
||||
a = "a";
|
||||
b = "b";
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ a }: a
|
||||
@@ -81,7 +81,7 @@ let
|
||||
mkdir -p $out/archive
|
||||
|
||||
dir=NixOS-nixpkgs-${nixpkgs.shortRev}
|
||||
cp -prd ${nixpkgs} $dir
|
||||
cp -rd --preserve=ownership,timestamps ${nixpkgs} $dir
|
||||
# Set the correct timestamp in the tarball.
|
||||
find $dir -print0 | xargs -0 touch -h -t ${builtins.substring 0 12 nixpkgs.lastModifiedDate}.${
|
||||
builtins.substring 12 2 nixpkgs.lastModifiedDate
|
||||
|
||||
@@ -48,7 +48,7 @@ let
|
||||
|
||||
nixpkgs-repo = pkgs.runCommand "nixpkgs-flake" { } ''
|
||||
dir=NixOS-nixpkgs-${nixpkgs.shortRev}
|
||||
cp -prd ${nixpkgs} $dir
|
||||
cp -rd --preserve=ownership,timestamps ${nixpkgs} $dir
|
||||
|
||||
# Set the correct timestamp in the tarball.
|
||||
find $dir -print0 | xargs -0 touch -h -t ${builtins.substring 0 12 nixpkgs.lastModifiedDate}.${
|
||||
|
||||
@@ -13,7 +13,7 @@ let
|
||||
|
||||
set -x
|
||||
dir=nixpkgs-${nixpkgs.shortRev}
|
||||
cp -prd ${nixpkgs} $dir
|
||||
cp -rd --preserve=ownership,timestamps ${nixpkgs} $dir
|
||||
# Set the correct timestamp in the tarball.
|
||||
find $dir -print0 | xargs -0 touch -h -t ${builtins.substring 0 12 nixpkgs.lastModifiedDate}.${
|
||||
builtins.substring 12 2 nixpkgs.lastModifiedDate
|
||||
|
||||
Reference in New Issue
Block a user