diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 6d17907b6..ca28d690e 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -24,6 +24,3 @@ c758de9d22506eb279c5abe61f621e5c8f61af95 # style: format entire depot with nixpkgs-fmt aa122cbae78ce97d60c0c98ba14df753d97e40b1 - -# style: Switch to nixfmt from nixpkgs-fmt -91d02d8c845d4ffbeefc7d99ef36b2234d87813b diff --git a/ops/machines/snix-cache/default.nix b/ops/machines/snix-cache/default.nix index 6dfbf8511..2cbf0f4e4 100644 --- a/ops/machines/snix-cache/default.nix +++ b/ops/machines/snix-cache/default.nix @@ -49,7 +49,6 @@ in nixpkgs.hostPlatform = lib.mkForce "x86_64-linux"; - # kept as-is because we don't want to relabel historical metrics networking.hostName = "tvix-cache"; systemd.network.networks."10-uplink".networkConfig.Address = "2a01:4f9:3071:1091::2/64"; diff --git a/ops/nixos.nix b/ops/nixos.nix index 59946c4b7..b0b79fb3c 100644 --- a/ops/nixos.nix +++ b/ops/nixos.nix @@ -53,19 +53,18 @@ rec { ) (throw "${hostname} is not a known NixOS host") (map nixosFor depot.ops.machines.all-systems)); # Systems that should be built in CI - archivistEC2System = (nixosFor depot.ops.machines.archivist-ec2).system; - build01System = (nixosFor depot.ops.machines.build01).system; - gerrit01System = (nixosFor depot.ops.machines.gerrit01).system; - meta01System = (nixosFor depot.ops.machines.meta01).system; - public01System = (nixosFor depot.ops.machines.public01).system; - snixCacheSystem = (nixosFor depot.ops.machines.snix-cache).system; + archivistEC2System = nixosFor depot.ops.machines.archivist-ec2; + gerrit01System = nixosFor depot.ops.machines.gerrit01; + public01System = nixosFor depot.ops.machines.public01; + build01System = nixosFor depot.ops.machines.build01; + meta01System = nixosFor depot.ops.machines.meta01; + nixosSnixCacheSystem = nixosFor depot.ops.machines.snix-cache; meta.ci.targets = [ "archivistEC2System" - "build01System" "gerrit01System" - "meta01System" "public01System" - "snixCacheSystem" + "build01System" + "meta01System" ]; } diff --git a/snix/Cargo.lock b/snix/Cargo.lock index fe05a289d..b74188c27 100644 --- a/snix/Cargo.lock +++ b/snix/Cargo.lock @@ -3473,9 +3473,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.6.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b38b05028f398f08bea4691640503ec25fcb60b82fb61ce1f8fd1f4fccd3f7" +checksum = "ea0a72cd7140de9fc3e318823b883abf819c20d478ec89ce880466dc2ef263c6" dependencies = [ "libc", "log", diff --git a/snix/Cargo.nix b/snix/Cargo.nix index 847b57a4b..c63f15040 100644 --- a/snix/Cargo.nix +++ b/snix/Cargo.nix @@ -14092,9 +14092,9 @@ rec { }; "redb" = rec { crateName = "redb"; - version = "2.6.2"; - edition = "2024"; - sha256 = "1xykri7izzgqw4fbcbxqc35mzhiya101csd4pq48yfcg082qpcsr"; + version = "2.4.0"; + edition = "2021"; + sha256 = "1ik3y8pdqrh4i378kv3qshh9r0dz7a43p0hqwg1rzpj0f76p42pa"; type = [ "cdylib" "rlib" diff --git a/snix/Cargo.toml b/snix/Cargo.toml index ab2627357..465e384e7 100644 --- a/snix/Cargo.toml +++ b/snix/Cargo.toml @@ -100,7 +100,7 @@ proptest = { version = "1.5.0", default-features = false } prost = "0.13.1" prost-build = "0.13.1" quote = "1.0.37" -redb = "2.6.2" +redb = "2.1.2" regex = "1.10.6" reqwest = { version = "0.12.7", default-features = false } reqwest-middleware = { version = "0.4.1", default-features = false } diff --git a/snix/boot/tests/default.nix b/snix/boot/tests/default.nix index a3c8c9ec9..c031b2f08 100644 --- a/snix/boot/tests/default.nix +++ b/snix/boot/tests/default.nix @@ -120,7 +120,7 @@ let } # Upload all NAR files (with some parallelism). - # As mkBinaryCache produces them zstd-compressed, unpack them on the fly. + # As mkBinaryCache produces them xz-compressed, unpack them on the fly. # nar-bridge doesn't care about the path we upload *to*, but a # subsequent .narinfo upload need to refer to its contents (by narhash). echo -e "Uploading NARs… " diff --git a/snix/castore/src/directoryservice/redb.rs b/snix/castore/src/directoryservice/redb.rs index 973ac5f1a..2eaa0b515 100644 --- a/snix/castore/src/directoryservice/redb.rs +++ b/snix/castore/src/directoryservice/redb.rs @@ -3,7 +3,7 @@ use prost::Message; use redb::{Database, TableDefinition}; use std::{path::PathBuf, sync::Arc}; use tonic::async_trait; -use tracing::{info, instrument, warn}; +use tracing::{instrument, warn}; use super::{ Directory, DirectoryGraph, DirectoryPutter, DirectoryService, LeavesToRootValidator, @@ -41,15 +41,7 @@ impl RedbDirectoryService { } let db = tokio::task::spawn_blocking(|| -> Result<_, redb::Error> { - let mut db = redb::Database::builder() - .create_with_file_format_v3(true) - .create(path)?; - - // Upgrade redb database file format. - if db.upgrade()? { - info!("Upgraded database format"); - }; - + let db = redb::Database::create(path)?; create_schema(&db)?; Ok(db) }) @@ -63,9 +55,8 @@ impl RedbDirectoryService { /// Constructs a new instance using the in-memory backend. pub fn new_temporary() -> Result { - let db = redb::Database::builder() - .create_with_file_format_v3(true) - .create_with_backend(redb::backends::InMemoryBackend::new())?; + let db = + redb::Database::builder().create_with_backend(redb::backends::InMemoryBackend::new())?; create_schema(&db)?; diff --git a/snix/castore/src/errors.rs b/snix/castore/src/errors.rs index 282ce0097..84567fbc3 100644 --- a/snix/castore/src/errors.rs +++ b/snix/castore/src/errors.rs @@ -125,12 +125,6 @@ impl From for Error { } } -impl From for Error { - fn from(value: redb::UpgradeError) -> Self { - Error::StorageError(value.to_string()) - } -} - impl From for Error { fn from(value: std::io::Error) -> Self { if value.kind() == std::io::ErrorKind::InvalidInput { diff --git a/snix/eval/src/compiler/mod.rs b/snix/eval/src/compiler/mod.rs index db267ae17..0b978160b 100644 --- a/snix/eval/src/compiler/mod.rs +++ b/snix/eval/src/compiler/mod.rs @@ -906,15 +906,14 @@ impl Compiler<'_, '_> { /// Compile conditional expressions using jumping instructions in the VM. /// /// ```notrust - /// ┌─────────────────────┐ - /// │ 0 [ conditional ] │ - /// │ 1 JUMP_IF_CATCH →┼───┐ Jump over else body - /// │ 2 JUMP_IF_FALSE →┼─┐ │ if condition is catchable. - /// │ 3 [ main body ] │ │ ← Jump to else body if - /// ┌┼─4─← JUMP │ │ ← condition is false. - /// Jump over else body ││ 5 [ else body ] ←┼─┘ │ - /// if condition is true.└┼─6─→ ... ←┼───┘ - /// └─────────────────────┘ + /// ┌────────────────────┐ + /// │ 0 [ conditional ] │ + /// │ 1 JUMP_IF_FALSE →┼─┐ + /// │ 2 [ main body ] │ │ Jump to else body if + /// ┌┼─3─← JUMP │ │ condition is false. + /// Jump over else body ││ 4 [ else body ]←┼─┘ + /// if condition is true.└┼─5─→ ... │ + /// └────────────────────┘ /// ``` fn compile_if_else(&mut self, slot: LocalIdx, node: &ast::IfElse) { self.compile(slot, node.condition().unwrap()); diff --git a/snix/store/src/pathinfoservice/redb.rs b/snix/store/src/pathinfoservice/redb.rs index 3cd1adff9..851145817 100644 --- a/snix/store/src/pathinfoservice/redb.rs +++ b/snix/store/src/pathinfoservice/redb.rs @@ -11,7 +11,7 @@ use snix_castore::{ use std::{path::PathBuf, sync::Arc}; use tokio_stream::wrappers::ReceiverStream; use tonic::async_trait; -use tracing::{info, instrument, warn}; +use tracing::{instrument, warn}; const PATHINFO_TABLE: TableDefinition<[u8; 20], Vec> = TableDefinition::new("pathinfo"); @@ -40,15 +40,7 @@ impl RedbPathInfoService { } let db = tokio::task::spawn_blocking(|| -> Result<_, redb::Error> { - let mut db = redb::Database::builder() - .create_with_file_format_v3(true) - .create(path)?; - - // Upgrade redb database file format. - if db.upgrade()? { - info!("Upgraded database format"); - }; - + let db = redb::Database::create(path)?; create_schema(&db)?; Ok(db) }) @@ -62,9 +54,8 @@ impl RedbPathInfoService { /// Constructs a new instance using the in-memory backend. pub fn new_temporary(instance_name: String) -> Result { - let db = redb::Database::builder() - .create_with_file_format_v3(true) - .create_with_backend(redb::backends::InMemoryBackend::new())?; + let db = + redb::Database::builder().create_with_backend(redb::backends::InMemoryBackend::new())?; create_schema(&db)?; diff --git a/third_party/sources/sources.json b/third_party/sources/sources.json index 33669c3fa..8a0fdd8a1 100644 --- a/third_party/sources/sources.json +++ b/third_party/sources/sources.json @@ -87,7 +87,7 @@ "nix-gerrit": { "branch": "main", "repo": "https://git.lix.systems/the-distro/nix-gerrit.git", - "rev": "1fdef9c8c8c876f410b75b0c4220ad8221572ef8", + "rev": "b730594c169cf14dd9c258902d58e8bb7709501f", "type": "git" }, "nixpkgs": {