Commit Graph
100 Commits
Author SHA1 Message Date
eldritch horrorsandRaito Bezarius 19930d423d libutil: make RunningProgram more useful
make it moveable, make it killable, and add a stdout fd accessor.

Change-Id: I2387cbe8ac67b899a322cd6c7d306ef9ea7abcd0
2025-06-24 10:49:49 +00:00
eldritch horrors 877b0d7121 libstore: asyncify Store::queryMissing
we no longer use thread pools for querying missing derivations. this
binds queryMissing to a single thread for now, but query performance
is still greatly improved. we may want to optimize the store code in
the near future too though since queryMissing is now fully cpu bound

Change-Id: I08a9c8cc199963ef5981572ca4a32d90dbdec028
2025-06-19 14:59:38 +00:00
eldritch horrors 2bfea5eefe libstore: use async streams in LegacySSHStore
this mirrors what have already done to the more modern wires.

Change-Id: I68b65bb400c889ba822386a9c280297c9ff4f740
2025-06-19 14:59:38 +00:00
eldritch horrors 02f61e7759 libstore: asyncify legacy ssh command/response
we intentionally omit writers for the new types we add for serialization
purposes since we do not plan to asyncify the legacy ssh server side. if
we ever change our mind we can extract these types into a header and add
writers as needed. due to the inevitable network overhead of the old ssh
wires we don't bother to optimize serialization too much and instead opt
to make the code more readable; the performance difference does not show
up in practice since network latency dominates the few nanoseconds spent
on extra promise allocations and awaits by a couple orders of magnitude.

Change-Id: Id3ee9a01f8bfa63fa23082fa07de5c673fd70883
2025-06-19 14:59:38 +00:00
eldritch horrors aae67feb19 libstore: make legacy ssh build settings a generator
that'll make sendCommand-ing the legacy protocol much easier.

Change-Id: I3193b306ab28c203fe50c404a15c45cf598ca7e7
2025-06-19 14:59:38 +00:00
eldritch horrors 508f476c18 libstore: don't crash when talking to old ssh:// remotes
protocol version 0x204 dates back to nix 2.0 in 2017. that's old enough
to not worry and drop the gratuitous assertion crash we see it instead.

Change-Id: I8cf23373d4daabccab61f1cbb670947479f0d2bc
2025-06-19 14:59:38 +00:00
eldritch horrors c3bc0d35dd libstore: use async streams in RemoteStore
this is a large step towards making RemoteStore a proper capnp rpc
interface, and it lets us get rid of the RemoteStore error handler
thread pool. this does mean we make six or more extra syscalls per
operation to set and clear socket non-blocking flags, but they are
pretty cheap compared to cross-thread wakeups and scheduling. once
we have real capnp rpc for store wires we can drop them again too.

Change-Id: I67dfebc8644a407cd4a8221ffcad02a938ac5abe
2025-06-17 15:25:32 +02:00
eldritch horrors 3f62905312 libstore: instantiate RemoteStore FdSources as needed
in the future we will want to instantiate either a sink, a source, both,
or streams, depending on how the fd is used. to do this we need to share
read buffers among sync and async readers. removing the FdSource we kept
in the connection also helps prove that we always use this buffer for io

Change-Id: Ib678e128ed6c4a07d6ce5ec1d3cde9eb3f5fc4ca
2025-06-17 14:34:05 +02:00
eldritch horrors 687ea19e6f libstore: drop pervasive RemoteStore send buffering
we don't need to double-buffer commands. only the subframe protocol
needs a buffered backing, and connection setup is special *anyway*.

Change-Id: I596f2bf8e297c3c5dc2befae674deafcf559d9a9
2025-06-17 14:34:05 +02:00
eldritch horrors b0edb262b2 libutil: add bidirectional async fd streams
this may as well be called AsyncSocketStream since that will be what we
use it for, but hopefully it will not exist for long enough to need any
other socket functions to actually justify such highly specific naming.

Change-Id: Icf2fe88cf345405218e4b1bd440267e7f132f5c7
2025-06-17 14:34:05 +02:00
eldritch horrors 7b65d7c508 libutil: add buffered async streams
these will let us share async stream io buffers with sync sinks and sources.

