-
Notifications
You must be signed in to change notification settings - Fork 13.4k
tidy: remove filtering for wasm32 deps, as this don't work #113449
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
|
@@ -429,6 +430,7 @@ const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[ | |
"mach", | ||
"memchr", | ||
"object", | ||
"once_cell", | ||
"regalloc2", | ||
"region", | ||
"rustc-hash", | ||
|
@@ -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(), | ||
], | ||
) | ||
Comment on lines
-627
to
-633
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know why, but one of suspects is https://docs.rs/cargo-platform/0.1.2/cargo_platform/enum.Platform.html#method.matches It says "Returns whether the Platform matches the given target and cfg.", but what means "matches"? Lets skip target part and look at cfg. There can be 2 situations:
But 2. can be broken again if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, looks like this don't work as i expected: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comments are messy (for me too, in month later), so, please ask question questions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should try to make this work instead of getting rid of it entirely. If we really want to remove it, we can revert the changes that were made, but I don't believe this is the best solution for this situation. |
||
}) | ||
.unwrap_or(true) | ||
}) | ||
}); | ||
deps_of_filtered(metadata, &to_check.id, &mut deps, &|_| true); | ||
} | ||
|
||
// Check that the PERMITTED_DEPENDENCIES does not have unused entries. | ||
|
Uh oh!
There was an error while loading. Please reload this page.