Commit Graph
18979 Commits
Author SHA1 Message Date
eldritch horrors 5d11ed07f5 testing: migrate flakes/flakes.sh (part 5)
build bare repo, build tarball, lock path urls without repo

Change-Id: I7cb7494dcf29ec9b88c923c54a798685725785a1
2026-02-25 12:47:08 +00:00
eldritch horrors 4ef9fb3aee testing: migrate flakes/flakes.sh (part 4)
metadata query functionality

Change-Id: I8f3866316994426664468edfbe154505ed2428af
2026-02-25 12:47:08 +00:00
eldritch horrors 126ef6321d testing: migrate flakes/flakes.sh (part 3)
add-path and path-info interactions

Change-Id: I8649442eb54d539957d4339a00b948e1173d2da7
2026-02-25 12:47:08 +00:00
eldritch horrors 987a906317 testing: migrate flakes/flakes.sh (part 2)
legacy cli interactions

Change-Id: Ibdefbbf4b10ea8554a75caf589bb1f5a26639f4a
2026-02-25 12:47:08 +00:00
eldritch horrors 1df00b7db0 testing: migrate flakes/flakes.sh (part 1)
handling of alternate lock file locations

Change-Id: I402fa3b1a48805e571eecc6772f2656e93c68086
2026-02-25 12:47:08 +00:00
eldritch horrors e76c6afd8d testing: migrate flakes/follow-paths.sh
Change-Id: I825445a51f496dbe2efde684a0045e6fb56d9c0a
2026-02-25 12:47:08 +00:00
Thomas MiedemaandQyriad 6182a5e659 nix-daemon: source nix-profile-daemon.sh only once
Cherry-picked-from: https://github.com/NixOS/nix/pull/12805
Co-authored-by: Qyriad <qyriad@qyriad.me>
Fixes: #1134
Change-Id: I0c575f6b974e06b5064564bb084829fa6a6a6964
2026-02-24 18:36:39 +00:00
skye 53c0e884d8 Migrate EvalState::eval from out param to return a Value
Instead of taking in a final argument `Value &` out parameter which it
writes to, it now returns its result

Change-Id: Iab6bc3a3ac6a4b17c6d31115a766a6ea6a6a6964
2026-02-24 13:00:30 -05:00
skye d14613459b libexpr: Migrate EvalState::callFunction to return a Value
Previously it had an out parameter. Now it has a return value.

Change-Id: I9ec465a7d23b99da9132f1ab0fcc5cf16a6a6964
2026-02-24 13:00:30 -05:00
eldritch horrors 3b0e2ddd0a libutil: don't report DecompressionStream shutdown errors
we already report errors that happen during reads via exceptions
rethrown from read. reporting errors during destruction too is a
source of confusion for users since these errors are not usually
relevant and just the decompressor thread reporting short reads.
shorts reads during shutdown are not an error, they're expected.

fixes #1138

Change-Id: I7983ef0ed7722460f1d683bc8171a454b3d06e90
2026-02-24 15:28:56 +01:00
Qyriad 6b4de44461 nix-env/query: don't use RAII for closing xml tag
I could instead add the right braces or manually ensure the
XMLOpenElement destructor is run at the right time. Or I could just
write what I actually want to happen.

Fixes #1137.

Change-Id: Ie1f157de1632571fb0c21e26d8e3cae56a6a6964
2026-02-24 12:28:45 +01:00
skye 1ef7ccfc72 libexpr: migrate Expr::eval to return a Value, take 2
This is a rebase of CL 1626 after the performance problems that blocked
that change are no longer an issue.