Change-Id: If3149803a9e1fda62391399177da62f7522a811b
2025-06-17 14:34:05 +02:00
eldritch horrors 81d2d26c3f libutil: add async output stream type
we also extend AsyncInputStream with a drainInto variant to give async
output streams rough feature parity with sync sinks. we still will not
add serialization support to streams though, that's far too expensive.

Change-Id: I60d5ab43610c45a40ea8740470a5eafe68064aea
2025-06-17 14:34:05 +02:00
eldritch horrors fa116c96f7 perl: ensure that stores are destroyed after aio roots
otherwise stores containing async objects will cause crashes during
shutdown. currently there are no such stores, but that will change.

Change-Id: I05d46ba6831c641774edfe6aa99aa7d0de457429
2025-06-17 14:34:05 +02:00
eldritch horrors bc33c21b8a cli: remove static destruction from nix-store
store objects may hold on to network connections. if those connections
are async they're bound to the lifetime of the aio runtime, which ends
long before the static object destructors we need for nix-store today.

Change-Id: I4aa5466681a82f7e5008cc0b952fcba01d5b39d7
2025-06-17 14:34:05 +02:00
eldritch horrors 49e6147f95 libutil: remove unused Source::good
Change-Id: I8dcb725578e27415b60a01a16c10720e96a5371b
2025-06-17 14:34:05 +02:00
eldritch horrors e5c4de34c5 libstore: eagerly mark daemon connections as bad on local errors
do not rely on Source/Sink `good()` or delayed guessing about whether
an exception was thrown by the daemon or not. mark connections as bad
for all local errors happening while communication is ongoing instead,
and leave it valid only when an exception was provided by the remote.

we may drop connections a bit too eagerly now, but all cases in which
that happens were vulnerable to protocol desynchronization. there are
still a few windows for this to happen left, but those are unfixable.

Change-Id: Iefaa66c552092c436b9de77aa3f8e09f847a966e
2025-06-17 14:34:05 +02:00
eldritch horrors 37c17804df libstore: serialize wire messages into temp buffer
once we make our socket fds non-blocking we won't be able to easily use
plain FdSink for serialization. performance impact of using a temporary
buffer should be low since we don't send very many messages and even in
the simple local daemon case networking overhead is already quite high.

Change-Id: I550d73142570b7d2e7b0feb1bcc57d61e9b45178
2025-06-17 14:34:05 +02:00
eldritch horrors 6f64e1b133 libutil: make Fd{Sink,Source} io buffer shareable
we will need this during RemoteStore wire asyncification to be able to
use the old synchronous serializers. alternatively we could define all
serializers on the async types as well, but that'd be slow and far too
much unnecessarily duplicated code (that will be deleted soon anyway).

Change-Id: I6e4f334025844b808a697ddcd8f80ddcd8c3fc9c
2025-06-17 14:34:05 +02:00
eldritch horrors fc18a6d170 libutil: disallow Fd{Sink,Source} copy and move
it was never safe. both discarded the buffer of the source object,
possibly leading to silent data corruption. FdSource discarded the
fancy EOF error string as well, possibly causing bad error reports

Change-Id: Ib5c07986471b5af03d707230cd487259201952e9
2025-06-17 14:34:05 +02:00
eldritch horrors 8835b2f057 libutil: remove unused AsyncFdInputStream
Change-Id: I549e0bc36637161847fde6c50887c917c1c1dadc
2025-06-17 14:34:05 +02:00
eldritch horrors d4d20dfe02 libutil: remove unused FdSink::written
don't know how we missed that when removing FdSource::read

Change-Id: I086587e190460a3cc81163008f961def3cce0576
2025-06-17 14:34:05 +02:00
eldritch horrors ba2432f8fe libutil: add asyncJoin, a Result-based joinPromises
we'll need this to asyncify withFramedSink and remove its thread pool.

Change-Id: I1a099392c094f8441482fde3b2d3843931420ffa
2025-06-17 14:34:05 +02:00
eldritch horrors 5f42f66afa libstore: rpc-ish-ify remaining RemoteStore methods
oops, forgot a few

