Commit Graph
19000 Commits
Author SHA1 Message Date
eldritch horrors 8cf21fcf75 testing: migrate case-hack.sh
Change-Id: I552dd596764a779e1485a6326363d4f4283110f3
2026-02-27 17:42:17 +00:00
eldritch horrors 4caa622d78 testing: migrate fetchMercurial.sh
Change-Id: Iab81ea161e3be69bf7753b3ed9cd8f59cd8fe0ed
2026-02-27 17:42:17 +00:00
Qyriad f13566a3f6 repl: fix 'tokens-no-whitespace' in :use's Nix expression
Change-Id: Ifa2bc6b1204cc5a85422128c76b192296a6a6964
2026-02-27 08:51:40 +00:00
eldritch horrors 0bcdfe2c43 testing: migrate fmt.sh
Change-Id: Icc593b57a06c7fdf75762094982788f6351dcadc
2026-02-26 19:43:39 +00:00
Raito Bezarius bcab3d5da3 libstore/build: set impure environment variables only if they are set
To stop spurious warnings, we will stop this bizarre behavior of setting
empty values to impure environment variables.

On the warning side, we verify that the presence of the environment
variable.

The corresponding test is updated to "there is a warning" to "there is
no warning".

Change-Id: I12f5c6445ef00a83d269488d7aed0b0f61aeec12
2026-02-26 15:33:22 +00:00
Raito Bezarius 72a6d5ff48 tests/functional2: test spurious warnings for certificates
All impure environment variables are initialized as part of `initEnv()`
to an empty value if they are unset.

Whenever `NIX_SSL_CERT_FILE` is set, this cause a spurious warning.

Let's document it here as a test before we fix it.

Change-Id: Iccba8ccb487d9cc25490e940ff09c1c5a13ae097
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-02-26 15:33:22 +00:00
Raito Bezarius 0741e24266 tests/functional2: migrate (un|)sandboxed CA tests
CA tests have grown quite complicated and are hard to debug and
manoeuver for new needs.

They are a prime target for F2 migration and they were extremely
pleasant to write.

Most functionality is preserved or improved with additional behaviors
asserted on warnings and the full set of reports.

Change-Id: I70cd52abbe5ff13f56744b966ab00962ad3a49d6
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-02-26 15:33:22 +00:00
eldritch horrors dde7bddbd4 f2: fix Nix::add_[dx]p_feature type hints
Change-Id: I743b3ac821315465d1d22700ca9b06d8cc1985f0
2026-02-26 14:16:13 +00:00
eldritch horrors f2df62439c testing: migrate flakes/flakes.sh (part 18)
nonflake inputs

Change-Id: I5017ece5028652e3ae19c5e00e67358fc9c0253d
2026-02-26 13:11:25 +00:00
eldritch horrors 30ce32e2f6 testing: migrate flakes/flakes.sh (part 17)
symlinks in flake dirs, recursive lookups, update with override

Change-Id: I1491ca8e618ff5e06a06d3cc3648ae0750a1ffde
2026-02-26 13:11:25 +00:00
eldritch horrors b92f1aa865 testing: migrate flakes/flakes.sh (part 16)
input overrides during locking

Change-Id: I20e8e8bc2579f2f9bbaf7b522647a520d010ec43
2026-02-26 13:11:25 +00:00
eldritch horrors cbe4d1b339 testing: migrate flakes/flakes.sh (part 15)
flake follows handling during locking

Change-Id: Ia3f2b7a8df1d0ec51fd97d14d49788b33dda7754
2026-02-26 13:11:25 +00:00
eldritch horrors 2634585a48 testing: migrate flakes/flakes.sh (part 14)
flake clone

Change-Id: I6697d109465eaededfb2ac8ee552b6ac971d2e8a
2026-02-26 13:11:25 +00:00
eldritch horrors f0f8117d5b testing: migrate flakes/flakes.sh (part 13)
builds with incomplete lockfiles

Change-Id: Ibf386ec98208d5b706236277e2eae9e144d9bdb0
2026-02-26 13:11:25 +00:00
eldritch horrors 93af25a706 testing: migrate flakes/flakes.sh (part 12)
gc rooting behavior

Change-Id: I7b3aa765b8e08aa8a4ce96988629ee76c76b46a0
2026-02-26 13:11:25 +00:00
eldritch horrors c45e34bbc5 testing: migrate flakes/flakes.sh (part 11)
input updates with cli commands

Change-Id: Idddfe77a285f9c2cbc4f1463454af539042bc23e
2026-02-26 13:11:25 +00:00
eldritch horrors f864626a1c testing: migrate flakes/flakes.sh (part 10)
getFlake behavior

Change-Id: Iff9bb6e834ff2545db11b72f5a6ab3ddf42e5662
2026-02-25 12:47:08 +00:00
eldritch horrors c090a9d1ec testing: migrate flakes/flakes.sh (part 9)
bulk of build tests

Change-Id: I2b357162e16e2d14bb8ae6247ad126ad452c0825
2026-02-25 12:47:08 +00:00
eldritch horrors 3327a1fcae testing: migrate flakes/flakes.sh (part 8)
eval-system influences attribute choice

Change-Id: I02d611ed17748c73d5c77ebd0a44f558ab63d1c8
2026-02-25 12:47:08 +00:00
eldritch horrors 7976f9fb6e testing: migrate flakes/flakes.sh (part 7)
registry maintenance and queries

Change-Id: Id0aef61ce91972417ba3a941aba7b2c9ca05bf7c
2026-02-25 12:47:08 +00:00
eldritch horrors b4846d4e51 testing: migrate flakes/flakes.sh (part 6)
flake attr matching

Change-Id: If5a1f01f9939740636482d2755eb836e2166ce97
2026-02-25 12:47:08 +00:00
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