Change-Id: I4a17f7606c5fdc9a924933a860eb401f6a6a6964
2026-02-23 18:11:47 -05:00
skye 62a2663436 libexpr: Replace Value::mkBool with constructor calls
Change-Id: I714271f6cbd2f5b2d6e1e7fe7eb7feab6a6a6964
2026-02-23 15:12:35 -05:00
rootile d641a829bb tests/functional2: migrate brotli.sh and zstd.sh
Change-Id: I5f1252e8f29a9551f3d6b2ed8f0598f524906aed
2026-02-23 20:44:46 +01:00
skye 864c5e7507 libexpr: Replace Value::mkInt with constructor calls
Change-Id: I09b8e3aa61042a60c2ae767fc44c26b66a6a6964
2026-02-23 11:55:02 -05:00
skye 23a0b78a16 libexpr: Replace Value::mkFloat with constructor calls
The pseudo-constructor `Value::mkFloat` would previously be called on an
default-constructed (under-initialized) `Value` to create a properly
initialized `Value` that represents a float. This change removes mkFloat
and constructs float `Value`s directly.

Change-Id: I48ae3a836842ce5e5eda6323404ba7576a6a6964
2026-02-23 11:51:29 -05:00
skye 492d7bbe1f libexpr: Convert Value::mkStringMove to a constructor
The pseudo-constructor `Value::mkStringMove` would previously be called
on a default-constructed (under-initialized) `Value` to create a
properly initialized `Value` that represents a string, reusing an
existing GC allocated Str. This change turns that method into a proper
constructor

Change-Id: I8d7a97e2afce231a04ecf56fdd6d22d06a6a6964
2026-02-23 11:40:02 -05:00
rootile 6b9a121637 testing: throw an error when a command object has not been run
it sometimes happens that one forgets to add `.run().ok()` to a command,
leading to things not actually being tested, potentially even slipping
though code reviews!

This commit adds a check at fixture teardown time, checking that all
commands have been run. Sadly, due to when this check happens, we cannot
add a test checking for this behavior

Change-Id: If3df2c20c267b9f03ae0ca099b77c57e2310f335
2026-02-23 17:21:01 +01:00
eldritch horrors b015654133 testing: also report tests that fail teardown as failures
this includes tests that fail teardown when *skipped*, which confuses
the tap parser by reporting more tests than advertised in the header.
not sure what to do about this though, and it is better than nothing.

Change-Id: I4fc6badacbfa3b3d5f5f4a4ad76b177379bb4a30
2026-02-23 16:57:35 +01:00
eldritch horrors 3c1c130c59 testing: disable progress reports in tap mode
pytest-tap didn't get it right in combination with xdist. we need to
replace the reporter *completely*, which is just incredibly weird :/

Change-Id: I2e35b9dc8ea4b24563b9b3306312778781eb674e
2026-02-23 15:26:18 +00:00
skye e8f161ead1 libexpr: Replace Value::mkPath with constructor calls
The pseudo-constructor `Value::mkPath` would previously be called on an
default-constructed (under-initialized) `Value` to create a properly
initialized `Value` that represents a path. This change
removes mkPath and constructs path `Value`s directly.

Change-Id: I9021de1ff59490828f9fec6866e083996a6a6964
2026-02-23 09:37:40 -05:00
skye d07bbb109e libexpr: Replace Value::mkAttrs with constructor calls
The pseudo-constructor `Value::mkAttrs` would previously be called on an
default-constructed (under-initialized) `Value` to create a properly
initialized `Value` that represents an attribute set. This change
removes mkAttrs and constructs attr `Value`s directly.

Change-Id: I11cd801eefecd454a7a5b6229d6770d06a6a6964
2026-02-23 03:54:35 +00:00
eldritch horrors c2b61c5da3 testing: migrate flakes/mercurial.sh
hg is *so fucking slow* omfw

Change-Id: I0f4d1d2a546a75f965ff017c9451fb1d441990b1
2026-02-22 20:46:06 +00:00
eldritch horrors 7a3f352105 testing: migrate flakes/flake-in-submodule.sh
Change-Id: I9dcf63a2f63b54de541536a00dbd5d8df941ea33
2026-02-22 20:46:06 +00:00
eldritch horrors 8b1ca49fef testing: migrate flakes/develop-r8854.sh
Change-Id: Ib993d30edb97d7705acbf5d94f1831ffbe191d92
2026-02-22 20:46:06 +00:00
eldritch horrors d69048e92b testing: migrate flakes/develop.sh
Change-Id: Ibd97c54efb72285a4b969fe11e6e6adf3a2d5511
2026-02-22 20:46:06 +00:00
Jade Lovelace 01ff67595b nix3-add-path: add references-list argument for ca with references
This is not ca-derivations. We don't care about self-references or any of the
rewriting or stuff like that; if you want something like that, write
your user code so it figures out where it is.

