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

Introduce perma-unstable wasm-c-abi flag #117919

Merged
merged 2 commits into from Apr 19, 2024
Merged

Conversation

daxpedda
Copy link
Contributor

@daxpedda daxpedda commented Nov 14, 2023

Now that wasm-bindgen v0.2.88 supports the spec-compliant C ABI, the idea is to switch to that in a future version of Rust. In the meantime it would be good to let people test and play around with it.

This PR introduces a new perma-unstable -Zwasm-c-abi compiler flag, which switches to the new spec-compliant C ABI when targeting wasm32-unknown-unknown.

Alternatively, we could also stabilize this and then deprecate it when we switch. I will leave this to the Rust maintainers to decide.

This is a companion PR to #117918, but they could be merged independently.
MCP: rust-lang/compiler-team#703
Tracking issue: #122532

@rustbot
Copy link
Collaborator

rustbot commented Nov 14, 2023

r? @compiler-errors

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 14, 2023
@rustbot
Copy link
Collaborator

rustbot commented Nov 14, 2023

These commits modify compiler targets.
(See the Target Tier Policy.)

Comment on lines 1833 to 1821
pub trait HasWasmCAbiOpt {
fn wasm_c_abi_opt(&self) -> bool;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the best I could come up with to keep the logic inside of Target::adjust_abi(), I believe moving this logic outside of it would introduce some very hacky code that could potentially become a trap for other contributors.

I'm pretty unfamiliar with the compiler though, so any advice would be appreciated.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Nov 14, 2023

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

@rust-log-analyzer

This comment has been minimized.

@daxpedda daxpedda force-pushed the wasm-c-abi branch 2 times, most recently from 571d6df to b5d3f7b Compare November 16, 2023 08:36
@rustbot
Copy link
Collaborator

rustbot commented Nov 16, 2023

Some changes occurred in src/tools/cargo

cc @ehuss

@daxpedda
Copy link
Contributor Author

Apologies @ehuss, I messed up during rebasing onto master and mistakenly changed the Cargo submodule!

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 1, 2023

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

@compiler-errors
Copy link
Member

Sorry, I'm extremely busy

r? compiler

@petrochenkov
Copy link
Contributor

r? compiler
I'm overloaded with reviews.

@rustbot rustbot assigned b-naber and unassigned petrochenkov Dec 5, 2023
@b-naber
Copy link
Contributor

b-naber commented Dec 11, 2023

The companion PR is lang-nominated, if the lang team approves that change this one could be merged too, but if this PR would be merged independently it would need at least an MCP, I think, since it introduces a new flag.

daxpedda and others added 2 commits March 10, 2024 09:00
Co-Authored-By: Ralf Jung <330628+RalfJung@users.noreply.github.com>
@apiraino
Copy link
Contributor

MCP#703 is now approved.

If I understand correctly, this proposal can now move forward

@rustbot ready

@apiraino apiraino removed the S-waiting-on-MCP Status: PR has a compiler MCP and is waiting for the compiler MCP to complete. label Mar 14, 2024
@apiraino
Copy link
Contributor

@b-naber checking this PR. The MCP has been merged (comment), can this be reviewed or does it needs some updates? thanks for checking the progress here!

@liamrosenfeld
Copy link

liamrosenfeld commented Apr 17, 2024

Is there anything further that needs to be done to get this on some review queue? Both the MCP was accepted and the companion PR was merged over a month ago but there have been no updates since.

This addresses an issue that pops up throughout the wasm ecosystem, and causes major issues when it does. So phasing in a fix with this flag as soon as possible would be very helpful.

@wesleywiser
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 18, 2024

📌 Commit 9e2c658 has been approved by wesleywiser

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 18, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 18, 2024
Introduce perma-unstable `wasm-c-abi` flag

Now that `wasm-bindgen` v0.2.88 supports the spec-compliant C ABI, the idea is to switch to that in a future version of Rust. In the meantime it would be good to let people test and play around with it.

This PR introduces a new perma-unstable `-Zwasm-c-abi` compiler flag, which switches to the new spec-compliant C ABI when targeting `wasm32-unknown-unknown`.

Alternatively, we could also stabilize this and then deprecate it when we switch. I will leave this to the Rust maintainers to decide.

This is a companion PR to rust-lang#117918, but they could be merged independently.
MCP: rust-lang/compiler-team#703
Tracking issue: rust-lang#122532
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 18, 2024
Introduce perma-unstable `wasm-c-abi` flag

Now that `wasm-bindgen` v0.2.88 supports the spec-compliant C ABI, the idea is to switch to that in a future version of Rust. In the meantime it would be good to let people test and play around with it.

This PR introduces a new perma-unstable `-Zwasm-c-abi` compiler flag, which switches to the new spec-compliant C ABI when targeting `wasm32-unknown-unknown`.

Alternatively, we could also stabilize this and then deprecate it when we switch. I will leave this to the Rust maintainers to decide.

This is a companion PR to rust-lang#117918, but they could be merged independently.
MCP: rust-lang/compiler-team#703
Tracking issue: rust-lang#122532
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Apr 18, 2024
Introduce perma-unstable `wasm-c-abi` flag

Now that `wasm-bindgen` v0.2.88 supports the spec-compliant C ABI, the idea is to switch to that in a future version of Rust. In the meantime it would be good to let people test and play around with it.

This PR introduces a new perma-unstable `-Zwasm-c-abi` compiler flag, which switches to the new spec-compliant C ABI when targeting `wasm32-unknown-unknown`.

Alternatively, we could also stabilize this and then deprecate it when we switch. I will leave this to the Rust maintainers to decide.

This is a companion PR to rust-lang#117918, but they could be merged independently.
MCP: rust-lang/compiler-team#703
Tracking issue: rust-lang#122532
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 18, 2024
…kingjubilee

Rollup of 6 pull requests

Successful merges:

