Skip to content

Remove wasm legacy abi #133952

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

Merged
merged 2 commits into from
Jun 16, 2025
Merged

Remove wasm legacy abi #133952

merged 2 commits into from
Jun 16, 2025

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Dec 6, 2024

Closes #122532
Closes #138762
Fixes #71871
Fixes #88152
Fixes #115666
Fixes #129486

@bjorn3 bjorn3 added O-wasm Target: WASM (WebAssembly), http://webassembly.org/ A-ABI Area: Concerning the application binary interface (ABI) labels Dec 6, 2024
@bjorn3 bjorn3 added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Dec 6, 2024
@rustbot
Copy link
Collaborator

rustbot commented Dec 6, 2024

r? @cjgillot

rustbot has assigned @cjgillot.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Dec 6, 2024
@rustbot
Copy link
Collaborator

rustbot commented Dec 6, 2024

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

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 6, 2024
@bjorn3 bjorn3 removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 6, 2024
@bjorn3 bjorn3 force-pushed the remove_wasm_legacy_abi branch from 88f79ac to 26c9b6e Compare December 6, 2024 09:46
@rustbot
Copy link
Collaborator

rustbot commented Dec 6, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/rust.git master
$ git push --force-with-lease

The following commits are merge commits:

@bjorn3 bjorn3 marked this pull request as draft December 6, 2024 09:48
@bjorn3 bjorn3 force-pushed the remove_wasm_legacy_abi branch from 26c9b6e to 16e660d Compare December 6, 2024 13:42
@daxpedda
Copy link
Contributor

#129630 needs to be reverted or adjusted as well.

@bjorn3
Copy link
Member Author

bjorn3 commented Dec 16, 2024

Removed the section in question.


