Skip to content

Don't reload proc macros on fork #141276

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Berrysoft
Copy link
Contributor

I come across this problem recently, and see the mailing list of cygwin: https://inbox.sourceware.org/cygwin/TYCPR01MB10926F334CDC9344A89527583F89CA@TYCPR01MB10926.jpnprd01.prod.outlook.com/

TL;DR: rustc fails to execute the linker when proc macro DLLs are too many.

As we don't need to reload these them when executing the linker, I think it's OK to set FORK_NO_RELOAD for the loaded proc macro DLLs. It's a little hacky though. dlfork is a cygwin extension without documents, and it cannot set whether to reload a specific DLL on fork. If available, I prefer such an option for dlopen.

Not sure what does the rustc maintainers think about this workaround. I'll also ask for advice from the cygwin maintainers.

@rustbot
Copy link
Collaborator

rustbot commented May 20, 2025

r? @oli-obk

rustbot has assigned @oli-obk.
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 May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants