Commit Graph
17368 Commits
Author SHA1 Message Date
Justin !andGerrit Code Review 00a1afe022 Merge "libutil: make runProgram2 print debug infos" into main 2025-02-07 15:10:53 +00:00
sethandGerrit Code Review 1a13827425 Merge "libutil/file-descriptor: include sys/syscall.h" into main 2025-02-06 23:20:29 +00:00
Justin !andeldritch horrors c526400bb5 libutil: make runProgram2 print debug infos
Fix: https://git.lix.systems/lix-project/lix/issues/481
Change-Id: I8af50a8ba96039b377774d55371868ba82bd3f1a
2025-02-06 21:52:24 +00:00
Ilya KandGerrit Code Review f3f1a2c328 Merge "flake.nix: hack to fix build on staging-next" into main 2025-02-06 17:55:37 +00:00
eldritch horrors 3c7162e6d0 libstore: split PathLocks::lockPaths into lock, tryLock
Change-Id: I202cfc077b7e468c74ecd8039175cef34855944c
2025-02-06 14:05:34 +00:00
K900 91ef5f629c flake.nix: hack to fix build on staging-next
Hopefully we don't actually ship this.

Change-Id: Idb4c2e8e1b28659f3d8f1314381b229a279d56e1
2025-02-06 10:50:38 +03:00
Lily BallardandGerrit Code Review 3b10c19006 Merge "libstore: make SQLite busy back-off logic portable" into main 2025-02-06 04:45:30 +00:00
Seth Flynn 4e45583d2e libutil/file-descriptor: include sys/syscall.h
For `SYS_close_range`

Change-Id: Ie3e6a94a354b336c3967efc4a73593d35096bfe0
2025-02-05 10:11:15 -05:00
alois31andGerrit Code Review 8553adbb41 Merge "libfetchers/mercurial: handle "evil refs" gracefully" into main 2025-02-04 17:40:32 +00:00
jadeandGerrit Code Review 06d3c59db0 Merge "Fix crash in debugger mode using with" into main 2025-02-04 16:36:50 +00:00
eldritch horrors cda78765fa libstore: asyncify ParsedDerivation::prepareStructuredAttrs
Change-Id: I6c34bb5fc67046a0c25486bf4f2fa5bbaa62eacf
2025-02-04 15:37:44 +00:00
eldritch horrors 6423ee2b7e libstore: asyncify Store::exportReferences
Change-Id: Ia4068d31afc48cf9d459bed3d5d8943be06718ee
2025-02-04 14:11:08 +00:00
eldritch horrors de66d7b2b4 libstore: asyncify Store::verifyStore
Change-Id: I12d5f348aa5a253d409b45db8a6bbb18754450c0
2025-02-04 14:10:16 +00:00
eldritch horrors a400394454 libexpr: asyncify DrvInfo constructor
since constructors can't actually be async we need a static wrapper
function that does the async work. it's fine, rust survives it too.

Change-Id: Ifa13d6f96d5a8b5b7fe215530b6eba24ef921d6d
2025-02-04 14:06:04 +00:00
eldritch horrors 68947e7a65 libstore: asyncify Store::derivationFromPath
Change-Id: Ic6b54642da08f258c113d5076b34b7c13096f540
2025-02-04 14:03:54 +00:00
eldritch horrors 338e0c681d libstore: make Store::queryMissing aio-ready
Change-Id: I398023fc200b9070de7af49ed90af8f1443ba418
2025-02-04 13:28:35 +00:00
eldritch horrors 3ce789acb5 libutil: add async io roots to threadpool threads
this needs a new method because overloading rules would make a pair of
methods taking `std::function`s of different argument types ambiguous.
we could've turned enqueue into a template and made `enqueueWithAio` a
private method too, but the necessary template magic is wasted on this

Change-Id: I93ccfde07126c287ad2a4dc5a07caec6a9d83944
2025-02-04 13:10:21 +00:00
eldritch horrors 4138fc7622 libutil: don't do work on threadpool main thread
this is mandatory for async support in worker threads at this time.

