mirror of
https://github.com/nix-community/naersk
synced 2025-02-16 19:28:23 +00:00
Add reproduction for workspace build.rs failure
This commit is contained in:
parent
11ac47b4cc
commit
65e8bba46a
6 changed files with 39 additions and 0 deletions
2
test.nix
2
test.nix
|
@ -139,6 +139,8 @@ rec
|
|||
doDoc = true;
|
||||
};
|
||||
|
||||
workspace-build-rs = naersk.buildPackage ./test/workspace-build-rs;
|
||||
|
||||
# Fails with some remarshal error
|
||||
#servo = naersk.buildPackage
|
||||
#sources.servo
|
||||
|
|
6
test/workspace-build-rs/Cargo.lock
generated
Normal file
6
test/workspace-build-rs/Cargo.lock
generated
Normal file
|
@ -0,0 +1,6 @@
|
|||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "hello-from-generated-code"
|
||||
version = "0.1.0"
|
||||
|
2
test/workspace-build-rs/Cargo.toml
Normal file
2
test/workspace-build-rs/Cargo.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
[workspace]
|
||||
members = [ "crate-a" ]
|
6
test/workspace-build-rs/crate-a/Cargo.toml
Normal file
6
test/workspace-build-rs/crate-a/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Cargo.toml
|
||||
# adapted from https://doc.rust-lang.org/cargo/reference/build-script-examples.html
|
||||
|
||||
[package]
|
||||
name = "hello-from-generated-code"
|
||||
version = "0.1.0"
|
16
test/workspace-build-rs/crate-a/build.rs
Normal file
16
test/workspace-build-rs/crate-a/build.rs
Normal file
|
@ -0,0 +1,16 @@
|
|||
use std::env;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
let out_dir = env::var_os("OUT_DIR").unwrap();
|
||||
let dest_path = Path::new(&out_dir).join("hello.rs");
|
||||
fs::write(
|
||||
&dest_path,
|
||||
"pub fn message() -> &'static str {
|
||||
\"Hello, World!\"
|
||||
}
|
||||
"
|
||||
).unwrap();
|
||||
println!("cargo:rerun-if-changed=build.rs");
|
||||
}
|
7
test/workspace-build-rs/crate-a/src/main.rs
Normal file
7
test/workspace-build-rs/crate-a/src/main.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// src/main.rs
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/hello.rs"));
|
||||
|
||||
fn main() {
|
||||
println!("{}", message());
|
||||
}
|
Loading…
Add table
Reference in a new issue