Commit Graph
17493 Commits
Author SHA1 Message Date
Teo Camarasu ffe2dd40f4 doc: improve entry for nix-store --query --valid-derivers
Let's use similar terminology and formatting to the other entries,
and make it a bit clearer.

The information here is based on the changelog entry from when this
feature was added.

Change-Id: Ia859c710588180ca827c665a70650eb4db5a1c45
2025-02-25 16:46:51 +00:00
eldritch horrors 42a8fb9656 libstore: asyncify Realisation::closure
Change-Id: I8ed52455bea0e166098de9c77d55a2f843530d64
2025-02-25 02:09:22 +00:00
eldritch horrors c566a69e79 libstore: asyncify Store::query{,Partial}DerivationOutputMap
Change-Id: I1383f7986d454963409096501df47ddd4aa33602
2025-02-25 02:09:22 +00:00
Raito BezariusandGerrit Code Review 446af4c6fe Merge "flake: Add support for x86_64-freebsd." into main 2025-02-24 23:12:12 +00:00
Raito Bezarius 55cbabd316 feat(libstore/build): always create a new cgroup namespace
There's no reason to make it dependent upon `Xp::Cgroups`, this
increases the purity of the builders' views.

Change-Id: I3d934428177e6bb78cd700d1cce1ded8a88e9da0
Signed-off-by: Raito Bezarius <raito@lix.systems>
2025-02-25 00:00:48 +01:00
Artemis TosiniandRaito Bezarius f42d6f0b52 flake: Add support for x86_64-freebsd.
Now that we're using nixpkgs 24.11 it's possible to build cross
for FreeBSD from linux, both in a derivation and a devShell.

Change-Id: I06fa257023397a97cdc72af51170e8523e9f1bfb
2025-02-24 23:54:04 +01:00
piegamesandGerrit Code Review 945e674bc8 Merge "libexpr: Refactor formals handling" into main 2025-02-24 18:28:52 +00:00
eldritch horrors ea6ba6a460 libstore: asyncify Store::queryDerivationOutputs
Change-Id: Ie9f67ff0b9193978021d58afb2bf2758288215f7
2025-02-24 15:09:02 +00:00
eldritch horrors acd7916af4 libstore: asyncify LogStore::addBuildLog
Change-Id: Idfbeecc9ad8ecba53eea25cbbee65bf85a550e79
2025-02-24 15:09:02 +00:00
eldritch horrors 63a96b1d31 libstore: asyncify LogStore::getBuildLogExact
Change-Id: Ie8492c2a0dbdbaeebc0d1608ad461f3e7a7f5b52
2025-02-24 15:09:02 +00:00
eldritch horrors 719f58b930 libstore: asyncify Store::topoSortPaths
Change-Id: Iaad42a6f021434a5f160c88ca7c8afe6ff280806
2025-02-24 15:09:02 +00:00
eldritch horrors e6fee559f7 libmain: asyncify printMissing
Change-Id: Iac87ecbbab4c65ddd6e3a32bdb64107ed7f9b3c0
2025-02-24 15:09:02 +00:00
eldritch horrors 4042d9c167 libstore: asyncify copyStorePath
Change-Id: I846bc5c95b54313594b2714981bb7434dbca96b7
2025-02-24 15:09:02 +00:00
eldritch horrors 381eca9947 libstore: asyncify Store::makeValidityRegistration
Change-Id: Ic1c31240d73db6783842664fbfa9607401a3b4a7
2025-02-24 15:09:02 +00:00
eldritch horrors 3cdf9fed2f libstore: asyncify Store::init
Change-Id: I38d59b40ab806996018f0ed17896e3ca9dc303be
2025-02-24 15:09:02 +00:00
eldritch horrors c6f5a6a196 perl: fix computeFSClosure
we must await the promise. also add a Werror argument to not break this again.

Change-Id: Ia02fee1720c0280853bc299d3d20301370d93e56
2025-02-24 15:09:02 +00:00
piegames 2e5239d2e5 libexpr: Refactor formals handling
This is kind of a painful change, because a lot of code grew around the
bad abstraction, but the goal here is to abstract formals in a way that
allows adding other means of pattern matching / argument destructuring
in the future.

Change-Id: If4e681a4be3d1f42ceea81a8e07297f0d08acc80
2025-02-24 13:48:29 +01:00
piegames 0928d4d87a flakes: Make checkOverlay less strict
I'm sorry but checking the name of the function arguments to be "final"
and "prev" is just absurd. That's like worst of
type-checking-meets-static-analysis. And the error message of the second
`throw` was not even good, as it mixed all three failure cases together.

