about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-10-13T15·02+0300
committerclbot <clbot@tvl.fyi>2024-10-13T16·23+0000
commit15b5bf2003df5fd4a62e47c7ca1f4efbbb5d87cc (patch)
tree1963bc23b2b271629afed13f8e9455f51acf2ba4 /tvix
parent4beee4cba79efda4145e84c12ecbc876f39f2134 (diff)
refactor(tvix/build): remove use of lazy_static r/8804
This is now supported in the standard library via std::sync::LazyLock,
but requires some manual shuffling around of code.

Change-Id: Ie2af74beda9fcf8aa19fca7d844bcbe732f05bf8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12610
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix')
-rw-r--r--tvix/Cargo.lock1
-rw-r--r--tvix/Cargo.nix4
-rw-r--r--tvix/build/Cargo.toml1
-rw-r--r--tvix/build/src/buildservice/from_addr.rs8
4 files changed, 2 insertions, 12 deletions
diff --git a/tvix/Cargo.lock b/tvix/Cargo.lock
index d57bc04314c4..d713c2350b6f 100644
--- a/tvix/Cargo.lock
+++ b/tvix/Cargo.lock
@@ -4544,7 +4544,6 @@ dependencies = [
  "data-encoding",
  "futures",
  "itertools 0.12.1",
- "lazy_static",
  "mimalloc",
  "oci-spec",
  "prost",
diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix
index ed955fa56dd6..8cedc2de7fd6 100644
--- a/tvix/Cargo.nix
+++ b/tvix/Cargo.nix
@@ -15098,10 +15098,6 @@ rec {
         ];
         devDependencies = [
           {
-            name = "lazy_static";
-            packageId = "lazy_static";
-          }
-          {
             name = "rstest";
             packageId = "rstest";
           }
diff --git a/tvix/build/Cargo.toml b/tvix/build/Cargo.toml
index d91455252c88..86f3fe4ac1f8 100644
--- a/tvix/build/Cargo.toml
+++ b/tvix/build/Cargo.toml
@@ -39,7 +39,6 @@ tonic-reflection = ["dep:tonic-reflection", "tvix-castore/tonic-reflection"]
 
 [dev-dependencies]
 rstest = { workspace = true }
-lazy_static = "1.4.0"
 tempfile = "3.3.0"
 
 [lints]
diff --git a/tvix/build/src/buildservice/from_addr.rs b/tvix/build/src/buildservice/from_addr.rs
index a7afba1138af..0f4c190c2aca 100644
--- a/tvix/build/src/buildservice/from_addr.rs
+++ b/tvix/build/src/buildservice/from_addr.rs
@@ -66,20 +66,16 @@ where
 
 #[cfg(test)]
 mod tests {
-    use std::sync::Arc;
-
     use super::from_addr;
-    use lazy_static::lazy_static;
     use rstest::rstest;
+    use std::sync::{Arc, LazyLock};
     use tempfile::TempDir;
     use tvix_castore::{
         blobservice::{BlobService, MemoryBlobService},
         directoryservice::{DirectoryService, MemoryDirectoryService},
     };
 
-    lazy_static! {
-        static ref TMPDIR_OCI_1: TempDir = TempDir::new().unwrap();
-    }
+    static TMPDIR_OCI_1: LazyLock<TempDir> = LazyLock::new(|| TempDir::new().unwrap());
 
     #[rstest]
     /// This uses an unsupported scheme.