forked from nrabulinski/attic
Work around https://github.com/NixOS/nix/pull/8484
Let's work around it downstream while we wait for a release. Fixes #56.
This commit is contained in:
parent
5ca98fbaa8
commit
71a5580d17
|
@ -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" ]
|
||||
|
|
|
@ -9,12 +9,23 @@ fn main() {
|
|||
|
||||
#[cfg(feature = "nix_store")]
|
||||
fn build_bridge() {
|
||||
// Temporary workaround for issue in <https://github.com/NixOS/nix/pull/8484>
|
||||
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");
|
||||
|
|
Loading…
Reference in a new issue