mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-06-09 06:35:19 +02:00
These changes have not yet been tested in an actual cross environment but since the build system respects Cargo environment variables, this should hopefully work. Bump the revision of this ebuild because the build now honors LDFLAGS among other RUSTFLAGS set in cargo_env in the cargo eclass. Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
40 lines
1.5 KiB
Diff
40 lines
1.5 KiB
Diff
Fix the output path for Rust binaries in the Ninja file to match
|
|
Cargo's target directory when CARGO_BUILD_TARGET is set. This prevents
|
|
file-not-found errors for some build steps.
|
|
|
|
Provide the cargo-nextest binary ourselves to prevent network access.
|
|
Set test runner options in the ebuild.
|
|
|
|
From: Lucio Sauer <watermanpaint@posteo.net>
|
|
--- a/build/ninja_gen/src/cargo.rs
|
|
+++ b/build/ninja_gen/src/cargo.rs
|
|
@@ -61,6 +61,9 @@ impl RustOutput<'_> {
|
|
let mut path: Utf8PathBuf = rust_base.into();
|
|
if let Some(target) = target {
|
|
path = path.join(target);
|
|
+ } else {
|
|
+ let triple = std::env::var("CARGO_BUILD_TARGET").unwrap_or_default();
|
|
+ path = path.join(triple);
|
|
}
|
|
path = path.join(profile_output_dir(build_profile)).join(filename);
|
|
path.to_string()
|
|
@@ -152,19 +155,11 @@ impl BuildAction for CargoTest {
|
|
|
|
fn files(&mut self, build: &mut impl FilesHandle) {
|
|
build.add_inputs("", &self.inputs);
|
|
- build.add_inputs("", inputs![":cargo-nextest"]);
|
|
build.add_env_var("ANKI_TEST_MODE", "1");
|
|
build.add_output_stamp("tests/cargo_test");
|
|
}
|
|
|
|
fn on_first_instance(&self, build: &mut Build) -> Result<()> {
|
|
- build.add_action(
|
|
- "cargo-nextest",
|
|
- CargoInstall {
|
|
- binary_name: "cargo-nextest",
|
|
- args: "cargo-nextest --version 0.9.57 --locked",
|
|
- },
|
|
- )?;
|
|
setup_flags(build)
|
|
}
|
|
}
|