Change-Id: Ic9ed34c29d26e94109d5f69eb90f334f26170ec3
2025-06-17 14:34:05 +02:00
eldritch horrors 7453e2979f libstore: asyncify S3BinaryCacheStore
this has side-effects for FileTransfer as well since that uses S3Helper
for s3:// urls. the side effects should be entirely positive though: we
can run multiple s3 requests in parallel without explicitly running any
of them from thread pools (the aws s3 client takes care of that for us)

Change-Id: I67232e604ebb12982b63770f1661ea1d56c5087b
2025-06-15 14:08:48 +00:00
eldritch horrors 1729c8ca3e libstore: asyncify curl return streams
making stores and their users fully async requires all data streams to
be async. the most notable data streams in common usage are curl first
and remote stores second. curl is much more contained today and easier
to asyncify (with the preparatory work we've done in the past commits)

Change-Id: I2d6ff4687ee2b47e4efaa6714827b7283bed941d
2025-06-15 13:36:31 +00:00
eldritch horrors 04a2aba00a libstore: explicitly init curl transfer sources
this too will make it easier to make the streams async.

Change-Id: I9a961fc667042e0aed23d2241326f1ea719bc7a4
2025-06-15 13:36:31 +00:00
eldritch horrors 490c4e3694 libstore: extract closures in curl wrapper to methods
turning them into promises will be much less problematic this way.

Change-Id: I055186a6318fb75c67ae5e7f57561b2cd62d874e
2025-06-15 13:36:31 +00:00
eldritch horrors de89c7f7c8 libstore: asyncify curl interface
Change-Id: I3fc93016b8ac5e59d9062d4f4aead19ae051a680
2025-06-15 13:36:31 +00:00
eldritch horrors a0d5900408 libstore: asyncify BinaryCacheStore::upsertFile
Change-Id: I8e72399c5bfdf70b551fff832b3002ef21f1ef58
2025-06-15 13:36:31 +00:00
eldritch horrors c76f0467b2 libstore: asyncify BinaryCacheStore::fileExists
Change-Id: I7574f61bf222389606be87bbaff486b386cdbecd
2025-06-15 13:36:31 +00:00
eldritch horrors c108f339f5 libstore: asyncify BinaryCacheStore::getFile
Change-Id: If3a1f127470fdaffb0bf79e0692c5d6baf21f18e
2025-06-15 13:36:31 +00:00
eldritch horrors 9f32ab85e8 libstore: asyncify BinaryCacheStore::getFileContents
Change-Id: I7972d6da6d0ac535d2d20c85390c6d67242cab35
2025-06-15 13:36:31 +00:00
eldritch horrors 743703ce35 libstore: asyncify Store::narFromPath return stream
Change-Id: I051c58e650109c70021c0e0a745c7342226e295b
2025-06-15 13:36:31 +00:00
eldritch horrors d824753377 libutil: add async decompression support
it's a real mess, but it's also the best we can reasonably do.

Change-Id: I3b84840cede0363396bdf290d6e6b0e03ace513c
2025-06-15 15:35:51 +02:00
eldritch horrors ee06552402 libstore: asyncify RemoteStore::Connection::processStderr
we need a wrapper type for the remote exception because our Result type
does not deal well with its good type being the same as its error type.
we could have also return a `Result<Result<void>>` to fix this, but the
wrapper type clarifies via its name where the exception_ptr originates.

Change-Id: Ia6ce67b962cb8d6528b017f4cb682a55d6918939
2025-06-11 22:59:23 +00:00
eldritch horrors 7a10df6e76 libstore: asyncify RemoteStore connection setup
without this processStderr cannot be turned into a promise.

Change-Id: Ia8ee44e9e2344f61c2c63b787b42f867864c7119
2025-06-11 22:32:49 +02:00
eldritch horrors cc04a433f0 libstore: remove flushing from processStderr
it's part of sending the command and should be treated as such.

Change-Id: I7406ead5cd08c79efe50f3b0fcb522a18d9d7bcf
2025-06-11 22:29:30 +02:00
eldritch horrors 8b3fdbc847 libstore: add framed data support to sendCommand
the subframing layer is ... a bit of challenge. since the old code is
synchronous but wants to handle errors asynchronously anyway it is on
the subframing layer to *spawn a thread* that polls for errors on the
wire, while non-framed commands handle errors synchronously once they
have sent all their data. this encapsulation of the wires is far from
perfect (let alone legible), but hopefully it will be only temporary.

Change-Id: I26d8020549b767794cae121313360c488504995f
2025-06-11 22:29:30 +02:00
eldritch horrors 1a2247560d libstore: encapsulate reading simple command results
much the same as the previous change, but on the receiving side.

Change-Id: I9f8a156a9d8fccaf91347e34a5b6baf301df5800
2025-06-11 22:29:30 +02:00
eldritch horrors 2128a2dbac libstore: encapsulate sending of simple commands
use a new helper method to send simple command data (that is, command
data that doesn't involve nested framing) to the daemon. this wraps a
large chunk of wire io, and once all wire io is wrapped thusly we can
replace the sink/source io model with new async input/output streams.

Change-Id: Ief9f520263c230a98403b8756bde917fd1cb236e
2025-06-11 22:29:30 +02:00
eldritch horrors ec374bc6e2 libstore: deserialize findRoots data as vector-of-tuples
a size_t followed by as many pairs of things is exactly the format of a
vector of two-element tuples. it would also be the format of a map, but
Roots is a map of sets. rather than adding a serialization format fixed
to this map type (or some wrapper) we can deserialize the response as a
vector and convert it to the map-of-sets later as this is not run much.

Change-Id: I3950c0f7cc59661576170ace10b25a6f8af1464b
2025-06-11 22:29:30 +02:00
eldritch horrors ab8f4ae7e3 libstore: add CommonProto code for bool/unsigned/uint64_t
we will need these very soon to make the daemon wires more rpc-like.

Change-Id: Ib54acdff0899d70a4c9b1d00c144932c37fdff91
2025-06-11 22:29:30 +02:00
eldritch horrors 87fbc15938 libutil: make the pool element factory a promise
processStderr of RemoteStore wants to be a promise and it must be used
from connection setup, so the pool factory callback must be a promise.

Change-Id: I9ac742b6048ae6dba0bfa5dcb58971386229690b
2025-06-11 22:28:44 +02:00
eldritch horrors 56847dc10d libutil: make Buffered{Sink,Source} io buffer shareable
async io for remote store connections needs some sync parts still for
serialization purposes, and those will have to reuse async io buffers

Change-Id: I05e066e3bf8c4318dc23306383f6a849d018ef91
2025-06-11 18:11:57 +00:00
eldritch horrors 7d681a5049 libutil: add io buffer abstraction
the rpc transition will require sync and async objects to share a single
io buffer (since defining serializers on async is an immense pain in the
tail, slow, and ultimately not necessary). a generic buffer class allows
us to reuse existing serializers more readily (reuse them at all, even).

Change-Id: I5ebba8449f26f2bb76016818928183c7e0123be0
2025-06-11 18:11:57 +00:00
eldritch horrors cc560704de libstore: have SSH use a socketpair, not two pipes
remote store async io will need to set O_NONBLOCK on the connection fds,
and right now the number of fds can vary between connection types: local
connections have one one fd for the sink/source pair since they use unix
sockets, but ssh connections have two because ssh uses pipes. this makes
it rather hard to manage flags correctly, and even harder to wait for io
readiness on both directions using kj. using sockets for ssh fixes this.

Change-Id: I0f563ece7627cd3fbd0f5ce21c25140469729e5a
2025-06-11 18:11:57 +00:00
eldritch horrors 9c4fd3d881 libstore: remove unused RemoteStore::Connection::closeWrite
Change-Id: I4a25807ad870c4704b8efa70e5652206ae654995
2025-06-11 18:11:57 +00:00
eldritch horrors 60830ca5fa libstore: add derivation wire generator
this'll be useful later as it makes derivation writing composable.

Change-Id: Ib5bbbd04e7a136e448669e95a3b976f1fe196f52
2025-06-06 18:09:46 +02:00
eldritch horrors 4ebf79bc19 libstore: associate wire connection states with stores
why pass the stores as a distinct argument every time?

Change-Id: If529a49541483e8a3d33eb2b3532d66b3bb9738d
2025-06-06 18:09:46 +02:00
eldritch horrors ce9acd5f97 libstore: use proper connection handle for narFromPath
this could've just ignored exceptions thrown by the remote. in the
current implementation there's no way such an exception could have
propagated to the client though, so there's no change in behavior.

Change-Id: Ide03bda1cb0ad7fb5f27b4ee5d16efd6c2b635ba
2025-06-06 18:09:46 +02:00
eldritch horrors 2cd44d2e1d libstore: don't wrap&unwrap connection handles
this was only necessary for old protocols we no longer support.

Change-Id: Iebb06ce6266c2c7c3f97da469b1295f4cb54ee5a
2025-06-06 18:09:46 +02:00
eldritch horrors b33669b55a libutil: remove withFramedSink
always use withFramedSinkAsync instead to reduce logic duplication.

Change-Id: I82f4675c67c1fa593f00272e5ddb54bca9f64a79
2025-06-06 18:09:46 +02:00
eldritch horrors c13571015a libstore: send worker options packet as one blob
mostly to make moving this to async writes easier. this won't have a
performance impact because it's only a single packet, that's written
to a BufferedSink, but the connection sink only gets a single write.

Change-Id: I9a5f1afe7d3e25f5f4502ef9520ff2f2529431ba
2025-06-06 18:09:46 +02:00
eldritch horrors cf93814ca5 libutil: remove unused FdSource::read
Change-Id: Ie08c9a80dc029ae4e5eb91b09db81166c8a627a3
2025-06-06 18:09:46 +02:00
eldritch horrors 8c30a165e5 libutil: remove long-dead create_coro_gc_hook
Change-Id: Ia37c6a5401dbe6453bfdfa733da5237d2c2dc819
2025-06-06 18:09:46 +02:00
eldritch horrors dd31a23c31 libstore: add worker serializer for SubstitutablePathInfo
the test is for the map that usually wraps it though because it's the
bit we're interested in replacing, and it has custom serializer code.

Change-Id: If77a236dfca738b646ed2b7a5c65515dad6b7295
2025-06-06 18:09:46 +02:00
eldritch horrors fca0a30470 libstore: remove pre-2.18 protocols
the old protocols are largely untested, mostly unused, and have design
problems that make the RPC transition a lot harder, if not impossible.
in theory we could ship a transparent protocol-converting proxy that'd
isolate the daemon itself from old protocol versions, but that's a lot
of code to maintain for presumably little gain or even no gain at all.

Change-Id: I4c3f3bb34d39044f6aeb07c10caaf13b8340a220
2025-06-02 22:43:24 +00:00
eldritch horrors 03da670021 libutil: remove ca-derivations experimental features
also remove all the documentation referencing it, or rewrite the docs
to make sense in the non-floating-content-addressed world we live in.

Change-Id: I724e67839f44cc9f1cfc7d6f1c05252b62752b42
2025-05-20 17:43:46 +00:00
eldritch horrors 8c3c24e5b0 libstore: remove ca database bits from LocalStore
we don't need to worry about leaving around old ca data in the database:
this was always a possiblity when enabling ca derivations, and disabling
them again some time later. behavior is unchanged, but we lose dead code

Change-Id: I8c10ff7fdcee08c3badf23d64403f5ee6452e41e
2025-05-20 17:43:46 +00:00
eldritch horrors 96e28966ab libstore: remove unused BuiltPath bits
Change-Id: I21d0f95a41c22cb64fb80bb696bcb403b5a38fc1
2025-05-20 17:43:46 +00:00
eldritch horrors 5097c5db63 libstore: remove unused DownstreamPlaceholder
Change-Id: I3b71778aa9e92bf8ac0edef0ca929e92010f5c6a
2025-05-20 17:43:46 +00:00
eldritch horrors 34317c0081 libexpr: simplify EvalState::mkOutputString{,Raw}
we no longer need placeholders to represent all derivation output paths
as string context, and thus will not need experimental features either.

Change-Id: I9e86ce86810e976cf8397b2c2f473af11390874c
2025-05-20 17:43:46 +00:00
eldritch horrors ab36085b6b libstore: remove DerivationGoal::queryPartialDerivationOutputMap
it's fully redundant with queryDerivationOutputMap.

Change-Id: I38475ab1249bdf9db66d8538fb230579f036a3f2
2025-05-20 17:43:46 +00:00
eldritch horrors 6785f5c720 libstore: rename query{,Static}PartialDerivationOutputMap
neither are actually partial now, and the the non-Static variant has a
non-Partial wrapper which merely returns the Partial result unchanged.

Change-Id: I5fa86682883c2305cc12c711ccff58537b7a278d
2025-05-20 17:43:46 +00:00
eldritch horrors 6b5f82e78b libstore: deoptionalize queryPartialDerivationOutputMap
derivation outpaths are now statically known at all times. the one snag
here is that the wires encode even statically known paths as optionals,
forcing us to check for this any time we receive an output map. remotes
answering with nullopt paths for derivations we still support now would
be a protocol error on its own though, so we do not diagnose it deeply.

Change-Id: Ib7080b2a0c45c3506233e87c8ef6842576f61050
2025-05-20 17:43:46 +00:00
eldritch horrors ca7f6ff96b libstore: remove unused realisation methods
Change-Id: I7e7371cdbe477f25e9410272ad635eddadf32101
2025-05-20 17:43:46 +00:00
eldritch horrors 68ab8797b5 libstore: remove unused realisation disk caching
we don't need to touch the schema of the cache here. keeping the table
around doesn't hurt (and avoids cppnix breakage) thanks to foreign key
constraints and the ca bits of the schema being independent enough for
us to just ignore them (and not having to do any maintenance on them).

Change-Id: Ib5d8eb1cd838826d88eb65bbf8f245703a2482da
2025-05-20 17:43:46 +00:00
eldritch horrors 976f6de81e libstore: remove realisation query support
only a daemon wire operation and the perl bindings could initiate these
queries at this point. the daemon ops can throw an error instead (as if
the daemon were older) and realistically should never be queries if the
client hasn't evaluated a ca derivation on a given store, and perl code
is best off dying early. nothing known except hydra uses these bdingins
anyway, and we control our hydra so we don't need backward compat code.

Change-Id: Ia7df27aba59a4a4a692ae014f407415f3bea63f2
2025-05-20 17:43:46 +00:00
eldritch horrors aa69d39c0f libstore: drop feature-gated realisation queries
these will never run without the ability to enable the feature.

Change-Id: I917024e8c3c5b1f422c9e5a509130998bee4e511
2025-05-20 17:43:46 +00:00
eldritch horrors dc47f9aa72 libstore: don't return optionals from Derivation::path
output paths are always known now that CA and deferred outputs are gone.

Change-Id: I359d13ffb5141f1e07a5fc55425831af3332c22e
2025-05-20 17:43:46 +00:00
eldritch horrors 1cbb6ba21c libstore: remove Store::registerDrvOutput
it's only used by the RegisterDrvOutput daemon wire operation now, and
that one we can safely stub out to throw an error when called instead.

Change-Id: If29716976392c9c7a2a05b151dfe80b2c8d9c07d
2025-05-20 17:43:46 +00:00
eldritch horrors f25dc923ca libstore: remove ca support from common store api
this removes the ca-derivations system feature and, perhaps most
importantly, realisation closure copy support. the latter is not
needed any more and its existence blocks some more code removal.

Change-Id: I2931b03637e25d35252ae6bd5f34f0c0168d80e9
2025-05-20 17:43:46 +00:00
eldritch horrors 484319fd2d libstore: remove unused Derivation::tryResolve
Change-Id: Ia36b066badf60b3727ec6c6a04057c3c97461e2c
2025-05-20 17:43:46 +00:00
eldritch horrors 01dcbf3359 libstore: remove Derivation::hasKnownOutputPaths
it's always true now that floating and deferred outputs are gone.

Change-Id: Ie694b9af4d2c247c0fb4fdebadd55a0a487b9828
2025-05-20 17:43:46 +00:00
eldritch horrors e543ac686f libstore: remove DerivationOutput::Deferred
we can't create these any more except by reading an old json-formatted
derivation that used them. since we cannot do anything with a deferred
derivation even when read we will remove json support for them as well

Change-Id: I4f9ea0b7c6469f57977784037f7710f939e40a2c
2025-05-20 17:43:46 +00:00
eldritch horrors d03be35c44 libstore: remove DrvHash::Kind
now that we have no deferred hashes (since floating ca derivations were
the only way to create them) we can safely remove this enumeration too.

Change-Id: Ic72ed90500fcee7aa5b3b5a302477fa515acf1be
2025-05-20 17:43:46 +00:00
eldritch horrors e3717b728c libstore: trivialize DerivationType::ContentAddressed
only FODs can be content-addressed now, and those are always fixed.
FODs are also never sandboxed, so we do not need that field either.

Change-Id: I1be62b3ec85e08ec003cc8769723328d19777728
2025-05-20 17:43:46 +00:00
eldritch horrors bfd10db217 libstore: remove DerivationOutput::CAFloating
nothing can create floating ca outputs any more.

Change-Id: Ic69f4a22066e1f5c0837f44e8d4fa2d93ca20ff6
2025-05-20 17:43:46 +00:00
eldritch horrors a7866d56b8 cli: remove ca support from commands
this mostly takes the form of removes feature checks and the associated
"ca derivations enabled" branches, but for the realisation info command
turns into a stub. we keep it around for compatibility, but from now on
it will always throws "ca derivations not implemented" errors when run.

Change-Id: I0abea5f76262013415330adcca2b498c6dca555b
2025-05-20 17:43:46 +00:00
eldritch horrors 6567707dc1 libstore: remove DrvOutputSubstitutionGoal
this goal is only involved for output paths that aren't known at initial
build time, which in turn can only happen if they are ca paths. since we
can no longer create ca derivations during eval *or* read them from disk
we can now assume that we will never run this goal. there are still some
vestiges like output known-ness we can't remove yet, so those must stay.

Change-Id: I989e5ad4600c628bcbe8e17e1b082ce8d73a3bd9
2025-05-20 11:28:12 +00:00
eldritch horrors b60735791e libstore: remove unused drvOutputReferences
ca derivation build was the last remaining user.

Change-Id: Ib0e6d954e7802a53d1328c4c18f5f12dddeb838a
2025-05-20 13:27:04 +02:00
eldritch horrors d4e88b98e9 libstore: remove ca derivation build support
we remove not only support for *building* a ca derivation, but also
support for *resolving* ca derivations as part of a build. we never
have to resolve derivations from here on, so this code is now dead.

Change-Id: I0346442d5fa00eb927177545ae61315f588477cc
2025-05-20 13:27:04 +02:00
eldritch horrors 2cc420c1e5 libstore: remove ca derivation read support
we can now no longer read ca store derivations from disk.

Change-Id: I233edea597b550dd7e8c78a555b7f12760a993dd
2025-05-20 13:27:04 +02:00
eldritch horrors 8d5bc9ed48 libexpr: remove ca derivation eval support
Change-Id: I8c06825d0fa7544b8bc9e3bda948e84a5f21ee16
2025-05-20 13:27:04 +02:00
eldritch horrors dad28eca75 cli: disallow ca derivations
we no longer have any experimental features depending on ca derivations,
so we can start removing them. since ca derivations are very invasive we
will need a while to remove all of the explicitly experimental code, and
even then we will not have removed *all* code related to ca derivations.
especially in the derivation goals there is a lot of code that is not as
easy to disentangle from experimental features as some would have hoped.

Change-Id: Ia456aadc6164613ded343f571318494d9310a549
2025-05-20 13:27:04 +02:00
eldritch horrors 8029cec3c0 libstore: remove some unused code
these must've been left around by accident if past cleanups.

Change-Id: I3458ae45e362e7912a6bbe1f31956c41094144d3
2025-05-16 13:16:27 +02:00
eldritch horrors 3684c2f8a0 libutil: remove dynamic derivations feature
Change-Id: Id48c775197e89bfda711c5cb03752980785c3d26
2025-05-12 13:37:54 +02:00
eldritch horrors ccdd916226 libstore: de-ref {Derived,Built}Path::Built drvPath
they're no longer recursive, so this is perfectly fine.

Change-Id: If565a557f2c2074e2a96a7f89c51ff1c51146b36
2025-05-12 13:37:54 +02:00
eldritch horrors 84c1df46ea libstore: remove DerivedPathMap
single-level maps suffice now that dynamic derivations are gone.

Change-Id: If29998b104b31255292ab0c789622d7d27040f69
2025-05-12 13:37:54 +02:00
eldritch horrors 68dfcfc6a4 treewide: don't resolveDerivedPath opaque paths
resolution of opaque paths is just an expensive `->path`.

Change-Id: I0c8d8b908f358d0bd26d1dcba84b2de6cbdc7c29
2025-05-12 13:37:54 +02:00
eldritch horrors f5e2e78266 libexpr: remove more obsolete DerivedPath methods
split from the prior commit for easier review.

Change-Id: Iabf1bc759cb56a04211d4cb07769f53b0f302b39
2025-05-12 13:37:54 +02:00
eldritch horrors 5f723e96e6 libstore: flatten {,Single}{Built,Derived}Path
only dynamic derivations could produce a non-opaque drvPath. since
dynamic derivations are no longer supported we can have drvPath be
opaque at all times, simplifying downstream code significantly and
making quite a few methods unnecessary. discardOutputPath was only
called on drvPath members anyway and thus reduces to a copy, other
operations at the very least are no longer recursive. some vestige
of dynamic derivations remains in DerivedPathMap though (for now).

Change-Id: Ifb4ad53a3c67800be5a62540068c8279d4ae0046
2025-05-12 13:37:54 +02:00
eldritch horrors 8a539424c8 libexpr: drop support for dyn-drv string context
string context doesn't need any tests because it's never persisted or
shown to the user. getting rid of recursive string context means that
the context string parsers can be a lot simpler from here on forward.

Change-Id: I58443679ad76c0f28ea5f4eb8bfb3874f270e764
2025-05-12 13:37:54 +02:00
eldritch horrors a490e2d946 libstore: remove ability to read or write dyn-drvs
as with impure derivations it is still possible to garbage-collect
existing xp-dyn-drv derivations. we once again don't introduce any
new kinds of errors, we only change the dynamic type of exceptions
from MissingExperimentalFeature to UnimplementedError (although we
do throw FormatError when reading xp-dyn-drv derivations now, that
seems to make a little more sense than "feature not implemented").

Change-Id: Ic26e5b6c9c9e2533093e27f6cf901dc9db57c83e
2025-05-12 13:37:54 +02:00
eldritch horrors 5ae8ac84ea libstore: remove dyn-drvs remote store error hack
with dynamic derivations gone this code will never run again.

Change-Id: I7673a81269c33e62c6c184d33cbc9f3ba0079bee
2025-05-12 13:37:54 +02:00
eldritch horrors 936ac14f1a libexpr: disallow creation of text-hashed derivation outputs
only dynamic derivation produce text-hashed derivation outputs. toFile
produces text-hashed store paths, so we cannot remove text hashing now
without breaking stores, but we can disallow it in derivation outputs.

Change-Id: I95ff9882a59153a7d5fd509f5c9fd85925f30d02
2025-05-12 13:37:54 +02:00
eldritch horrors b8b05d4da4 libexpr: remove dynamic derivation eval support
Change-Id: I8bbdaa280f634bafd5abd7034a605564f45978c0
2025-05-12 13:37:54 +02:00
eldritch horrors 540071dd77 cli: disallow dynamic derivations
with impure derivations gone we move on to dynamic derivations. this too
is not done in a single commit because dynamic derivations are invasive,
modifying semantics of all references to derivation output paths and all
derivation dependency calculations. removing dynamic derivations cleanly
is made significantly harder by the multiple did-you-mean-sum types, aka
"wrappers for std::variant", holding all derivation outpath information.

Change-Id: Ice7a7700c7b54c6a6061d4beb322b4175923d27a
2025-05-12 13:37:54 +02:00
eldritch horrors 18aebab9b6 libstore: remove unused resolveDerivedPath overload
Change-Id: Iaaeb688d601a21c817fb0449faf9541ea8e0301a
2025-05-11 21:16:36 +00:00
eldritch horrors 7bbe6fc47f libstore: remove impure-drvs feature
no documentation seems to have existed for this feature.

Change-Id: I3ec8afd9aeedbff1cc5edabc9074df33dae7d357
2025-05-11 17:27:05 +02:00