Commit graph

125 commits

Author SHA1 Message Date
Florian Klink
16136380ec refactor(nix-compat/nixhash): drop NixHashResult type alias
This one is overkill. `NixHashResult<NixHash>` takes exactly as many
characters as `Result<NixHash, Error>`, so removing the type alias
actually removes the total amount of code.

The only external reference to it is somewhere that should probably live
in nixhash::ca_hash.

Change-Id: I0c4a149294d33129a67cb1b699cc8a645c7c18e1
Reviewed-on: https://cl.snix.dev/c/snix/+/30562
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: edef <edef@edef.eu>
2025-06-04 21:42:38 +00:00
Florian Klink
4a63d85b06 feat(nix-compat/nixhash): digest_length is const
Change-Id: I565f70b4dd7d44b176a1d6fe5009fdf5346c5ab6
Reviewed-on: https://cl.snix.dev/c/snix/+/30561
Reviewed-by: edef <edef@edef.eu>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-06-04 21:42:08 +00:00
Florian Klink
2dfbfebb47 test(nix-compat/nixhash): rework NixHash::from_str tests
The test code was way too complicated. We had testcases manually
constructing different NixHash as an input, extracted digest and algo,
then manually encoded them with various encodings, to then compare to
itself.

Instead, write out these different string inputs as explicit testcases.

Change-Id: I2adeedcb9ddc8b3d50f8bdab09a1e95198cda402
Reviewed-on: https://cl.snix.dev/c/snix/+/30560
Reviewed-by: edef <edef@edef.eu>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-06-04 21:38:07 +00:00
Florian Klink
ea861bba67 refactor(snix/glue/fetchers): cleanup
We can reject early if invalid keys are provided in the attrset, no need
to look at values already.

Also, restructure the code parsing and extracting a sha256 by
destructuring the enum, rather than grabbing a slice and trying to
convert to a fixed-size array.

Change-Id: I1bb067133e398626df25b9c1cf99926c6d836a19
Reviewed-on: https://cl.snix.dev/c/snix/+/30559
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: edef <edef@edef.eu>
Tested-by: besadii
2025-06-04 21:29:36 +00:00
Florian Klink
f6c66af33d refactor(nix-compat/nixhash): move from_ and to_ to NixHash struct
It was a bit confusing to construct NixHash, having them as separate
functions in the module itself, rather than in the NixHash impl.

Also the names were very inconsistent.

This renames parsers to `from_$format_$encoding` and format methods to
`to_$format_$encoding`. It also adds / moves around a few docstrings,
explaining the formats and encodings in the struct docstring itself.

from_str is changed to accept Option<HashAlgo>, not Option<&str>, and
the otherwise unused `from_nix_hash_string` is folded into from_str.
We also simply use from_sri in from_str, as the error path there doesn't
allocate anymore.

Similarly, the from_nix_str function was only a helper function used to
parse a subset of the formats supported in the NixHash::from_str method.
We shouldn't be using it outside of there, all usages (only in tests)
have been replaced with NixHash::from_algo_and_digest.

Change-Id: I36128839dbef19c58b55d5dc5817e38e37a483cc
Reviewed-on: https://cl.snix.dev/c/snix/+/30554
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Reviewed-by: edef <edef@edef.eu>
Tested-by: besadii
2025-06-04 21:25:57 +00:00
Florian Klink
6c1bfd778e refactor(nix-compat/nixhash): move serde into serde module
Especially the various specific format serializers/deserializers with
used in path_info.rs shouldn't be living there, but in NixHash, so they
can be used by other consumers of the library wanting to restrict to a
certain format.

Change-Id: Id43ba96e3f6ec68999f028854b625d5335d71554
Reviewed-on: https://cl.snix.dev/c/snix/+/30556
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-06-03 23:25:01 +00:00
Florian Klink
87d80eb1cc refactor(nix-compat/nixhash): absorb to_plain_hex_string
This is only used inside NixHash::to_nix_hex_string().

