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

tidy: remove filtering for wasm32 deps, as this don't work #113449

Closed
wants to merge 1 commit into from

Conversation

klensy
Copy link
Contributor

@klensy klensy commented Jul 7, 2023

This was added in #106470, from that time something changed and now it don't work as expected.

@rustbot
Copy link
Collaborator

rustbot commented Jul 7, 2023

r? @ozkanonur

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 7, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jul 7, 2023

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@klensy klensy marked this pull request as draft July 7, 2023 17:05
Comment on lines -514 to -633
!target.matches(
"wasm32-unknown-unknown",
&[
Cfg::from_str("target_arch=\"wasm32\"").unwrap(),
Cfg::from_str("target_os=\"unknown\"").unwrap(),
],
)
Copy link
Contributor Author

@klensy klensy Jul 7, 2023

Choose a reason for hiding this comment

The 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:

  1. cfg(not(windows)) matches cfg(target_arch="wasm32") (matches currently): which can be understand as: if X can be Y? But cfg(not(windows)) for example can be x86_64-unknown-linux-gnu which actually not matches cfg(target_arch="wasm32").
  2. If X has cfgs which is Y? cfg(all(target_arch="wasm32",target_os="unknown")) matches cfg(target_arch="wasm32") because target_arch is "wasm32".

But 2. can be broken again if cfg(any(target_arch="wasm32", target_arch="x86_64")) matched against cfg(target_arch="wasm32"), as it can be x86_64-unknown-linux-gnu again, which is not cfg(target_arch="wasm32").

Copy link
Contributor Author

@klensy klensy Jul 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, looks like this don't work as i expected:
Name("wasm32-wasi").matches("", &[Cfg::from_str("target_arch=\"wasm32\"").unwrap(),]) == false, while should return true (ignore part that Platform::matches checks target or cfg).
cargo_platform works on strings and don't know to parse triples or if one cfg turn on other cfgs (for example target_env="msvc" should enable target_os="windows").

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The 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.

@Dylan-DPC
Copy link
Member

@klensy i assume this is ready for review? can you mark it as ready for review {which will no longer keep it as a draft}

@klensy
Copy link
Contributor Author

klensy commented Aug 18, 2023

@klensy i assume this is ready for review? can you mark it as ready for review {which will no longer keep it as a draft}

While technically it's ready, i'm tried to get some discussion how cargo-platoform should work (in this case).

@onur-ozkan
Copy link
Member

While technically it's ready, i'm tried to get some discussion how cargo-platoform should work (in this case).

I ignore the PR completely since it appears to be in draft. Will review it in couple of days.

@bors
Copy link
Contributor

bors commented Oct 7, 2023

☔ The latest upstream changes (presumably #116508) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC
Copy link
Member

@klensy does this still need to be a draft? looks like it is waiting for review which generally means the pr is ready for review :P

@onur-ozkan
Copy link
Member

@klensy does this still need to be a draft? looks like it is waiting for review which generally means the pr is ready for review :P

I left a review note at #113449 (comment)

@bors
Copy link
Contributor

bors commented Feb 5, 2024

☔ The latest upstream changes (presumably #117372) made this pull request unmergeable. Please resolve the merge conflicts.

@onur-ozkan
Copy link
Member

@rustbot author (due to #113449 (comment) and conflicts)

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 29, 2024
@klensy
Copy link
Contributor Author

klensy commented Apr 11, 2024

will be removed in #123788

@klensy klensy closed this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants