buildRustCrateTests: add regression test for #74071
This commit is contained in:
parent
7562c2112d
commit
19698d15ce
@ -199,6 +199,27 @@ let
|
||||
})
|
||||
];
|
||||
};
|
||||
# Regression test for https://github.com/NixOS/nixpkgs/issues/74071
|
||||
# Whenevever a build.rs file is generating files those should not be overlayed onto the actual source dir
|
||||
buildRsOutDirOverlay = {
|
||||
src = symlinkJoin {
|
||||
name = "buildrs-out-dir-overlay";
|
||||
paths = [
|
||||
(mkLib "src/lib.rs")
|
||||
(mkFile "build.rs" ''
|
||||
use std::env;
|
||||
use std::ffi::OsString;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
fn main() {
|
||||
let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR not set");
|
||||
let out_file = Path::new(&out_dir).join("lib.rs");
|
||||
fs::write(out_file, "invalid rust code!").expect("failed to write lib.rs");
|
||||
}
|
||||
'')
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
brotliCrates = (callPackage ./brotli-crates.nix {});
|
||||
in lib.mapAttrs (key: value: mkTest (value // lib.optionalAttrs (!value?crateName) { crateName = key; })) cases // {
|
||||
|
Loading…
x
Reference in New Issue
Block a user