Change-Id: I7c9c0cd7d4feaa41b0861bb5c0e99a47ec0caac1
Reviewed-on: https://cl.snix.dev/c/snix/+/30555
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2025-06-03 23:19:00 +00:00
Florian Klink
7b6b94c5ca refactor(nix-compat/nixhash): use a bit more map and ok_or_else
This looks more readable like this.

Change-Id: Iaa750fae66c7263612f169405eb7d38fb9541b04
Reviewed-on: https://cl.snix.dev/c/snix/+/30552
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: besadii
2025-06-03 20:59:28 +00:00
Florian Klink
963546bd37 refactor(nix-compat/nixhash): s/InvalidEncodedDigestLength/InvalidDigestLength/
This error is used for invalid digest lengths for a passed HashAlgo, not
just when they're encoded (as can be seen in from_algo_and_digest).

Change-Id: I7604846ae133df1be516a1f7ab28efd2a5775145
Reviewed-on: https://cl.snix.dev/c/snix/+/30551
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-06-03 20:22:23 +00:00
Florian Klink
6022fb3cc2 refactor(nix-compat/nixhash): drop impl TryFrom<(HashAlgo, &[u8])> for NixHash
This is not used anywhere, and a bit surprising. Consumers can just use
from_algo_and_digest.

Change-Id: Id4fca98568b1967899fb7428e6767aa993e70c96
Reviewed-on: https://cl.snix.dev/c/snix/+/30550
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: besadii
2025-06-03 20:22:23 +00:00
Florian Klink
2a01c40e77 fix(nix-compat/nixhash): fix from_nix_nixbase32_str fn name
This was decoding nixbase32, not hex. Its only consumer (in ca_hash.rs)
was right in its docstring about how it behaves, only was calling the
wrongly-named function.

Change-Id: I97ea273706ba818d16a61b1574989db800f78ead
Reviewed-on: https://cl.snix.dev/c/snix/+/30553
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-06-03 20:22:23 +00:00
Florian Klink
80b5206034 refactor(castore/fs): use streams for dir handles
This changes RootNodes::list to return a BoxStream<'static, _>, and then
drops all the mpsc sender / receiver complexity we were having.

There's also no need to worry about channel buffer sizes - all current
RootNodes implementations are immediately ready to yield new elements in
the stream. Assuming there's new implementations that do take some time,
we can deal with buffer sizes on the producer size, which might know its
own batch sizes better.

RootNodes now doesn't need to implement Clone/Send anymore, and can have
non-static lifetimes. As long as its the list method returns a
BoxStream<'static>, we're fine with all that.

On a first look, this seems like we now need to do more cloning upfront
for the BTreeMap and Directory RootNodes impls. However, we already
had to clone the entire thing at `self.root_nodes_provider.clone()`, and
then did it again for each element.

Now we get an owned version of the data whenever a list() call happens,
and then just move owned things around.

Change-Id: I85fbca0e1171014ae85eeb03b3d58e6176ef4e2d
Reviewed-on: https://cl.snix.dev/c/snix/+/30549
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: besadii
2025-06-02 22:19:24 +00:00
Florian Klink
0f9c5f0354 refactor(glue/snix_store_io): add node_get_type helper
There's multiple places where we peek at the node to construct a
FileType, so move this into a helper.

Also, get rid of a async move which didn't move, and use .ok_or_else to
make things a bit more readable.

Change-Id: I2d24a3291029fdc12e0049398d8d51111e22d3cf
Reviewed-on: https://cl.snix.dev/c/snix/+/30548
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: besadii
2025-06-02 22:13:23 +00:00
Florian Klink
59aeeb6fe4 refactor(castore/fs): stop using async move
We don't move anything here.

Change-Id: Ia9f345adf86be3c3f64fef0e6aca067ecbf7cf5d
Reviewed-on: https://cl.snix.dev/c/snix/+/30547
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-06-02 22:08:23 +00:00
Florian Klink
33a02267c2 refactor(castore): drop Clone + Send + Sync requirements on BS, DS
We can now use async closures for this.

