Compare commits

..

No commits in common. "6b75eb0f2cda0343800c08d5d9fb470bdc5a0444" and "a27823acd5bc6bb5675c76a8709de0fca6be32cb" have entirely different histories.

12 changed files with 32 additions and 62 deletions

View file

@ -24,6 +24,3 @@ c758de9d22506eb279c5abe61f621e5c8f61af95
# style: format entire depot with nixpkgs-fmt
aa122cbae78ce97d60c0c98ba14df753d97e40b1
# style: Switch to nixfmt from nixpkgs-fmt
91d02d8c845d4ffbeefc7d99ef36b2234d87813b

View file

@ -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";

View file

@ -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"
];
}

4
snix/Cargo.lock generated
View file

@ -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",

View file

@ -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"

View file

@ -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 }

View file

@ -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 "

View file

@ -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<Self, Error> {
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)?;

View file

@ -125,12 +125,6 @@ impl From<redb::CommitError> for Error {
}
}
impl From<redb::UpgradeError> for Error {
fn from(value: redb::UpgradeError) -> Self {
Error::StorageError(value.to_string())
}
}
impl From<std::io::Error> for Error {
fn from(value: std::io::Error) -> Self {
if value.kind() == std::io::ErrorKind::InvalidInput {

View file

@ -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─→ ... ←┼───┘
/// └─────────────────────┘
/// │ 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());

View file

@ -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<u8>> = 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<Self, Error> {
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)?;

View file

@ -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": {