The reason I want to do this is for integrating other build systems with
Lix: if you're importing something built *outside the store* with a
non-Nix build system, it makes no sense to put it in an input-addressed
path since it's not possible to come up with a derivation for it.
But you need *some* hash, so the output hashing is the most sensible option.
It is also nice because of not needing trusted user privileges to import
it, since the hash describes the exact contents of the output path.

We use this feature (implemented externally to Lix; this CL eliminates
that step) at Mercury to integrate buck2 with Nix on the output side: we
import things to the Nix store as ca paths with references.

These can then be consumed by Nix language with:

```
# Hack from https://git.lix.systems/lix-project/lix/issues/402#issuecomment-5889
path:
builtins.appendContext path {
  ${path} = {
    path = true;
  };
}
```

Test plan:
```
$ nix store add-path --references-list xx-refs-list ./README.md
/nix/store/szcwnm13d9gmxx8fly0bz82l42jgysw6-README.md

$ cat xx-refs-list
/nix/store/g9hhwjbkdrw0wnbd3axfs4icyb37nr6b-bash-interactive-5.3p3

$ nix path-info --json /nix/store/szcwnm13d9gmxx8fly0bz82l42jgysw6-README.md | jq .
[
  {
    "ca": "fixed:r:sha256:1pj59fy7zcrn949ry9kgv4ba17h2sy3z2is469abj912cvbl14n3",
    "narHash": "sha256-w5JA12YiJLlUMkRH8YfXAp6gFtlvJp8TSTazf7xLRd4=",
    "narSize": 1384,
    "path": "/nix/store/szcwnm13d9gmxx8fly0bz82l42jgysw6-README.md",
    "references": [
      "/nix/store/g9hhwjbkdrw0wnbd3axfs4icyb37nr6b-bash-interactive-5.3p3"
    ],
    "registrationTime": 1771266146,
    "valid": true
  }
]
```

Change-Id: I005a03003dfc24108e018e599dbe0b5d6a6a6964
2026-02-21 22:50:13 +00:00
eldritch horrors ff8a10f9cd testing: move shell-hello.nix from global assets to flakes
Change-Id: I0039e82cd5ed069d901f4dd96cf33102216a11ea
2026-02-21 16:36:44 +00:00
eldritch horrors 46f99487de testing: use TAP for when running f2 from meson
this requires some hacks to make error reports visible, but hey. it's
better than no progress reports at all, and successful runs no longer
spew huge amounts of useless log output onto the developer's terminal

Change-Id: I9e4766b2f825a4ec451e117eb4609db65f328785
2026-02-21 16:36:44 +00:00
vczf 86268bd618 meson: fix broken build when using custom build directory
Fixes path resolution issue with meson-embedded bash script when
`build` is a symlink, or a custom build directory is passed as a
argument to `just` or `meson`.

Change-Id: I67b13c524d196241bb9a8a3b8ad2c17c2c094ed8
2026-02-20 23:32:33 +00:00
eldritch horrors c040a9d8e4 libstore: only check cgroup support when actually building
not all operations that involve workers need to build. for example nix
copy --from calls instantiate thir worker with the *origin* store, not
the store they copy *into*. for binary cache stores this is not likely
to ever work if cgroups are enabled and the copy is run on normal user
credentials, even though no cgroups will ever be needed to copy things

fixes #1088