Change-Id: Iccbe86998726be139e81749745c37eb9f475693c
Reviewed-on: https://cl.snix.dev/c/snix/+/30546
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Connor Brewster <cbrewster@hey.com>
2025-06-02 21:57:51 +00:00
Florian Klink
97f215aef2 feat(nix-compat/nixhash): add NixHash::to_sri_string
As can be seen in https://github.com/andir/npins/pull/139/files#diff-ec60332b9e2ccfe20e64db6d804f37fe4c652ae58c0679a13e30548cecf1c32fR12,
it makes sense to have this as a function for external consumers.

This is already also exposed in the Display impl, but it's better to
have an explicit function.

Change-Id: I1e16d8bd64502802a9642a2f08ddeb5cbbceacae
Reviewed-on: https://cl.snix.dev/c/snix/+/30545
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-06-02 11:55:53 +00:00
Florian Klink
80f5b5c44e docs(glue/snix_build): document why /nix/store is scratch
Even without nix/store in here, all output paths need to be write-able.

Change-Id: Ibeeba503844dee78de11fd2aa79b3ad207795059
Reviewed-on: https://cl.snix.dev/c/snix/+/30542
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
2025-05-28 15:13:05 +00:00
Florian Klink
688973ad78 fix(glue/builtins/derivation): fix comment
The magic builder string is called "builtin:fetchurl", not
"builtins:fetchurl"

Change-Id: I0527aa9ba293807c0da7e67c8d7e9d441de81623
Reviewed-on: https://cl.snix.dev/c/snix/+/30541
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
Tested-by: besadii
Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz>
2025-05-28 15:13:05 +00:00
Vova Kryachko
2bbd06753b feat(snix-glue): Correctly propagate output placeholders into the build.
Nix's `builtin.placeholder` function produces output paths that are not
known ahead of time, so before propagating these values into the build
we need to replace them in all env variables and arguments to their
corresponding output store paths.

fix #101

Change-Id: I2670c749f2c578e276d698e511598a76a99ebb96
Reviewed-on: https://cl.snix.dev/c/snix/+/30310
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
Autosubmit: Vova Kryachko <v.kryachko@gmail.com>
2025-05-18 14:30:35 +00:00
Vova Kryachko
bb8c4e5c0d fix(glue): Set BUILD_TOP correctly as per nix behavior.
This change makes BUILD_TOP to point to /build, which is what nix does.

Change-Id: I4ffef67aff0665d13859378a86329291a53d4ea0
Reviewed-on: https://cl.snix.dev/c/snix/+/30500
Reviewed-by: Florian Klink <flokli@flokli.de>
Autosubmit: Vova Kryachko <v.kryachko@gmail.com>
Tested-by: besadii
2025-05-12 00:09:06 +00:00
edef
4749964f06 refactor(nix-daemon/framed): simplify partial header read
Rather than having separate branches, just make it part of the state
machine discipline.

Change-Id: Ib21456227515506495ca06ac2a8a529d04f95fde
Reviewed-on: https://cl.snix.dev/c/snix/+/30496
Reviewed-by: Brian Olsen <brian@maven-group.org>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-11 00:31:30 +00:00
edef
d5c5269ca4 tests(nix-daemon/framed): verify waking behaviour
We should never return `Poll::Pending` without having received it from
the underlying reader.

Change-Id: I8c79c0243dc45889c1df478712971ef930e5f3a9
Reviewed-on: https://cl.snix.dev/c/snix/+/30498
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-11 00:31:30 +00:00
edef
83c3305863 fix(nix-compat/wire/bytes/reader): handle zero cases
Legitimate zero-length reads could cause spurious unexpected EOF,
since we implicitly assumed buffers always have remaining capacity.

For the buffered case, `consume(0)` could cause panics after either
`poll_fill_buf` or `poll_read` had returned `Poll::Pending`.

The bytes_read/with_limited logic receives a stylistic cleanup to make
it obvious that bytes_read is always written before being used.

Change-Id: I46aa47113309552dcef9532b5d4009d2186db9cd
Reviewed-on: https://cl.snix.dev/c/snix/+/30492
Tested-by: besadii
Reviewed-by: Brian Olsen <brian@maven-group.org>
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-09 22:37:31 +00:00
edef
9a8a9c6b67 fix(nix-daemon): ensure Framed NARs are read exactly
This prevents framing confusion, which would otherwise lead to a
trivial confused deputy attack. See issue #120.