 - rust-lang#117919 (Introduce perma-unstable `wasm-c-abi` flag)
 - rust-lang#123571 (Correctly change type when adding adjustments on top of `NeverToAny`)
 - rust-lang#123752 (Properly handle emojis as literal prefix in macros)
 - rust-lang#123980 ( Add an opt-in to store incoming edges in `VecGraph` + misc)
 - rust-lang#124110 (Fix negating `f16` and `f128` constants)
 - rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation)

r? `@ghost`
`@rustbot` modify labels: rollup
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Apr 18, 2024
Introduce perma-unstable `wasm-c-abi` flag

Now that `wasm-bindgen` v0.2.88 supports the spec-compliant C ABI, the idea is to switch to that in a future version of Rust. In the meantime it would be good to let people test and play around with it.

This PR introduces a new perma-unstable `-Zwasm-c-abi` compiler flag, which switches to the new spec-compliant C ABI when targeting `wasm32-unknown-unknown`.

Alternatively, we could also stabilize this and then deprecate it when we switch. I will leave this to the Rust maintainers to decide.

This is a companion PR to rust-lang#117918, but they could be merged independently.
MCP: rust-lang/compiler-team#703
Tracking issue: rust-lang#122532
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 19, 2024
…kingjubilee

Rollup of 9 pull requests

Successful merges:

 - rust-lang#117919 (Introduce perma-unstable `wasm-c-abi` flag)
 - rust-lang#123406 (Force exhaustion in iter::ArrayChunks::into_remainder)
 - rust-lang#123752 (Properly handle emojis as literal prefix in macros)
 - rust-lang#123935 (Don't inline integer literals when they overflow - new attempt)
 - rust-lang#123980 ( Add an opt-in to store incoming edges in `VecGraph` + misc)
 - rust-lang#124019 (Use raw-dylib for Windows synchronization functions)
 - rust-lang#124110 (Fix negating `f16` and `f128` constants)
 - rust-lang#124112 (Fix ICE when there is a non-Unicode entry in the incremental crate directory)
 - rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Apr 19, 2024

⌛ Testing commit 9e2c658 with merge 13e63f7...

@bors
Copy link
Contributor

bors commented Apr 19, 2024

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing 13e63f7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 19, 2024
@bors bors merged commit 13e63f7 into rust-lang:master Apr 19, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 19, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (13e63f7): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.0% [2.0%, 2.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.1% [2.1%, 4.4%] 8
Regressions ❌
(secondary)
2.7% [2.1%, 3.5%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.1% [2.1%, 4.4%] 8

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 673.311s -> 673.499s (0.03%)
Artifact size: 315.21 MiB -> 315.24 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet