Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Migrate libc-test to 2018 edition
edition: cannot update to 2021 edition because of libc msrv.
cargo of rust 1.19 cannot understand edition key in cargo.toml.

(cherry picked from commit 4057a9a)

avoid rebuilding libc-test

no semver vendor = 'unknown'

(cherry picked from commit de2c8a7)

use rel path for semver

(cherry picked from commit d6d56f1)

(apply <#3718> to `main`)
[ resolve conflicts, squash for easier cherry-picks - Trevor ]
  • Loading branch information
tesuji authored and tgross35 committed Aug 29, 2024
commit 8258589365758c8c3ddbf5726fb5db8e7a86dc2d
1 change: 1 addition & 0 deletions libc-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "libc-test"
version = "0.2.151"
edition = "2018"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
build = "build.rs"
Expand Down
11 changes: 8 additions & 3 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ fn do_semver() {
let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();

// `libc-test/semver` dir.
let mut semver_root = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
semver_root.push("semver");
let mut semver_root = PathBuf::from("semver");

// NOTE: Windows has the same `family` as `os`, no point in including it
// twice.
Expand All @@ -93,7 +92,10 @@ fn do_semver() {
if family != os && os != "android" {
process_semver_file(&mut output, &mut semver_root, &family);
}
process_semver_file(&mut output, &mut semver_root, &vendor);
// We don't do semver for unknown targets.
if vendor != "unknown" {
process_semver_file(&mut output, &mut semver_root, &vendor);
}
process_semver_file(&mut output, &mut semver_root, &os);
let os_arch = format!("{}-{}", os, arch);
process_semver_file(&mut output, &mut semver_root, &os_arch);
Expand Down Expand Up @@ -141,6 +143,9 @@ fn process_semver_file<W: Write, P: AsRef<Path>>(output: &mut W, path: &mut Path
}

fn main() {
// Avoid unnecessary re-building.
println!("cargo:rerun-if-changed=build.rs");

do_cc();
do_ctest();
do_semver();
Expand Down