The NixFramedReader state machine has been refactored to simplify
its internal logic and accurately account for EOF conditions.

End-of-stream is fused, and unexpected EOF on the underlying reader
is returned as UnexpectedEof, though we don't fuse those ourselves.

We also ensure that the underlying reader does not swap the ReadBuf;
this would otherwise supply a primitive for converting uninitialised
mutable memory into `&mut [u8]` without initialisation, thus allowing
undefined behaviour to be triggered from safe code.

Change-Id: I05ddb7e3ca57b3363f56c0d9b43d5a641748ca36
Reviewed-on: https://cl.snix.dev/c/snix/+/30380
Reviewed-by: Brian Olsen <brian@maven-group.org>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-09 17:15:28 +00:00
edef
4ef7c50a2d tests(nix-daemon/framed): more thorough, failing tests
This is mostly a WIP commit, to demonstrate bugs properly. See #120.
The tests are marked `#[should_panic]`, since they are intended to fail.

Change-Id: I39f1d66742e6629ccb889da8ef1199117b91b126
Reviewed-on: https://cl.snix.dev/c/snix/+/30490
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-09 17:15:28 +00:00
Florian Klink
7eb15f8123 refactor(eval): make CatchableErrorKind::Throw hold a NixString
The messages we can throw are not necessarily UTF-8 strings. The
to_string() in there did store the result of the Display impl, which is
a quoted string.

Change-Id: I65a77ccc7f2d62ff06a2a9458cdb7e7292f132b0
Reviewed-on: https://cl.snix.dev/c/snix/+/30489
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Bence Nemes <nemes.bence1@gmail.com>
2025-05-07 13:07:18 +00:00
Florian Klink
bbc1efdb0e test(eval): add test for deep force key order
This tests deep forcing happens in lexicographic key order, by comparing
the returned error from the evaluator. It's not possible to observe this
from inside nixlang, which is why we use one_offs.rs here.

Change-Id: I73085addca3a4df20bc23f9fced458758af5b391
Reviewed-on: https://cl.snix.dev/c/snix/+/30488
Reviewed-by: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-05-07 12:34:45 +00:00
Starnick4444
e97cf628a3 refactor(eval): switch NixAttrs implementation to HashMap
Using hashmap seems to give a decent speedup overall.

hello outpath           time:   [528.01 ms 529.17 ms 530.64 ms]
                        change: [-22.932% -22.563% -22.181%] (p = 0.00 < 0.05)
                        Performance has improved.

firefox outpath         time:   [4.7647 s 4.8149 s 4.8917 s]
                        change: [-21.251% -20.408% -18.914%] (p = 0.00 < 0.05)
                        Performance has improved.

But it slows down derivation parsing by about 1-1.5%
Added another attr merge benchmark that helped me while profiling,
not sure if we want to keep that.

Change-Id: Icb9f1e2d40bbb7150af1b8df192bf3c860bae79b
Reviewed-on: https://cl.snix.dev/c/snix/+/30309
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-07 12:08:50 +00:00
Florian Klink
8903fbb975 docs(snix/docs/TODO): drop Store config section
moved to #138 and #139.

Change-Id: I3ad3dc5ab0c38ba4ed0ac43d5c492f802be61ed8
Reviewed-on: https://cl.snix.dev/c/snix/+/30481
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
2025-05-05 17:39:55 +00:00
Florian Klink
d02991b6b2 docs(snix/docs/TODO): drop store composition setting
Combinators are tracked in #135, a followup for `CombinedBlobService` is
tracked in #136.
User-facing composition config is tracked in #137.

Everything else mostly already landed with the rest of the store
composition, so can be dropped.

Change-Id: I3e0aee409f8314b1a0582541fd5f1b8b50405ce5
Reviewed-on: https://cl.snix.dev/c/snix/+/30480
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-05 17:39:55 +00:00
Florian Klink
9bbfbd7df3 docs(snix/docs/TODO): drop Error cleanup TODO
Migrated to #134.

