diff --git a/attic/Cargo.toml b/attic/Cargo.toml index 1e40df7..1f23e18 100644 --- a/attic/Cargo.toml +++ b/attic/Cargo.toml @@ -45,6 +45,7 @@ tokio-test = "0.4.2" [build-dependencies] cxx-build = { version = "1.0", optional = true } pkg-config = "0.3.27" +tempfile = "3" [features] default = [ "nix_store", "tokio" ] diff --git a/attic/build.rs b/attic/build.rs index bb05a0a..75841a2 100644 --- a/attic/build.rs +++ b/attic/build.rs @@ -9,12 +9,23 @@ fn main() { #[cfg(feature = "nix_store")] fn build_bridge() { + // Temporary workaround for issue in + let hacky_include = { + let dir = tempfile::tempdir() + .expect("Failed to create temporary directory for workaround"); + std::fs::write(dir.path().join("uds-remote-store.md"), "\"\"") + .unwrap(); + dir + }; + cxx_build::bridge("src/nix_store/bindings/mod.rs") .file("src/nix_store/bindings/nix.cpp") .flag("-std=c++17") .flag("-O2") .flag("-include") .flag("nix/config.h") + .flag("-idirafter") + .flag(hacky_include.path().to_str().unwrap()) .compile("nixbinding"); println!("cargo:rerun-if-changed=src/nix_store/bindings");