Skip to content

Don't export main on WebAssembly. #102480

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

Conversation

sunfishcode
Copy link
Member

On default_hidden_visibility = true platforms, which is currently just WebAssembly, don't automatically export main. On such platforms, main in C defaults to being hidden, and therefore not automatically exported.

On `default_hidden_visibility = true` platforms, which is currently just
WebAssembly, don't automatically export `main`. On such platforms, `main`
in C defaults to being hidden, and therefore not automatically exported.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 29, 2022
@rust-highfive
Copy link
Contributor

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 29, 2022
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 6, 2022

📌 Commit 718ea90 has been approved by petrochenkov

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 Oct 6, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 7, 2022
…port-main, r=petrochenkov

Don't export `main` on WebAssembly.

On `default_hidden_visibility = true` platforms, which is currently just WebAssembly, don't automatically export `main`. On such platforms, `main` in C defaults to being hidden, and therefore not automatically exported.
@matthiaskrgr
Copy link
Member

@bors r- failed in a rollup
#102758 (comment)

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 7, 2022
@bors
Copy link
Collaborator

bors commented Nov 19, 2022

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

@Dylan-DPC
Copy link
Member

@sunfishcode any updates on this?

@sunfishcode
Copy link
Member Author

src/etc/wasm32-shim.js depends on main being exported, and maybe we could change that, but maybe means that there's a broader expectation out there that main is exported out there. I don't know what the expectations are here yet.

@JohnCSimon
Copy link
Member

@sunfishcode Can you please post your status on this PR? It has sat idle for months.

@sunfishcode
Copy link
Member Author

In theory we should do something here, but in practice it'll require navigating some complex backwards compatibility constraints.

@JohnCSimon
Copy link
Member

@sunfishcode
Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this.
Note: if you are going to continue please open the PR BEFORE you push to it, else you won't be able to reopen - this is a quirk of github.
Thanks for your contribution.

@rustbot label: +S-inactive

@JohnCSimon JohnCSimon closed this May 28, 2023
@rustbot rustbot added the S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. label May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

8 participants