Skip to content
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

Use makefile nightly in diplomat-coverage #5286

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions tools/make/diplomat-coverage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ rustdoc-types = "0.22"
serde_json = { workspace = true }
syn-inline-mod = "0.6.0"

[build-dependencies]
basic-toml = "0.1"
serde = { version = "1", features = ["derive"] }
27 changes: 27 additions & 0 deletions tools/make/diplomat-coverage/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

const TOML_STR: &str = include_str!("../../../Makefile.toml");

#[derive(serde::Deserialize)]
struct Outer {
env: Middle
}

#[derive(serde::Deserialize)]
struct Middle {
#[serde(rename = "PINNED_CI_NIGHTLY")]
pinned_ci_nightly: Inner,
}

#[derive(serde::Deserialize)]
struct Inner {
value: String,
}

fn main() {
let deserialized = basic_toml::from_str::<Outer>(TOML_STR).unwrap();
let nightly = deserialized.env.pinned_ci_nightly.value;
println!("cargo::rustc-env=ICU4X_DIPLOMAT_COVERAGE_NIGHTLY={nightly}");
}
4 changes: 2 additions & 2 deletions tools/make/diplomat-coverage/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ fn collect_public_types(krate: &str) -> impl Iterator<Item = (Vec<String>, ast::
if CRATES.get(krate).is_none() {
eprintln!("Parsing crate {krate}");
std::process::Command::new("rustup")
.args(["install", "nightly-2023-08-08"])
.args(["install", std::env!("ICU4X_DIPLOMAT_COVERAGE_NIGHTLY")])
.output()
.expect("failed to install nightly");
let output = std::process::Command::new("rustup")
.args([
"run",
"nightly-2023-08-08",
std::env!("ICU4X_DIPLOMAT_COVERAGE_NIGHTLY"),
"cargo",
"rustdoc",
"-Zsparse-registry",
Expand Down
Loading