Poll for nspawn containers' journal for as long as needed rather than giving up
after ten seconds, ensuring we can still get output on slower nodes.
Before this change, resource-constrained environments or node parallelism could
make for a situation where it gave up before they loaded, preventing output
for the rest of the run.
Assisted-by: Claude:claude-opus-5
I usually write extensive test modules and more often than not, I want
to use something like this:
testScript = lib.mkBefore ''
... some common initialisation ...
'';
Unfortunately, the type of testScript is types.str, so right now I'm
working around this using ugly things like this:
options.testScript = lib.mkOption {
type = let
newType = types.either types.lines (types.functionTo types.lines);
in newType // {
typeMerge = lib.const newType;
};
};
While this results in roughly the same (using types.lines instead of
types.str), I should not have to do this downstream, so hereby let's
make it types.lines.
Signed-off-by: aszlig <aszlig@nix.build>
Use an ordered list in the description of options created by
utils.mkStateRevisionOption instead of a table. The man page renderer
(for `man configuration.nix`) does not support generating tables, even
though the HTML renderer does.
We have a lot of changes in the style of
def foo(
self,
new: dt.timedelta | None = None,
old: float | None = None,
)
which is OK for cases where the API is used as
foo(old=23.5)
however for named arguments that actually falls short in the `ty`-stage:
foo(23.5)
As a workaround I flipped the order of old/new and changed the type of
`old` to accept both a timedelta and the old type, i.e.
def foo(
self,
old: float | dt.timedelta | None = None,
new: dt.timedelta | None = None,
)
and only give a deprecation warning if `old` is not of type `dt.timedelta | None`.
That way, both
foo(old=23.5)
foo(23.5)
are still accepted, at the same time, both
foo(new=timedelta(...))
foo(timedelta(...))
are OK.
Wasi P2 is different enough to Wasi P1 to warrant being treated entirely
separately, rather than as two minor variants of the same thing. P3 will
likewise want to be a different target.
I've left aliases in place; maybe eventually, those can be deprecated
and removed. I've tested this, but it's possible there might be breakage
somewhere (e.g., the canonical doubles for P1 have changed, though I
can't imagine why anyone would rely on that).
Fixes https://github.com/NixOS/nixpkgs/issues/435954
primaryIPAddress is defined using lib.optionalString. If it is the
empty string (because there are no assigned IP addresses), and the
machine has a hostname, we don't want to generate an invalid hosts
file with that empty string as the first (IP address) field.
The env var approach caps out at 128K which makes large test scripts fail checks with:
```
error: executing '.../bin/bash': Argument list too long
```
The script already exists in the store, let's use that.
With this patch I essentially get the expected list of maintainers for changes in
nixos-tests.
The downside of this approach is that the CI facility assumes that
there's at most a single definition of `meta.maintainers`, however it
can be more in a module-system context.
For simplicity, just use the first definition location for the time
being.
Verified with
let
lib = import ./lib;
maintainers = import ./ci/eval/compare/maintainers.nix { inherit lib; };
in
maintainers {
changedFiles = [
"nixos/tests/matrix/matrix-authentication-service.nix"
];
affectedAttrPaths = map (lib.splitString ".") [
"nixosTests.matrix-authentication-service"
];
}
Apparently this wasn't the case before, but now it is
In [3]: machine.shell_interact()
??? Warning (DeprecationWarning): Use the SSH backdoor instead
File "<ipython-input-3-4e72ea6a987e>", line 1
Reviewing #512771 got me thinking and I'm not sure I see a good reason
to keep this method given the SSH backdoor functionality has a much
better UX.
I'd propose we deprecate it, await 26.11 to see if people complain and
remove it alltogether after that.