Change-Id: Ie58871bf33f6266aec58f37e10cfbc47f82a3aa9
2025-02-04 13:10:01 +00:00
Lily BallardandGerrit Code Review af1f27cac1 Merge "daemon: get peer pid, gid for socket connection on darwin" into main 2025-02-04 04:50:49 +00:00
Rebecca Turner c263070d37 Fix crash in debugger mode using with
Fixes this crash (#592):

    $ nix repl --debugger
    Lix 2.92.0-dev-pre20241120-66f6dbd debugger
    Type :? for help.
    nix-repl> let x = 4; in __seq x (with x; (x: builtins.break x) 1)
    info: breakpoint reached

    [1]    949722 segmentation fault (core dumped)  nix repl --debugger

Change-Id: I13c72941dc325ff984dcce2a84c01c89b1c552af
2025-02-03 15:22:50 -08:00
eldritch horrors d186064c3d libstore: never return from lockFile without a lock
signals could cause lockFile to return without having locked the file.
the garbage collector didn't check for this, and then hilarity ensued.

Change-Id: If86d33595e8bf5510d2b032139342261dc6e07c9
2025-02-03 22:27:47 +00:00
eldritch horrors 79f9c39e36 libstore: split tryLockFile lockFile
lockFile is currently interruptible by signals like SIGCHLD. which
happen a lot in daemons. now imagine that daemon enabled automatic
garbage collection. observe that the local store does not actually
check whether its lock operations have succeeded ... get the idea?

Change-Id: Ibfd7ee786c4fee3add72d4456a7e95e73e09c73e
2025-02-03 21:56:26 +01:00
eldritch horrors aa87c8aa93 libstore: extract unlockFile from lockFile
propagating the "unlock" lock type through this high-level api is
nonsense. it doesn't make sense to treat locking and unlocking as
similar operations; unlocking *must* not not interruptible by our
checkInterrupt machinery or it will just leave locks lying around
for a potentially very long time. unlock operations should not be
taking long enough to *want* them interrupted anyway. even on nfs
this makes very little sense because nfs waits *uninterruptibly*.

Change-Id: I10d605c8fe6c651bee64466eee1f8e20251d39f4
2025-02-03 21:56:26 +01:00
Lily Ballard 3eea7866f6 daemon: get peer pid, gid for socket connection on darwin
Fixes: https://git.lix.systems/lix-project/lix/issues/640
Change-Id: I2c4dc0e2642379e3f16fc39909dd4da8695d7239
2025-02-02 22:27:13 -08:00
eldritch horrors a51380645f libstore: asyncify Store::substitutePaths
Change-Id: I8cb6822ad9145fbcf0f98f32c121482c3a3db2a8
2025-02-01 21:48:48 +00:00
eldritch horrors 48519448e2 libcmd: asyncify lookupFileArg
Change-Id: Ied47f5f96eeb8324c500335fa8f5388d10bed54c
2025-02-01 21:48:48 +00:00
eldritch horrors 29c9dff56b libexpr: asyncify EvalPaths::{findFile, resolveSearchPathPath}
Change-Id: I4ab0d9343efd86bc459870f38d9db909888c070d
2025-02-01 21:48:48 +00:00
eldritch horrors 2da4824d61 libexpr: asyncify FlakeRef::fetchTree
Change-Id: I8334d8e1a9ea0e555bf2af1eb09dd9653013b28b
2025-02-01 21:48:48 +00:00
eldritch horrors d7e6721c66 libfetchers: asyncify Input::fetch
Change-Id: I2d032b46eaa7daf20018f4f0cf71439d807eb10a
2025-02-01 21:48:48 +00:00
Lily Ballard a258f78736 libstore: make SQLite busy back-off logic portable
Use C++ standard library not Unix functions for sleeping and randomness.

Also change the PRNG seed from `clock()` to `std::random_device` because
there's no good reason not to and this avoids two threads seeding their
PRNG the same.

Upstream-PR: https://github.com/NixOS/nix/pull/10399
Change-Id: I8424e7406366ea8e825d3e93dbb261ce60e3a37f
2025-01-31 21:27:48 -08:00
Dusk BanksandGerrit Code Review 083c6de22c Merge "libexpr: minimize scope of tryEval try-catch" into main 2025-01-31 16:46:20 +00:00
Dusk BanksandGerrit Code Review d196e4d16a Merge "libexpr: explicitly sanity check --ignore-try when entering debugger" into main 2025-01-31 16:45:47 +00:00
Dusk Banks cad6971c1d libexpr: minimize scope of tryEval try-catch
only `AssertionError`s from the forcing of the `tryEval`'s argument
should be caught. reducing the scope makes that explicit.

Change-Id: I6de6e14dda07619134babe5ee24bb1afbfc5fec1
2025-01-31 16:10:31 +00:00
Dusk Banks bfce4da6a2 libexpr: explicitly sanity check --ignore-try when entering debugger
This case _should_ never happen.

Text is based on `//lix/libmain/crash-handler.cc`.

Change-Id: I0d11b0254bb107573f35216110236ba25a3c9537
2025-01-31 00:35:15 -08:00
jadeandGerrit Code Review e529074cb2 Merge "functional2: add missing __init__.py" into main 2025-01-31 03:48:36 +00:00
Dusk Banks 6a583136b7 libexpr: fix --debugger --ignore-try
a65e9e5828 did not inform `tryEval` that
(as far as it's concerned) `state.debug` moved to `state.errors.debug`
and changed types. this resulted in the REPL erroneously coming up, that
REPL having a non-debug state, and segfaulting after that REPL exited.

it's probably good that `state.debug` isn't mutated by `--ignore-try`
anymore.

Change-Id: I1918e93edacd626452aa423fc2eb825080738835
Fixes: a65e9e5828 ("libexpr: extract eval error creation into new type")
Signed-off-by: Dusk Banks <me@bb010g.com>
2025-01-30 18:46:14 -08:00
Dusk Banks 050cf17307 doc: add bb010g to change-authors
Change-Id: Iddd3c21b2c42669cec394ac6b80f4e766e4cb81c
Signed-off-by: Dusk Banks <me@bb010g.com>
2025-01-30 11:57:00 -08:00
Jade LovelaceandJade Lovelace 64e33a7e09 nix-eval-jobs: make available as a submodule for nice development usage
This is to make it much nicer to develop. We could also do this for
perl.

Change-Id: Id4cefff0c2a3658a0dacd987a9dd9ddda50765fe
2025-01-29 10:10:11 -08:00
Jade LovelaceandJade Lovelace f5fbf9bce0 perl: simplify packaging slightly
Change-Id: Ib9049642b4afd7aa529501672cfa50d983f85e4f
2025-01-29 10:10:11 -08:00
Jade LovelaceandJade Lovelace 80f814d2a1 nix-eval-jobs: integrate into lix build system and delete cruft
We don't want any of this github integration stuff since it won't do
anything, flakes don't support subdirs properly and maintaining a second
flake is pointless and annoying, and then the rest is lix formatting
standards hitting n-e-j.

Yeet!

Change-Id: Ibcd3b0182d90f727562a92c215b6061c16502554
2025-01-29 10:10:11 -08:00
Jade Lovelace 79aa6ce797 Add 'subprojects/nix-eval-jobs/' from commit 'e489d2190a9e7b6a369d3457b49ba80c93f80eae'
git-subtree-dir: subprojects/nix-eval-jobs
git-subtree-mainline: 3a41bf32a7
git-subtree-split: e489d2190a
2025-01-28 16:38:25 -08:00
Jade Lovelace 3a41bf32a7 packaging: stop including lix-clang-tidy inside main src fileset
This will avoid making lix depend on nix-eval-jobs when that is merged as well.

cc: https://git.lix.systems/lix-project/lix/issues/384
Change-Id: I4a4292948f3a225391aea2fc0d57b739d960d9e8
2025-01-28 12:44:07 -08:00
Jade Lovelace 1eafc7dbf4 build: automate some boehm/kj dependencies internally
We will link to boehm inside of the test suite if it depends on libexpr
but we don't need it for other tests.

For anything linking to libexpr internally, just like externally, it
needs to link to boehm.

Likewise with kj and libutil (or really any lix), so we should just make
it automatic.

Change-Id: I2bb9ec4668e6ff741b4139fdce167f278eb71c7e
2025-01-28 12:19:00 -08:00
Jade Lovelace 750f6e327c build: add meson dep overrides for all internal libs
This allows for subprojects to depend on the internal Lix build and have
it work properly.

Change-Id: Iaf05725fb95ea8abb171c71a1b17b0062c89f548
2025-01-28 12:19:00 -08:00
Jade Lovelace e35fd30a30 build: config.h -> lix/config.h for consistency with installed headers
This is required for moving n-e-j into tree with good meson support: it
needs to be able to include `<lix/config.h>`.

Change-Id: I21f1cfa37dcdce992812c8b008df503c0fc9dea5
2025-01-28 12:19:00 -08:00
piegames f8a592713d repl: Allow :env outside of debug mode
Printing the current variables plus staticBaseEnv is useful

Change-Id: Ide8bc26c1c6b4ec0b1d68767994ddac8891a649f
2025-01-28 09:37:01 +01:00
piegames 1b2e7e1ab7 repl: Improve error messages for debug commands outside of debug mode
Pretending that these commands are "unknown" when not in debug mode is
just silly.

Change-Id: I7036ae792656ef540bbad00649be4f7309944a07
2025-01-28 09:37:00 +01:00
jade e489d2190a Merge pull request 'fix for asyncized lix' (#20) from jade/async-lix into main
Reviewed-on: https://git.lix.systems/lix-project/nix-eval-jobs/pulls/20
2025-01-27 20:16:25 +00:00
Jade Lovelaceandeldritch horrors 53ce7ebc33 fix for asyncized lix 2025-01-27 20:54:38 +01:00
piegames f324574265 libexpr: Track position information in all expressions
Change-Id: Ied79381a917a715cdd8816d6f9df527289217dfb
2025-01-27 20:49:25 +01:00