Change-Id: Id4244171123dd8a228be71ce9f04d8e9f647c111
2025-02-24 12:54:48 +01:00
Raito BezariusandGerrit Code Review 43b0902390 Merge "feat: add support for external lix- prefixed commands in the CLI" into main 2025-02-24 10:51:27 +00:00
eldritch horrors b6dadd5cf0 libstore: asyncify Store::queryValidPaths
Change-Id: I3a3303b288321cd812f4df87c80a676f997e57b9
2025-02-23 17:18:48 +00:00
eldritch horrors f09f7c88a5 libutil: allow async threadpool waiting
Change-Id: I133e7390ebe05120e0de18d58a1c743c6c2ba973
2025-02-23 17:18:48 +00:00
eldritch horrors a4e7cfdb57 libutil: make PushActivity movable
while not copy-assignable it was still copy-constructible, which can
lead to some very unfortunate interactions with closure captures. we
will also need to move current-activity handles in upcoming changes.

Change-Id: I63cede83b9790820c6bd8784fb5d47e5246b7c4a
2025-02-23 17:18:48 +00:00
eldritch horrors f9a05605c1 libstore: asyncify resolveDerivedPath
Change-Id: I4606cdc9c935a4b40f68f12d742bc1e40d35b310
2025-02-23 17:18:48 +00:00
eldritch horrors 91387bbb13 libstore: asyncify Store::computeFSClosure
Change-Id: I79d3e9c60886a9eb58051a28cdda25dadcead9f1
2025-02-23 17:18:48 +00:00
eldritch horrors f06040f5d8 libutil: add computeClosureAsync
Change-Id: I5d9a11a106e9e0d9e49d08d1d04f579ba55255a9
2025-02-23 17:18:48 +00:00
eldritch horrors cc3a9897e3 libstore: asyncify printClosureDiff
Change-Id: I4982d34e565f9e59931c4e675c2d142fcacce81f
2025-02-23 17:18:48 +00:00
eldritch horrors bc0e0786f0 libstore: asyncify Store::getClosureSize
Change-Id: I625c92f94e2a77b64569d385d486434ae41df2da
2025-02-23 17:18:48 +00:00
eldritch horrors bd8272faec libstore: asyncify RealisedPath::closure
Change-Id: Ibc81c4cd504665410542274d2ffe97c72c347ac2
2025-02-23 17:18:48 +00:00
eldritch horrors a514e22166 libstore: asyncify a bunch of toJSON methods
why these are allowed to do IO that can end up blocking is beyond us

Change-Id: I9718900b016b3c0755d5bb668a5c270546cc4b17
2025-02-23 17:18:48 +00:00
eldritch horrors 990b3b0cfc libstore: asyncify Derivation::tryResolve
Change-Id: Id00e1d2a2316ab1daafcd308ee5e48c36e9c3a43
2025-02-23 17:18:48 +00:00
eldritch horrors 645a90b3e2 libstore: asyncify GcStore::findRoots
also includes LocalStore methods findRoots, findRootsNoTemp, findRuntimeRoots

Change-Id: I721cfabaf9a7bf44ac8af513a53cd4cd01109e53
2025-02-23 17:18:48 +00:00
eldritch horrors b33214a643 libstore: asyncify GcStore::collectGarbage
Change-Id: I0406444b518f66c22eb043fcbc7de90122974c42
2025-02-23 17:18:48 +00:00
Raito Bezarius 5f50741ce9 feat: add support for external lix- prefixed commands in the CLI
This feature allows calling external binaries starting with `lix-` as
subcommands directly within the `lix` CLI, similar to how Git handles
external commands.

For example, a binary named `lix-example` can now be invoked using `lix
example`.

This change opens up the possibility for broader community-driven
extensions of the Lix CLI, offering flexibility that Flakes has somewhat
restricted by centralizing certain features around its own model of
dependency management.

By enabling users to introduce custom subcommands, we encourage
experimentation and diverse workflows, addressing the needs of those who
seek more modular, feature-rich approaches to package management and
system configuration beyond what Flakes currently offers [1] [2] [3].

This adds `lix` as a new binary to be able to use this feature.

[1]: https://github.com/nmattia/niv
[2]: https://github.com/andir/npins
[3]: https://github.com/nikstur/lon

Change-Id: Ic6344424a6a46fc9fb30432f00e21c3509659f8a
Signed-off-by: Raito Bezarius <raito@lix.systems>
2025-02-23 15:24:28 +01:00
eldritch horrors aaab224bea libstore: kill sandboxes before removing paths
otherwise we may end up trying to delete a temporary directory that is
still actively being written to if a derivation is killed due to other
derivations failing or the build is aborted due to a user interruption

fixes #678

Change-Id: I4678723f11bdd261b27af8784d040a787690b107
2025-02-23 13:41:37 +00:00
Raito BezariusandGerrit Code Review c64a9db6bb Merge "doc/authors: add lilyinstarlight" into main 2025-02-23 09:47:26 +00:00
jadeandGerrit Code Review 33f13385f6 Merge changes Iba04f70f,I6b5bd980 into main
* changes:
  rl-next: fix mistake in issue number
  crash handling: log to syslog also
