From 71a5580d17aa3ced0a446c5974dd9ca2f012f909 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Mon, 12 Jun 2023 18:52:16 -0600 Subject: [PATCH] Work around https://github.com/NixOS/nix/pull/8484 Let's work around it downstream while we wait for a release. Fixes #56. --- attic/Cargo.toml | 1 + attic/build.rs | 11 +++++++++++ 2 files changed, 12 insertions(+) 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");