From 32161d8078f4617747fb980e4e7c0c2d5e4ccf49 Mon Sep 17 00:00:00 2001 From: MasterPtato Date: Wed, 20 Nov 2024 18:54:35 +0000 Subject: [PATCH] fix: add fdb to shell nix --- .../client/isolate-v8-runner/src/isolate.rs | 2 +- packages/infra/client/manager/tests/common.rs | 2 +- shell.nix | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/infra/client/isolate-v8-runner/src/isolate.rs b/packages/infra/client/isolate-v8-runner/src/isolate.rs index b9d3b46772..3adad2bb2c 100644 --- a/packages/infra/client/isolate-v8-runner/src/isolate.rs +++ b/packages/infra/client/isolate-v8-runner/src/isolate.rs @@ -21,7 +21,7 @@ use nix::{libc, unistd::pipe}; use tokio::{fs, sync::watch}; use uuid::Uuid; -use crate::{config::Config, utils, log_shipper}; +use crate::{config::Config, log_shipper, utils}; pub fn run(actors_path: PathBuf, actor_id: Uuid, stop_rx: watch::Receiver<()>) -> Result<()> { let actor_path = actors_path.join(actor_id.to_string()); diff --git a/packages/infra/client/manager/tests/common.rs b/packages/infra/client/manager/tests/common.rs index 8c2f877115..72aa4d03a4 100644 --- a/packages/infra/client/manager/tests/common.rs +++ b/packages/infra/client/manager/tests/common.rs @@ -2,11 +2,11 @@ use std::{ convert::Infallible, net::SocketAddr, path::{Path, PathBuf}, - time::Duration, sync::{ atomic::{AtomicBool, Ordering}, Arc, Once, }, + time::Duration, }; use anyhow::Context; diff --git a/shell.nix b/shell.nix index da5c8c6295..f5fefa77b0 100644 --- a/shell.nix +++ b/shell.nix @@ -8,6 +8,11 @@ let pkgs = import (fetchTarball { url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/23.05.tar.gz"; }) { overlays = [ moz_overlay ]; }; + + foundationDbShellHook = '' + # Set LIBCLANG_PATH to point directly to the library + export LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib" + ''; in pkgs.mkShell { name = "rivet"; @@ -40,10 +45,13 @@ in # Utilities netcat + # FoundationDB + llvmPackages.libclang + fdbPackages.foundationdb71 + # Fixes "cannot change locale" warning glibcLocales ] - ++ extraInputs ++ ( pkgs.lib.optionals stdenv.isDarwin [ libiconv # See https://stackoverflow.com/a/69732679 @@ -60,12 +68,14 @@ in # Install autocomplete source ${pkgs.bash-completion}/share/bash-completion/bash_completion - # Fix dynamic library path to fix issue with Python - export LD_LIBRARY_PATH="${pkgs.clang}/resource-root/lib:${pkgs.lib.strings.makeLibraryPath [ pkgs.openssl ]}" + # Fix dynamic library path to fix issue with Python and FoundationDB + export LD_LIBRARY_PATH="${pkgs.clang}/resource-root/lib:${pkgs.lib.strings.makeLibraryPath [ pkgs.openssl ]}:${pkgs.lib.strings.makeLibraryPath [ pkgs.fdbPackages.foundationdb71 ]}" # Set default Rust flags to match the Rust flags used inside of Bolt. # # If these don't match, then the build cache is purged any time Rust is ran from Bolt. export RUSTFLAGS="--cfg tokio_unstable" + + ${foundationDbShellHook} ''; }