2025-02-23 07:56:32 +00:00
jadeandGerrit Code Review 595778e2d2 Merge "releng: use aws s3 sync --delete when uploading manual" into main 2025-02-23 02:37:05 +00:00
Jade Lovelace 392ba80bbd rl-next: fix mistake in issue number
Should be fj#foo for a lix issue.

Change-Id: Iba04f70fd8258e5c54a2c5b92a41472f8fb68376
2025-02-22 18:33:51 -08:00
Jade Lovelace 5468d340c3 crash handling: log to syslog also
This is mostly to deal with fatal errors in NixOS tests, but it's useful
for all cases; assertion failures landing in syslog would be nice too,
but that's not as easy to do.

CC: https://git.lix.systems/lix-project/lix/issues/693

Change-Id: I6b5bd9800db3f5affe33f2946ea218e4a78f0c07
2025-02-22 18:33:51 -08:00
eldritch horrors dd2241ea82 libcmd: asyncify getBuiltPath
Change-Id: I301ab541c0367100f8a68041d482d4cb326fc028
2025-02-22 23:24:26 +00:00
eldritch horrors 8fc0e0d24b libstore: asyncify Store::exportPath{,s}
Change-Id: I92915a3cb27bda73e7b9f3b32dc1feea3f47abda
2025-02-22 23:24:26 +00:00
eldritch horrors a2e523aa8b libstore: asyncify BinaryCacheStore::addToStoreCommon
Change-Id: I46710b11547515615f719e74501c1c8b4640ecc3
2025-02-22 23:24:26 +00:00
Sebastian Widua 82c7e76c9c libstore: allow specifying port for ssh[-ng] stores
This also adds documentation for it in distributed-builds.md as that's
possibly the most common use-case for remote ssh stores

Support for `std::optional<uint16_t>` in Setting is also added since
setting a port is optional.

The line `#include "lix/libutil/strings.hh"` fixes that templates instanciations
in lix/libutil/config-impl.hh were using string utils without including
the header (why are they even there btw)

Change-Id: Id806c117c48cdf158d9d1cb1e639b0df31d9bf11
2025-02-22 20:37:45 +01:00
eldritch horrors 044b4c4500 libutil: split retrySQLite into sync and async
also mark the sync version as NeverAsync. a blocking wait on sqlite
locks in a coroutine may never finish if it's a different coroutine
on the same executor that is holding the lock, not another process.

this propagates to the sqlite core interface, but no further. we'll
assume that caches do not block on a database for very long, and we
can't reasonably propagate never-async-ness out of stores unless we
touch everything we'd touch for the async transition, again, twice.
store code already assumes that it can block for however long it'll
feel like that moment. we keep thread pools around for this reason.

Change-Id: I62f77e1ac333cbe2e4e646dbcb1571463f2cf3fc
2025-02-22 17:59:54 +00:00
eldritch horrors 184922de19 libstore: drop support for db schema version 7
the upgrade to version 7 was done in 2013. it's about time.

Change-Id: I4520cfd1a13b693259ae71710d04f42a1303eb5d
2025-02-22 16:38:12 +00:00
jadeandGerrit Code Review 148f4eefe9 Merge changes Ia8ac6af0,I9f478750,I7d594835 into main
* changes:
  deps: backport capnproto promise nodiscard PR
  libstore: await promises instead of discarding
  libutil: fix some thread pool bugs
2025-02-22 01:47:10 +00:00
Rebecca Turner 16df34b295 releng: use aws s3 sync --delete when uploading manual
For the user manual, we don't delete things that are missing when doing
aws s3 sync. This doesn't seem wise. If you delete a page in the manual,
it will stay public and visible.

This adds `--delete` to the `aws s3 sync` commands to fix this issue.

Closes #396

Change-Id: I6d7fb97bcdab96c0115d6c66fea0310125207df4
2025-02-21 11:45:22 -08:00
jadeandGerrit Code Review e7aa55ca34 Merge "nix-eval-jobs: passthru nix" into main 2025-02-21 02:35:53 +00:00
Lunaphied 61e1a06aeb hotfix for releng scripts, fixes #440
Change-Id: I33b29fbf3920a2d4fb53b58db477dff5bf7a1af1
2025-02-21 01:02:04 +00:00
eldritch horrors 0eb1164a8d deps: backport capnproto promise nodiscard PR
this does not change the API exposed by the library, so it'll be safe
for users to substitute stock capnp. we do want it for our own builds
though, at least until we can switch to capnp 2 or fully go for rust.

Change-Id: Ia8ac6af0165f6f61ee02345179dc0a93a0889a06
2025-02-21 00:35:11 +01:00