Change-Id: I065e29e1a1d0f58d81823609ef0701ff82cdd1d5
2026-02-19 22:26:59 +01:00
eldritch horrors 4fcb434998 testing: migrate flakes/registry.sh
Change-Id: Iba7dd30efc19075a63c505db497b3c0967b47f57
2026-02-18 15:25:08 +00:00
eldritch horrors 4deed5ab35 testing: migrate flakes/build-paths.sh
Change-Id: Ia7f15abd8f5444c69fef4da0d080a2933ac264d8
2026-02-18 13:00:37 +00:00
eldritch horrors 03b8a6dcc2 testing: migrate flakes/flake-metadata.sh
Change-Id: I8370a279bbfa224f27cdba0cf9e79ade6d58644f
2026-02-18 11:32:33 +00:00
eldritch horrors fedb4d5ead testing: migrate flakes/inputs.sh
Change-Id: I4446441cb7eea51a42f055f042cceb3e63b84b92
2026-02-18 11:32:33 +00:00
eldritch horrors 28e1cccb49 testing: migrate flakes/init.sh
Change-Id: If132a14e3d10578489cdca03f67c2166f1362d6e
2026-02-18 11:31:40 +00:00
eldritch horrors fc7165401f testing: migrate flakes/symlink_paths to git fixture
Change-Id: Ieb6eb4b9b91c920fa5ee395dc0f7308965355045
2026-02-17 17:22:24 +01:00
eldritch horrors b1776ce4e2 testing: migrates flakes/subdir-flake.sh
Change-Id: I9ac02056d490473dd751f7ec7857840290f5afc5
2026-02-17 17:22:23 +01:00
eldritch horrors fa7edb9e01 testing: migrate flakes/bundle.sh
Change-Id: I734b52da3c62d6f562d6c843b89cb55ba6bd70d2
2026-02-17 17:21:44 +01:00
eldritch horrors 9adc840eda testing: migrate flakes/unlocked-override.sh
Change-Id: I101c96860e0a025a066880d952d2f24f9b92571e
2026-02-17 17:21:42 +01:00
eldritch horrors 899c5fe9f0 testing: migrate flakes/absolute-paths.sh
Change-Id: Icb9f7e1c8bf17327e32e1ad81f2bfdb4246ba2d7
2026-02-17 16:01:00 +01:00
eldritch horrors 2d73b59679 testing: migrate flakes/search-path.sh
Change-Id: I69c3efe2a33cfb216ffecf5b4bd7f57abb80acfd
2026-02-17 16:01:00 +01:00
eldritch horrors 8500339d95 testing: migrate flakes/config.sh
Change-Id: I7f19b33c30330ccd1f01b72b2e36a542f03f4e49
2026-02-17 16:01:00 +01:00
eldritch horrors 762a28a698 testing: migrate non-pty bits of flakes/show.sh
Change-Id: I4884fd34fa485f9f91281dc3efd69dedd3aad3d9
2026-02-17 16:00:59 +01:00
eldritch horrors ffefebd9f4 testing: migrate flakes/check.sh
Change-Id: I4cb9c675ccfc1763e54ce80f8521300b608bb0eb
2026-02-17 14:20:50 +01:00
eldritch horrors c6931c4176 testing: migrate flakes/circular.sh
Change-Id: Ia9eb3631278957c449dd8791e9cf02cb47705a63
2026-02-17 13:53:26 +01:00
eldritch horrors 04988fa318 f2: add git and git_cmd fixtures for calling git
Change-Id: Icdc03c76164d0db503a2f6c90f2bcb2377d9ced5
2026-02-17 13:53:26 +01:00
eldritch horrors f31ece23da testing: migrate flakes/run.sh
Change-Id: Id953cd257c3831d67531ffa4a131607519361227
2026-02-17 13:53:25 +01:00
Max Siling f1ce35f53c libfetchers: produce a proper error when both ref and rev are set
Affects `github`, `gitlab` and `sourcehut` fetchers.
Previously this was an assertion, which crashed the evaluator
with SIGABRT.

Fixes: #1133
Change-Id: Ia9bb8dd29ac8b9c97bf048827f62c5076a6a6964
2026-02-16 14:25:40 +03:00
eldritch horrors 9520e663c8 libstore: send all changed settings to builtin-builder
this includes logger verbosity, which isn't a setting for some reason.

fixes #1111

Change-Id: Ib078205b41069628010273645e26baf33b1c6d14
2026-02-12 18:00:33 +00:00