only `AssertionError`s from the forcing of the `tryEval`'s argument
should be caught. reducing the scope makes that explicit.
Change-Id: I6de6e14dda07619134babe5ee24bb1afbfc5fec1
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>
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
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
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
it's entirely not necessary. any time we'd print this exception we're
already being called as part of stack unwinding, and printing the way
it's done here causes crashes when the error is a user pressing ^C to
abort the current operation. printing all errors (including ones that
aren't interruptions) only causes unnecessary noise in terminal logs.
fixes fj#646
Change-Id: I965ff57bc9ecf7dff35963d7056aa3a5d8a83e39
I was wondering why there were only 59 succeeding jobs. We really need
to fix the buildbot at some point ;;
Change-Id: I81a22e32ac0dd0e105677f1b7bc064568009890d
These are only called when registering the schemes, so reordering them
to the previous order should ensure identical behaviour.
Change-Id: I12ea0e18e6dc897a91ad20cea3a765c0b96ae85e
Since we include kj from a header, we need to add a dependency to force
downstreams to also have it as a declared dependency or at least put it
in their include dir paths.
Given kj is what it is, this is basically unavoidable that this
dependency is visible.
Change-Id: Ia89a90f10ad8b821260db0d7fdc47aebda44e66a
the worker already wants to make a promise explicitly control-C-able,
and some other things in the future will want this as well. we do not
yet have the option to use the signal interfaces kj offers, but if we
can manage to remove all uses of the old-style notifiers we might get
there. until then we can at least wrap the old interfaces to be a bit
nicer to use, and eventually easier to replace with kj-provided code.
Change-Id: I079fdfe7720485820a9862c3615335d4e1df13e7
ifd requires building which uses async code today, fetching requires
network io which really should use async code but does not yet. eval
itself cannot be made async for performance reasons. offloading work
to other threads is possible but questionable as currently there are
no uses in which evaluation must take place from within asynchronous
operations, which are currently confined entirely to store behavior.
Change-Id: I1e3c86fca19b042d79332e9a5ef9546f90a6448b
this will let us add AsyncIoRoots to the toplevel objects and functions.
eventually we'll get rid of all offloading again byt covering the entire
space between main() and the worker entry points with promises. it won't
be a quick and easy journey; we have somewhere around 200 functions that
must be converted to async code, and some building blocks that are fully
incompatible with event loops on their own. this ranges from simple bits
like thread pools (which we can wrap in promise-fulfiller pairs), bigger
bits like the curl wrapper (which we can make async, but not easily), or
even impossible bits (like the libarchive wrapper, which can't be turned
into async code at all. not to worry though, we have *plans* for those.)
Change-Id: I95b91b0545659ece4ec1b85214df1ce2f1bc0164
evaluating promise-based things requires an event loop. we can't thread
the event loop through the code as is because that'd touch almost every
function signature. we can't declare local loops because loops must not
nest. we can't use thread-local loops because non-continuation waits on
promises are not allowed within a promise evaluation. spawning a thread
every time is the only real option besides a shared runner thread pool.
Change-Id: I763c1b2d655cee01f991a8675f3a643b6fe91363
mostly we want to hide the wait scope since using a wait scope inside a
promise is not allowed. we'll use this to push the AsyncIoContext up to
the main() function as time passes, and presumably turn a lot of things
that are regular synchronous code right now into promises as we proceed
Change-Id: Ib972568a306b540b573e946492830ed5a15c485e
Though this is a revert, it also involves fixing the code with new code
and a regression test. The problematic locking that was there before has
been removed, in any case.
This reverts commit ba728e46be.
Reason for revert: regression.
Fixes: https://git.lix.systems/lix-project/lix/issues/647
Change-Id: I326b1a10042ff69afbab38426e042e0dc2224a13
currently this header only contains TRY_AWAIT, and it's public version
LIX_TRY_AWAIT. the former is for use in our cpp files only, the latter
may be used anywhere. we don't expose TRY_AWAIT unconditionally due to
it not being namespaced according to usual rules of macro naming, i.e.
exposing it may litter user macro namespaces unnecessarily. hiding our
internal version is achieved using a new define that's not set through
pkg-config or other means. (we could also add a private header that we
simply do not install, but that gets rather messy rather very quickly)
Change-Id: I372b1a414487dd03cfbfc620b3148a6c6e56ca3f
c++ does not support result types very well. kj promises do not support
exceptions very well, but result types are fine. since we need to treat
errors like values to be compatible with kj we are forced to use result
types. creating a failure result from the current exception is our most
common error return right now, so let's have a shorthand for this. it'd
be nice to also drop the try-catch wrapper somehow, but since macros do
not work with clang-format (macro-wrapped bodies confuse the formatter,
trashing the entire file) and clang plugins tie us even harder to clang
we'll probably have to keep the wrappers (until we can rewrite in rust)
Change-Id: I463dd0a4ebedb79a5335c92251c4d12b9d64b401
This doesn't break any usages within lix, and allows avoiding copying
in some calls. The constructor already copies bits and pieces of the
data passed in.
Change-Id: Iea39906ca430195da4c509dd8a0a54d49b46ca4f