Skip to content

Migrate libc-test to edition 2018 #3718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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.155"
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 @@ -95,8 +95,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 @@ -106,7 +105,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 @@ -154,6 +156,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