Commit graph

21908 commits

Author SHA1 Message Date
Brian Olsen
e5177ae930 feat(nix-compat): Use serde_with for HashAlgo serialization
We already have serde_with in the workspace and using it cuts down
on code lines (very slightly).

This also adds a FromStr implementation for HashAlgo in addition to
the existing TryFrom<&str>.

Change-Id: I1b525d7391f3881d54cef0c74d22198ad394f47d
Reviewed-on: https://cl.snix.dev/c/snix/+/30652
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Autosubmit: Brian Olsen <brian@maven-group.org>
2025-08-05 22:23:54 +00:00
Brian Olsen
6187029077 feat(nix-compat): Add serde feature flag
This makes serde features optional behind a flag that is not enabled
by default. So Deserialize and Serialize implementations and anything
that deals with JSON.

Change-Id: I04830aa3883da13ea99a4a51b28981e8a5ecd426
Reviewed-on: https://cl.snix.dev/c/snix/+/30660
Autosubmit: Brian Olsen <brian@maven-group.org>
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-08-05 22:04:21 +00:00
Mai
2a29b90c7f feat(snix/castore): Add daemon subcommand
Change-Id: I315c473385d40999f69084d525e36d8eda82d15c
Reviewed-on: https://cl.snix.dev/c/snix/+/30654
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-08-05 21:42:56 +00:00
Oleksandr Knyshuk
0ff37a7217 feat(builtins/placeholder): enforce derivation output‐name rules
- factor out output‐name checks into `nix_compat::derivation::validate_output_name`
- re-export `validate_output_name` in `nix-compat/src/derivation/mod.rs`
- import and invoke `validate_output_name` in `builtins.placeholder`
- add Nix tests to cover empty, reserved “drv”, invalid chars, and valid names

Closes #38.

Change-Id: I6a6a6964a720fee8110606b11cb3a30f0d8b23f8
Reviewed-on: https://cl.snix.dev/c/snix/+/30655
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Autosubmit: Oleksandr Knyshuk <olk@disr.it>
2025-08-05 17:08:04 +00:00
Brian Olsen
a1cfdeb0ef fix(nix-compat-derive-tests): Get rid of compile-tests flag
Because we are now using mkCargoBuild to build this crate in CI we can
get rid of the compile-tests flag and always run the compile tests.
This is because the trybuild crate works when using the the same build
method we used for rustdoc an clippy.

Change-Id: I3f168a987a09bf6f3e3e7c1ab3aaa1acd9d010cf
Reviewed-on: https://cl.snix.dev/c/snix/+/30651
Reviewed-by: Florian Klink <flokli@flokli.de>
Autosubmit: Brian Olsen <brian@maven-group.org>
Tested-by: besadii
2025-08-04 22:33:38 +00:00
Brian Olsen
9743771f1a chore: Use mkCargoBuild for nix-compat-derive-tests
When using mkCargoBuild we can in a later CL enable the compile tests
and get rid of the feature flag in the nix-compat-derive-tests crate.

Change-Id: Ieeb991b65beb6bf19a01d62a935b6ffaf3d405d8
Reviewed-on: https://cl.snix.dev/c/snix/+/30650
Autosubmit: Brian Olsen <brian@maven-group.org>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-08-04 22:33:38 +00:00
Brian Olsen
4a70e43022 fix(build): Add small doc struct to make rustdocs work on MacOS
This just adds a dummy struct of OCIBuildService to make rustdoc build
work on non-linux targets.

Change-Id: Iea958d9ed7ac0720ffe199c5c201e7a2edbba3ed
Reviewed-on: https://cl.snix.dev/c/snix/+/30649
Autosubmit: Brian Olsen <brian@maven-group.org>
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-08-04 22:33:38 +00:00
Brian Olsen
d7808ea630 chore: Add target for doc tests
This just adds a nix attribute for running rustdoc tests.

Change-Id: I3bf2699ef03c6b7cafc0b76b32660b142cbd972c
Reviewed-on: https://cl.snix.dev/c/snix/+/30648
Tested-by: besadii
Autosubmit: Brian Olsen <brian@maven-group.org>
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-08-04 22:28:07 +00:00
Brian Olsen
a82bd9137e chore: Refactor common cargo build derivations into own function
This creates a mkCargoBuild function of the shared bits from clippy and
rust-docs uses it for those targets.