match spec_abi {
ExternAbi::Unadjusted => {}
ExternAbi::PtxKernel => {}
Copy link
Member

Choose a reason for hiding this comment

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

Is the PtxKernel exception not needed any more?

Copy link
Member Author

Choose a reason for hiding this comment

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

To avoid conflicts I based this PR on #133932 which is the PR for making extern "ptx-kernel" have the right abi.

@bors
Copy link
Collaborator

bors commented Feb 6, 2025

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

@bjorn3 bjorn3 force-pushed the remove_wasm_legacy_abi branch from e4c01de to e91711c Compare February 6, 2025 10:07
@bors
Copy link
Collaborator

bors commented Feb 7, 2025

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

@bjorn3 bjorn3 removed the has-merge-commits PR has merge commits, merge with caution. label Feb 21, 2025
@bjorn3 bjorn3 force-pushed the remove_wasm_legacy_abi branch from e91711c to 106301d Compare February 28, 2025 09:09
@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-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jun 14, 2025
fmease added a commit to fmease/rust that referenced this pull request Jun 14, 2025
bors added a commit that referenced this pull request Jun 15, 2025
Rollup of 10 pull requests

Successful merges:

 - #133952 (Remove wasm legacy abi)
 - #134661 (Reduce precedence of expressions that have an outer attr)
 - #141769 (Move metadata object generation for dylibs to the linker code )
 - #141864 (Handle win32 separator for cygwin paths)
 - #142347 (Async drop - fix for StorageLive/StorageDead codegen for pinned future)
 - #142377 (Try unremapping compiler sources)
 - #142389 (Apply ABI attributes on return types in `rustc_codegen_cranelift`)
 - #142470 (Add some missing mailmap entries)
 - #142481 (Add `f16` inline asm support for LoongArch)
 - #142509 (bump std libc dependency)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 15, 2025
bors added a commit that referenced this pull request Jun 15, 2025
Rollup of 9 pull requests

Successful merges:

 - #133952 (Remove wasm legacy abi)
 - #141769 (Move metadata object generation for dylibs to the linker code )
 - #141864 (Handle win32 separator for cygwin paths)
 - #142347 (Async drop - fix for StorageLive/StorageDead codegen for pinned future)
 - #142377 (Try unremapping compiler sources)
 - #142389 (Apply ABI attributes on return types in `rustc_codegen_cranelift`)
 - #142470 (Add some missing mailmap entries)
 - #142481 (Add `f16` inline asm support for LoongArch)
 - #142509 (bump std libc dependency)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 15, 2025
bors added a commit that referenced this pull request Jun 15, 2025
Rollup of 8 pull requests

Successful merges:

 - #133952 (Remove wasm legacy abi)
 - #141769 (Move metadata object generation for dylibs to the linker code )
 - #141864 (Handle win32 separator for cygwin paths)
 - #142347 (Async drop - fix for StorageLive/StorageDead codegen for pinned future)
 - #142389 (Apply ABI attributes on return types in `rustc_codegen_cranelift`)
 - #142470 (Add some missing mailmap entries)
 - #142481 (Add `f16` inline asm support for LoongArch)
 - #142509 (bump std libc dependency)

r? `@ghost`
`@rustbot` modify labels: rollup
fmease added a commit to fmease/rust that referenced this pull request Jun 15, 2025
bors added a commit that referenced this pull request Jun 15, 2025
Rollup of 9 pull requests

Successful merges:

 - #133952 (Remove wasm legacy abi)
 - #134661 (Reduce precedence of expressions that have an outer attr)
 - #141769 (Move metadata object generation for dylibs to the linker code )
 - #141864 (Handle win32 separator for cygwin paths)
 - #141937 (Report never type lints in dependencies)
 - #142347 (Async drop - fix for StorageLive/StorageDead codegen for pinned future)
 - #142389 (Apply ABI attributes on return types in `rustc_codegen_cranelift`)
 - #142470 (Add some missing mailmap entries)
 - #142481 (Add `f16` inline asm support for LoongArch)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jun 16, 2025
Rollup of 10 pull requests

Successful merges:

 - #133952 (Remove wasm legacy abi)
 - #134661 (Reduce precedence of expressions that have an outer attr)
 - #141769 (Move metadata object generation for dylibs to the linker code )
 - #141937 (Report never type lints in dependencies)
 - #142347 (Async drop - fix for StorageLive/StorageDead codegen for pinned future)
 - #142389 (Apply ABI attributes on return types in `rustc_codegen_cranelift`)
 - #142470 (Add some missing mailmap entries)
 - #142481 (Add `f16` inline asm support for LoongArch)
 - #142499 (Remove check run bootstrap)
 - #142543 (Suggest adding semicolon in user code rather than macro impl details)

r? `@ghost`
`@rustbot` modify labels: rollup
Comment on lines -345 to -347
// FIXME: remove this once the wasm32-unknown-unknown ABI is fixed
// please also add `wasm32-unknown-unknown` back in `tests/assembly/wasm32-naked-fn.rs`
// basically the commit introducing this comment should be reverted
Copy link
Member

Choose a reason for hiding this comment

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

The comment asks to add the target back in a test file -- which the PR does not seem to do? The test file seems to have been renamed to tests/assembly/naked-functions/wasm32.rs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened #142565

@bors bors merged commit d6dc965 into rust-lang:master Jun 16, 2025
10 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 16, 2025
rust-timer added a commit that referenced this pull request Jun 16, 2025
Rollup merge of #133952 - bjorn3:remove_wasm_legacy_abi, r=alexcrichton

Remove wasm legacy abi

Closes #122532
Closes #138762
Fixes #71871
#88152
Fixes #115666
Fixes #129486
@bjorn3 bjorn3 deleted the remove_wasm_legacy_abi branch June 16, 2025 08:02
Kobzol added a commit to Kobzol/rust that referenced this pull request Jun 16, 2025
…st, r=RalfJung

Test naked asm for wasm32-unknown-unknown

cc rust-lang#133952 (comment)
rust-timer added a commit that referenced this pull request Jun 16, 2025
Rollup merge of #142565 - bjorn3:wasm32_unknown_naked_asm_test, r=RalfJung

Test naked asm for wasm32-unknown-unknown

cc #133952 (comment)
@Manishearth
Copy link
Member

Manishearth commented Jun 17, 2025

No, this is not the plan we agreed upon.

This changes the default at the same time it removes the flag. This is not something that can be easily switched over to for code that needs to test/run on multiple Rust versions.

There was an explicit plan in #122532 (comment), and it seemed to be what everyone coalesced around:

If you're ok with that, that seems like a reasonable plan to move forward to me, with a possible schedule looking like:

  1. Land FCW + write blog post.
  2. Wait for FCW to hit stable
  3. Change -Zwasm-c-abi default in nightly once FCW is on stable
  4. Wait for new default to hit stable
  5. Remove FCW + -Zwasm-c-abi

Admittedly, this is slightly different from what is in the blog post, which makes no claims about when the default will switch over. I should have noticed that oversight, my bad.

The current change puts us in a situation where we cannot write code that targets multiple versions at once. This is a crucial stage in managing transitions: you start with code that only works with the old thing, and then you move to code that works with both the old and new thing, and you finally end up with code that only works with the new thing.

Personally speaking I don't need the legacy ABI to be maintained as a flag: it is sufficient for the -Zwasm-c-abi flag to become a singleton flag that is a no-op.

We might have workarounds for this, but it's somewhat frustrating that this is still being handled in a hard-to-transition way after tedious discussions about trying not to do that.

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 17, 2025

There was an explicit plan in #122532 (comment), and it seemed to be what everyone coalesced around:

I didn't remember that comment when I responsed to Alex's question about the status of this PR: #133952 (comment) My bad.

Personally speaking I don't need the legacy ABI to be maintained as a flag: it is sufficient for the -Zwasm-c-abi flag to become a singleton flag that is a no-op.

I can make a PR to add back a no-op -Zwasm-c-abi flag with spec as only allowed value. Does that work for you?

@Manishearth
Copy link
Member

@bjorn3 Yep, it works for me! Still needs some work on my side but it smooths things out and at this point I don't want to drag this out further :)

@alexcrichton
Copy link
Member

That's my bad as well, apologies for forgetting that!

but it's somewhat frustrating that this is still being handled in a hard-to-transition way after tedious discussions about trying not to do that.

Sorry for the frustration, but don't forget that this issue has spanned many contributors, years, and possible shapes of solutions. It's tough to keep track of things sometimes. Nevertheless thanks @bjorn3 for quickly making #142635!

@Manishearth
Copy link
Member

Manishearth commented Jun 17, 2025

@alexcrichton Yes, I am aware, but it's a bit of a "fool me once" situation: this is not the first time this type of breakage has happened, and seeing it happen twice on the same issue after stakeholders have been pulled in is super disheartening. I don't blame individuals for this, but I do think the compiler team might need to improve its processes here. Designing and following principled transition plans has been a failing of the Rust project for ages: the first edition ended up being a lot more work because we found out in the last minute that nobody had actually designed transition plans. It's a repeated problem.

Of course things are tough to keep track of; but we have special carve outs in the process to keep track of things we consider a priority. Transition plans probably should be a priority since they directly affect Rust users and affect Rust's reputation1.

Footnotes

  1. When these things happen I have occasionally had to convince other people I work with to not make a big Thing out of it, but it's harder to do so as it starts to be a pattern. Like, I'm not trying to be difficult here, it's just that the more this happens the less I can do to help Rust's reputation here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ABI Area: Concerning the application binary interface (ABI) O-wasm Target: WASM (WebAssembly), http://webassembly.org/ 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
10 participants