Change-Id: I555219085fea8c192e769cb7b5357321087ffdf7
Reviewed-on: https://cl.snix.dev/c/snix/+/30479
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Tested-by: besadii
2025-05-05 17:39:55 +00:00
Florian Klink
018f3b38a6 docs(snix/docs/TODO): drop object_store o11y TODO
Migrated to #133.

Change-Id: Ia4e23c082b14268b314fa5bd9cbaab3bae1e7d90
Reviewed-on: https://cl.snix.dev/c/snix/+/30475
Tested-by: besadii
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-05-05 11:56:26 +00:00
Florian Klink
ea90045ddc docs(snix/docs/TODO): drop builder TODOs
A mention of these different builders is included in the a footnote
in the documentation, and various issues for the different TODOs were
created:

 - #128 Implement bwrap-based Builder
 - #129 Implement gVisor-based builder
 - #130 Implement Cloud Hypervisor-based builder
 - #131 OCI builder: add preflight checks
 - #132 BuildService: refactor to be more granular

Change-Id: I349b799e233ba8bef39a139cf2453d3214bb69b3
Reviewed-on: https://cl.snix.dev/c/snix/+/30474
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
2025-05-05 11:56:26 +00:00
Florian Klink
c1331c3d93 docs(snix/docs/TODO): drop Derivation -> Build section
This was most likely meant to refer to `exportReferencesGraph`, not
`fetchClosure`. `fetchClosure` is not used in nixpkgs - I created #127
still.

Issue #44 is extended to mention `ExportedPathInfo`.

Change-Id: Id898cb381db02c83888dc395cf3ab01ae6baf2aa
Reviewed-on: https://cl.snix.dev/c/snix/+/30473
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-05 11:56:26 +00:00
Florian Klink
0bc0807e24 docs(snix/docs/TODO): drop fetchGit/fetchTree TODO
Migrated to #126.

Change-Id: Iccfc0cbd9bdc08fde337ae097eb7ddb57c67d439
Reviewed-on: https://cl.snix.dev/c/snix/+/30472
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-05 11:56:26 +00:00
Florian Klink
4e62ccd74c docs(snix/docs/TODO): drop Nix Daemon protocol item
This is very generic and not helpful.

Change-Id: Ie851e0e293023ab1794c6815e0a0e188471f509b
Reviewed-on: https://cl.snix.dev/c/snix/+/30471
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-05 11:56:26 +00:00
Florian Klink
6436ed9b0b docs(snix/docs/TODO): drop serde_qs bigtable TODO
This was already migrated to use a BigtableParameters struct, similar to
other backends.

Change-Id: Icc8a4902a6f24ce4a7f965abc800726b09030cb3
Reviewed-on: https://cl.snix.dev/c/snix/+/30470
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-05 11:56:26 +00:00
Florian Klink
01d88ef175 docs(snix/docs/TODO): drop pathinfo sqlite todo
Migrated to #125.

Change-Id: Ib08c064cfe2843ae9b1e746e46688edb7584c84a
Reviewed-on: https://cl.snix.dev/c/snix/+/30469
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
2025-05-05 11:56:26 +00:00
Florian Klink
bee96eef14 docs(snix/docs/TODO): drop rnix non-UTF8 todo
Tracked in https://git.snix.dev/snix/snix/issues/124 and
https://github.com/nix-community/rnix-parser/issues/173.

Change-Id: I5431fda1eae574d45bf6bda5d94269ba6e7fb6ba
Reviewed-on: https://cl.snix.dev/c/snix/+/30468
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
2025-05-05 11:56:26 +00:00
Florian Klink
81c8260afd docs(snix/docs/TODO): drop remaining perf items
This was migrated to #122 and #123.

Change-Id: I5196a12530fe420c7682312774e14807df688928
Reviewed-on: https://cl.snix.dev/c/snix/+/30467
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
2025-05-05 11:56:26 +00:00
Florian Klink
e5c4fb6cb8 docs(snix/docs/TODO): fix heading levels
These don't make sense without a parent, move these one level up.

