Skip to content

Commit

Permalink
tidy: remove filtering for wasm32 deps, as this don't work now
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Nov 4, 2023
1 parent 2db26d3 commit a94bd38
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
1 change: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5453,7 +5453,6 @@ dependencies = [
name = "tidy"
version = "0.1.0"
dependencies = [
"cargo-platform",
"cargo_metadata 0.15.4",
"ignore",
"lazy_static",
Expand Down
1 change: 0 additions & 1 deletion src/tools/tidy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ autobins = false

[dependencies]
cargo_metadata = "0.15"
cargo-platform = "0.1.2"
regex = "1"
miropt-test-tools = { path = "../miropt-test-tools" }
lazy_static = "1"
Expand Down
24 changes: 3 additions & 21 deletions src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ const PERMITTED_DEPS_LOCATION: &str = concat!(file!(), ":", line!());
/// rustc. Please check with the compiler team before adding an entry.
const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
// tidy-alphabetical-start
"addr2line",
"adler",
"ahash",
"aho-corasick",
Expand Down Expand Up @@ -429,6 +430,7 @@ const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[
"mach",
"memchr",
"object",
"once_cell",
"regalloc2",
"region",
"rustc-hash",
Expand Down Expand Up @@ -614,27 +616,7 @@ fn check_permitted_dependencies(
let mut deps = HashSet::new();
for to_check in restricted_dependency_crates {
let to_check = pkg_from_name(metadata, to_check);
use cargo_platform::Cfg;
use std::str::FromStr;
// We don't expect the compiler to ever run on wasm32, so strip
// out those dependencies to avoid polluting the permitted list.
deps_of_filtered(metadata, &to_check.id, &mut deps, &|dep_kinds| {
dep_kinds.iter().any(|dep_kind| {
dep_kind
.target
.as_ref()
.map(|target| {
!target.matches(
"wasm32-unknown-unknown",
&[
Cfg::from_str("target_arch=\"wasm32\"").unwrap(),
Cfg::from_str("target_os=\"unknown\"").unwrap(),
],
)
})
.unwrap_or(true)
})
});
deps_of_filtered(metadata, &to_check.id, &mut deps, &|_| true);
}

// Check that the PERMITTED_DEPENDENCIES does not have unused entries.
Expand Down

0 comments on commit a94bd38

Please sign in to comment.