Change-Id: I44f9f2b319ea4ef1d1236feabdf726f0256d5d70
Reviewed-on: https://cl.snix.dev/c/snix/+/30647
Reviewed-by: Florian Klink <flokli@flokli.de>
Autosubmit: Brian Olsen <brian@maven-group.org>
Tested-by: besadii
2025-08-04 22:28:07 +00:00
Mai
8e609804b9 fix(snix/castore,snix/store): Create parent directory when creating redb services
Change-Id: I0b3083cbbb865d4b724d2b30305c10f2a779bce4
Reviewed-on: https://cl.snix.dev/c/snix/+/30646
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-08-04 22:11:30 +00:00
Mai
05a9715a20 refactor(snix/castore): Use ServiceUrls in snix-castore command parsing
Change-Id: Ia7a6b5de215e8bd9b9f6987ae7b22b2f485bd61a
Reviewed-on: https://cl.snix.dev/c/snix/+/30644
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-08-04 22:03:39 +00:00
Mai
d14693ca80 feat(snix/castore): Change default blob and directory service locations to /var/lib/snix-castore
Change-Id: Id9d06c72a61bb51f2f960b0f76ff7e7b6965033f
Reviewed-on: https://cl.snix.dev/c/snix/+/30643
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-08-04 22:03:39 +00:00
Oleksandr Knyshuk
2b03762a05 fix(ops/forgejo): update forgejo to 12.0.1, re-vendor gerrit patches, and fix emoji links
- Update Forgejo from 11.0.1 to 12.0.1, match upstream (see #80, cl 30121).
- Re-vendor and refresh Gerrit integration patches from lix to restore compatibility (patches broke @ cl 30628).
- Update dead emoji asset links to new locations, borrowed from lix infra (old URLs 404'd).
- Fixes build failure for ops.nixos.public01System (#169).

Context:
- Forgejo build broke after nixpkgs channel bump (cl 30628) due to outdated patches (#169).
- Emoji assets previously fetched from volpeon.ink are now archived or moved; new URLs and hashes are from lix infra.
- Gerrit patches are yoinked from lix again to restore code review tab and Gerrit CL linking (thanks emilylange).

Closes: #169
Refs: #80

Change-Id: I6a6a696423a6360b4056892e171df2baf6fa7206
Reviewed-on: https://cl.snix.dev/c/snix/+/30645
Tested-by: besadii
Autosubmit: Oleksandr Knyshuk <olk@disr.it>
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-08-04 21:04:59 +00:00
Axel Karjalainen
4aa1137d8e refactor(snix/eval,snix/glue): add snix_eval::try_cek! macros
Fixes #146

Change-Id: I971fac0d9d18e4ea73a527e499ac7ac213658477
Reviewed-on: https://cl.snix.dev/c/snix/+/30638
Reviewed-by: Florian Klink <flokli@flokli.de>
Autosubmit: Axel Karjalainen <axel@axka.fi>
Tested-by: besadii
2025-08-04 15:34:31 +00:00
Oleksandr Knyshuk
8d0ae4f7ae feat(ops/gerrit-webhook-to-irccat): notify when CLs are undrafted
- Extend the notification template to handle `wip-state-changed` events where a change is undrafted (i.e., `.Change.Wip` is false or not present).
- Add test cases for undrafting (should notify) and re-drafting (should not notify).
- Ensure correct handling of `.Changer.Username` for undraft notifications.
- Update Go module dependencies for test coverage. (`go mod tidy`)

This allows the IRC bot to notify when a change is moved out of
WIP/draft state, improving visibility for ready-for-review CLs.

Fixes #167.

Change-Id: I6a6a69642369726c3bd9f523ae025c34dba8c4aa
Reviewed-on: https://cl.snix.dev/c/snix/+/30641
Reviewed-by: Oleksandr Knyshuk <olk@disr.it>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-08-04 12:50:22 +00:00
Starnick4444
2a1cd31d52 chore: finish migration to 2024 edition
Closes #114
Removes the per-crate rustfmt configs, sets default edition to 2024.
This should fix the formatting issues between some editors and CI.

Change-Id: I9bb3a5f49f8ba2c8a616f29e87b7f8093187a165
Reviewed-on: https://cl.snix.dev/c/snix/+/30595
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-08-03 20:10:05 +00:00
Oleksandr Knyshuk
bfdef33483 chore(turbofetch): update zstd dependency to 0.13
Update the zstd crate from version 0.9.0 to 0.13.0, removing the TODO
comment blocking the upgrade. The dependency update also includes
related bumps to zstd-safe and zstd-sys crates, along with the
addition of pkg-config as a new transitive dependency.

Change-Id: I6a6a696459075f5ee56f448e87286b6ec39b26d3
Reviewed-on: https://cl.snix.dev/c/snix/+/30640
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-08-03 14:28:40 +00:00
Starnick4444
40ab29c05a chore(eval): upgrade to 2024 edition
Part of #114
There were a lot of warnings about drop order change. They are triggered
by NixString's custom drop, but the drop doesn't have side effects so
they can be ignored.

Change-Id: I19071de0fd39b8f0d19abc917d1d89d1cf26de40
Reviewed-on: https://cl.snix.dev/c/snix/+/30592
Reviewed-by: Florian Klink <flokli@flokli.de>
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Reviewed-by: Domen Kožar <domen@cachix.org>
Tested-by: besadii
2025-08-03 14:19:04 +00:00
Starnick4444
beca8c8a4c refactor(eval): add get_env to Io trait
Abstracts enviornment access to the IO trait.
It also replaces the unsafe set_var in the test harness.

Change-Id: I3908f2d3cc4392ad2f5bc843c4de63382b692dfd
Reviewed-on: https://cl.snix.dev/c/snix/+/30639
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-08-03 09:49:10 +00:00
Axel Karjalainen
a1b1348979 fix(web/building): mg link
Change-Id: I22ca3d3960d23d5dfc1e20140c28de79896926aa
Reviewed-on: https://cl.snix.dev/c/snix/+/30636
Tested-by: besadii
Autosubmit: Axel Karjalainen <axel@axka.fi>
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-07-31 21:57:59 +00:00
Florian Klink
fb6d9f5114 chore(3p/nixpkgs): bump channels (2025-07-31)
Change-Id: I1ae84e743281125ecbdc98cdb4f2adf5a96905a7
Reviewed-on: https://cl.snix.dev/c/snix/+/30628
Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz>
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-07-31 15:56:27 +00:00
Florian Klink
b0edb870ee chore(3p/agenix): bump
This was still using substituteAll, which got removed in the following
nixpkgs bump.

Change-Id: Ia07e2fce8a405973234f2c0d247579f68679446c
Reviewed-on: https://cl.snix.dev/c/snix/+/30629
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz>
2025-07-31 15:44:56 +00:00
Florian Klink
87411772d7 fix(snix/castore): allow result_large_err for redb create_schema
Passing around boxed errors here would be way more annoying, and we call
this once during database initialization.

Change-Id: I04e65dcc6fbdec591ef553bac9825f51a7d47991
Reviewed-on: https://cl.snix.dev/c/snix/+/30633
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz>
2025-07-31 15:44:56 +00:00
Florian Klink
c32a23bf63 fix(snix/tracing): fix clippy::result_large_err lint
We still need to unbox before calling ::with_interceptor, the proper fix
will be in https://github.com/hyperium/tonic/issues/2253.

Change-Id: I6de13de79e8ffd9d2f75268b7b232c2f6c91202d
Reviewed-on: https://cl.snix.dev/c/snix/+/30632
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz>
2025-07-31 15:33:25 +00:00
Florian Klink
74264569ee fix(snix/[ca]store): restore client trace propagation
This broke in cl/11976 and cl/11983, the ::with_interceptor() calls
went missing.

Change-Id: Ic78a88d6c102d79da58fe45d5e595d3879c12af7
Reviewed-on: https://cl.snix.dev/c/snix/+/30631
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz>
2025-07-31 15:13:22 +00:00
Florian Klink
a9d5c184d5 refactor(snix): address upcoming clippy lints
This uses variables inside `format!()` strings directly,
and switches to using `std::io::Error::other(e.to_string())`
instead of std::io::Error::new(io::ErrorKind::Other, e.to_string()).

It also found an unnecessary `mut` in the test harness.

Change-Id: I406c709091e87ec64bfbdbcdc7f460af9b83d3bc
Reviewed-on: https://cl.snix.dev/c/snix/+/30630
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz>
2025-07-31 15:01:21 +00:00
Axel Karjalainen
632bc09350 fix(web/about): add missing "reach out" link
Change-Id: I1a7a0ee88a30379b9c4b18ff0a304d5deb3b1648
Reviewed-on: https://cl.snix.dev/c/snix/+/30627
Autosubmit: Axel Karjalainen <axel@axka.fi>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-07-31 09:12:47 +00:00
Florian Klink
a2ace425cb feat(ops/machines/*01): install kitty terminfo
Change-Id: If9e2ca897e52ae9aa4da033b52dee6f17e66f636
Reviewed-on: https://cl.snix.dev/c/snix/+/30623
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz>
Tested-by: besadii
2025-07-29 11:47:25 +00:00
Florian Klink
723ef9146b fix(ops/gerrit-webhook-to-irccat): fix json parsing
patchset and change numbers are numbers in the JSON, trying to deserialize them into a string fails:

Jul 28 20:34:03 gerrit01 gerrit-webhook-to-irccat[2430441]: time=2025-07-28T20:34:03.675Z level=WARN msg="failed to parse body" error="json: cannot unmarshal number into Go struct field PatchSet.patchSet.number of type string"

Update our library dependency to a version containing the fixed types.

Also add tests for the three messages we care about.

Change-Id: Iac44e6ad01a8590b4cafa4d301c9f45000f335d0
Reviewed-on: https://cl.snix.dev/c/snix/+/30624
Tested-by: besadii
Reviewed-by: Ryan Lahfa <ryan@lahfa.xyz>
Reviewed-by: Jade Lovelace <jade@lix.systems>
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-07-29 11:47:24 +00:00
Florian Klink
a1aa231b3f refactor(snix/clippy): stop allowing blocks_in_conditions
This was a workaround, the workaround is not needed anymore.

Change-Id: I4a839f3733ec6cb0a26ba87dadafe304ff5ccfbe
Reviewed-on: https://cl.snix.dev/c/snix/+/30603
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Yureka <snix@yuka.dev>
Tested-by: besadii
2025-07-29 10:19:46 +00:00
Florian Klink
90eabc9ae0 chore(snix): format TOML files
Change-Id: I4c5bf0a378c69a2a22097000583b1abcee089190
Reviewed-on: https://cl.snix.dev/c/snix/+/30602
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Yureka <snix@yuka.dev>
2025-07-29 10:18:46 +00:00
Florian Klink
fa2ea97ef3 refactor(snix/shell): drop josh functionality
Snix is not provided as a josh workspace, this was only the case for
Tvix, while still in the TVL repo, so we can drop that entrypoint.

Change-Id: Iafc2a6520645e607f26bcf674a3d98b646f5c9f2
Reviewed-on: https://cl.snix.dev/c/snix/+/30601
Reviewed-by: Yureka <snix@yuka.dev>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
2025-07-29 10:18:15 +00:00
Jade Lovelace
7bc461b162 feat(snix/shell.nix): automatically set up the commit-msg hook
Lix does this and it has eliminated anyone ever having to think about
it; it just works.

Change-Id: I24a35d2d0b31f1245172d332bac40fe0b39dc2b9
Reviewed-on: https://cl.snix.dev/c/snix/+/30604
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-07-28 21:37:42 +00:00
Jade Lovelace
be68d89901 fix(ops/gerrit): send mail with the triggering user's name on it
We found this bug in Lix's config and noticed Snix had the same bug; see
4b9e84fa0a
and b47965fe8f.

Change-Id: I65b14839a62c4e779136c1c34750d15cedaaddc8
Reviewed-on: https://cl.snix.dev/c/snix/+/30605
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-07-28 20:34:03 +00:00
Florian Klink
afec95e269 doc(README): clarify license situation
Also, drop the top-level MIT license file. With this repository
containing mostly Snix, it's confusing.

Change-Id: I1215cf05f6f65b399ff7e8566d425b848fe9ccb0
Reviewed-on: https://cl.snix.dev/c/snix/+/30600
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
Tested-by: besadii
2025-07-07 16:40:46 +00:00
Florian Klink
099f14194b doc(README): point to website once more
There's no point in replicating redundant information in many different
places. Add some more pointers and encouragement to read the docs where
they live.

Change-Id: I449101cfda7c8a728d3e2f3be71dee00be780ec3
Reviewed-on: https://cl.snix.dev/c/snix/+/30599
Tested-by: besadii
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
Autosubmit: Florian Klink <flokli@flokli.de>
2025-07-07 16:40:46 +00:00
Vova Kryachko
9942014989 fix(build/oci): Propagate passAsFile files into the build sandbox.
fixes #87

Change-Id: Ia8109ae678bddb1072e15f6a3ed63e3e3c862b6a
Reviewed-on: https://cl.snix.dev/c/snix/+/30238
Autosubmit: Vova Kryachko <v.kryachko@gmail.com>
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Yureka <snix@yuka.dev>
2025-07-05 14:45:00 +00:00
Starnick4444
e8642518f8 chore(nix-compat): upgrade to 2024 edition
Part of #114
The lock at `nix-compat/src/nix_daemon/handler.rs:186` gets released later, but
this doesnt seem to change behavior.

Change-Id: If871a090791740d98bca7a043e86af6a9b0c5463
Reviewed-on: https://cl.snix.dev/c/snix/+/30590
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-07-04 18:23:42 +00:00
Starnick4444
f242bc6df8 chore(contrib): upgrade to 2024 edition
Part of #114
This edition change doesn't affect these crates except for formatting.

Change-Id: I441c967b6803f1f839379c2ec13dee3f0958fb05
Reviewed-on: https://cl.snix.dev/c/snix/+/30593
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-07-04 18:19:41 +00:00
Starnick4444
d829261a09 chore(nix-daemon): upgrade to 2024 edition
Part of #114
This edition change doesn't affect this crate except for formatting.

Change-Id: I8e2650f6de776658a14ee5a11bc7a63ad57fae89
Reviewed-on: https://cl.snix.dev/c/snix/+/30591
Reviewed-by: Florian Klink <flokli@flokli.de>
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
2025-07-04 17:17:35 +00:00
Starnick4444
5602582a9e chore(ops): upgrade to 2024 edition
Part of #114

Change-Id: I2aea31c745af5de71e3a6c153e55aae3457c87e5
Reviewed-on: https://cl.snix.dev/c/snix/+/30594
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
2025-07-04 17:15:04 +00:00
Domen Kožar
ba0a01e7aa fix(eval): avoid stat calls in builtins.readDir
Use entry.file_type() instead of entry.metadata().file_type() to avoid
unnecessary stat syscalls. The file_type() method uses the cached d_type
field from the readdir() syscall when available, eliminating the need
for additional filesystem access.

This matches the behavior described in https://github.com/NixOS/nix/pull/13412
where readDir should only read directory entries without stat'ing each file.

Change-Id: I8983f84a7cff28b2c892d5829b9880ed22be4389
Reviewed-on: https://cl.snix.dev/c/snix/+/30596
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-07-04 16:41:14 +00:00
Starnick4444
e9073eeddd chore(nar-bridge): upgrade to 2024 edition
Part of #114
This edition change doesn't affect this crate except for formatting.

Change-Id: Ia7adca8a62e3cb7cbc1187c539907be45a05ab4b
Reviewed-on: https://cl.snix.dev/c/snix/+/30589
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
2025-07-01 09:04:27 +00:00
Vova Kryachko
33cd666f5c feat(glue): Implement hashed_mirrors download logic for fetchurl.
This is useful for the cases when original urls no longer exist, but nixpkgs still references them.

Change-Id: Ibfbb6784876efe4fc8f65fac84ff9dcb72e78ff7
Reviewed-on: https://cl.snix.dev/c/snix/+/30570
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
Autosubmit: Vova Kryachko <v.kryachko@gmail.com>
2025-06-30 14:06:23 +00:00
Florian Klink
3c1a7176cb feat(snix/eval): proper error handling for invalid regexes
We don't want to crash the evaluator when an invalid regex is passed,
but instead display a user-facing error message. This CL does that.

Change-Id: I81fd8e342fc877344f8d2a3704ef53caf5190aa3
Reviewed-on: https://cl.snix.dev/c/snix/+/30588
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
Tested-by: besadii
Reviewed-by: Bence Nemes <nemes.bence1@gmail.com>
2025-06-30 13:50:12 +00:00
Vincent Ambo
4de1129acb refactor(snix/eval): cache regexes for builtins
Some analysing what is going on in nixpkgs revealed that we recompiled the same
regexes many times, and there aren't that many different regexes anyways.

This was actually visible in flamegraphs, now it's not anymore.

Fixes https://git.snix.dev/snix/snix/issues/151

Change-Id: Ia04b1833fec083017aebac99cdae7e91148966c4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13464
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
(cherry picked from commit aa1eca36c3b3c18d96ba3081d7053b4c639e2f17)
Reviewed-on: https://cl.snix.dev/c/snix/+/30587
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
Reviewed-by: Bence Nemes <nemes.bence1@gmail.com>
2025-06-29 19:59:19 +00:00
Florian Klink
51fc9948cf fix(snix/store/redb): no blocking IO in list() without spawn_blocking
All these functions do blocking IO, and don't yield back to the
executor, so we cannot invoke them directly, but have to use
spawn_blocking and a channel.

Instead of plainly reverting cl/30575, this keeps potential errors being
sent as the last element of the stream.

We need to make our error construction a bit more ergonomic, potentially
allow them to wrap other errors instead of the madness this currently
is, but this is something for a later CL.

Change-Id: Ifb05871741813a389ac00b4f2c468f984a689a18
Reviewed-on: https://cl.snix.dev/c/snix/+/30586
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
Tested-by: besadii
2025-06-29 15:35:18 +00:00
Florian Klink
ae2af10cf8 fix(castore/fs): enter the runtime context before blocking on tasks
fuse-backend-rs spawns multiple threads, but these don't automatically
inherit the tokio runtime context.

Spawning tasks from "the wrong thread" would then cause a panic, as seen
in https://git.snix.dev/snix/snix/issues/147.

However, cl/30575 didn't really fix this, it only removed one place
spawning tasks, without fixing the underlying issue.

PathInfoService / BlobService / DirectoryService are expected to spawn
tasks. We need to simply invoke `.enter()` from all worker threads, and
that's what this CL does.

An alternative would be to manually (re)-enter inside every function of
the FileSystem trait, but that'd be very messy.

A similar fix needs to end up in the virtiofs implementation, but we
don't have control over the (single) thread being spawned by
VhostUserDaemon there, so cannot just enter the runtime context there,
so virtiofs will stay broken for now.

Maybe it's time to re-architect this a bit - have our FileSystem impl
be little code and call to sync endpoints to do the actual work, which
is then handled by workers on another thread - but that's left for
another CL.

Change-Id: I58cdbd952f4ecc39bdc2f2fa69a788caa0cc78ba
Reviewed-on: https://cl.snix.dev/c/snix/+/30585
Tested-by: besadii
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
2025-06-29 15:35:18 +00:00
Florian Klink
95fd048e00 fix(castore/fs): fix names
This is snix-castore, not snix-store.

Change-Id: I4c77adbc8c0c7c450075231ae4ef03ddfa0ea81c
Reviewed-on: https://cl.snix.dev/c/snix/+/30584
Tested-by: besadii
Reviewed-by: Vova Kryachko <v.kryachko@gmail.com>
2025-06-29 15:18:50 +00:00
Florian Klink
fcd43e8bc8 refactor(ops/gerrit-webhook-to-irccat): use streams data types
The types are different for `gerrit stream-events` and webhooks, so
switch to a fork of go-gerrit containing their definitions.

https://github.com/andygrunwald/go-gerrit/pull/189 is the upstream PR.
Change-Id: I24136af2f2cf5655f2a8278632a3b0f52aa6adcc
Reviewed-on: https://cl.snix.dev/c/snix/+/30544
Autosubmit: Florian Klink <flokli@flokli.de>
Tested-by: besadii
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2025-06-29 14:05:48 +00:00