Change-Id: I492e43da1d1a429e7c46b65b0c676d5d8c54fdf6
Reviewed-on: https://cl.snix.dev/c/snix/+/30466
Tested-by: besadii
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-05-05 11:56:26 +00:00
Florian Klink
dfffd5c295 docs(snix/docs/TODO): remove Nix Language test suite item
This has been migrated to #64 a while ago.

Change-Id: Iec15043650284ac7c2cb62863028f360675bdc82
Reviewed-on: https://cl.snix.dev/c/snix/+/30465
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
2025-05-05 11:56:26 +00:00
Florian Klink
3dc13fbae9 docs(snix/docs/TODO): clarify status of this document
This is slowly being plucked apart and migrated to more suitable places.

Change-Id: Ib4f4e76601a657cfef85dc759f8ec9bde4eadb86
Reviewed-on: https://cl.snix.dev/c/snix/+/30464
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
2025-05-05 11:56:26 +00:00
Florian Klink
21628f7ad4 docs(web): migrate language-spec,lang-version,value-pointer-equality
Change-Id: I2008d4d5d92dc02f3955828ba93f748282948f07
Reviewed-on: https://cl.snix.dev/c/snix/+/30447
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
Tested-by: besadii
2025-05-04 17:26:22 +00:00
Florian Klink
52e7b5b485 refactor(snix/build): drop build_request from Build{Result,Response}
Back when initially working on this, having all info about the Build in
one struct seemed a good idea for some future CI interface, but right
now this simply raises more questions and is quite theoretic.

Let's drop it for now, we can reintroduce it, or other request methods
when we get to it.

Change-Id: I105a8d5ae8bd7e0d5f8ee3e7edf2597100b43119
Reviewed-on: https://cl.snix.dev/c/snix/+/30425
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
2025-05-04 16:12:45 +00:00
Florian Klink
dd3b447428 docs(web): import store configuration/composition document
Put it in Guides, as it provides some examples at the end as well.

Change-Id: Ic5cd78bcda09c3bb82eeaa88ff0c959c4c876bd7
Reviewed-on: https://cl.snix.dev/c/snix/+/30445
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Yureka <snix@yuka.dev>
Tested-by: besadii
2025-05-04 15:24:10 +00:00
Starnick4444
1a84bc0e62 chore(glue): upgrade to 2024 edition
Part of #114
cargo fix wanted to rewrite `if let else` to match statements, but i
reverted them as they dont belong in this cl.
There weren't any warnings about locks (relative drop order changed in
2024)

Change-Id: I9c851ef8e214a481cbe7b4cf9b2634b5d56970d4
Reviewed-on: https://cl.snix.dev/c/snix/+/30369
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-05-04 14:30:34 +00:00
Starnick4444
916988a7a2 chore(castore-http): upgrade to 2024 edition
Part of #114

Change-Id: I083ad939c836736b44b36c38e16a04cbaabe9442
Reviewed-on: https://cl.snix.dev/c/snix/+/30377
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-05-04 14:30:03 +00:00
Florian Klink
759f15390c feat(nix-compat/nar): add copy functions
This allows piping NAR data through a reader, and writing it back out to
a writer.

It can be used to validate a NAR to be syntactically correct, or to read
exactly to the end of a NAR file if the size is not given externally.

Change-Id: I0fc8d58e68783400d1cfee75c860138915974f3d
Reviewed-on: https://cl.snix.dev/c/snix/+/30423
Tested-by: besadii
Reviewed-by: edef <edef@edef.eu>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-05-04 11:55:49 +00:00
Florian Klink
9caaa09765 refactor(snix/build): use stronger typed BuildResult type
This changes the BuildService trait to return a typed `BuildResult`,
which bundles the refscan info alongside the castore nodes.

The proto type is renamed to BuildResponse, to better map to gRPC
semantics.

In proto land, we don't send the name for outputs anymore, be it the
full path or the last component, as there's never been a guarantee this
is a valid PathComponent. That entry is now required to be anonymous.
The path of an output can be retrieved by looking at the original
BuildRequest.

Change-Id: If5ce3a009cd3dd6bb6505cd51d5f4deda261ea85
Reviewed-on: https://cl.snix.dev/c/snix/+/30387
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
2025-05-04 01:38:29 +00:00