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

Windows: Run compat_fn init before C++ init #97816

Closed
wants to merge 1 commit into from

Conversation

ChrisDenton
Copy link
Contributor

Fixes #97814

This takes the first option on the above issue. Instead of using C++ initializer functions for dynamically loading Windows API functions, this uses C initializer functions. These will be run before C++ initializers, allowing third party code to be able to use pre-main initializers without having to worry that some function or other may not yet be available.

@rustbot label +O-windows

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jun 7, 2022
@rust-highfive
Copy link
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs to request review from a libs-api team reviewer. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot rustbot added the O-windows Operating system: Windows label Jun 7, 2022
@rust-highfive
Copy link
Collaborator

r? @kennytm

(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 Jun 7, 2022
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 3, 2022
@ChrisDenton ChrisDenton marked this pull request as draft July 21, 2022 11:01
@bors
Copy link
Contributor

bors commented Jul 31, 2022

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

@ChrisDenton ChrisDenton marked this pull request as ready for review August 2, 2022 15:35
@rustbot
Copy link
Collaborator

rustbot commented Aug 2, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@ChrisDenton
Copy link
Contributor Author

Rebased. The other PR addressed many of the problems in the original issue by making sure we depend less on the initializer having already been run. But currently WaitOnAddress and WakeByAddressSingle still must be manually initialized before use. So this PR runs our init earlier, hopefully before any user init functions are run.

r? @thomcc since we were talking about something related.

@rust-highfive rust-highfive assigned thomcc and unassigned kennytm Aug 2, 2022
@ChrisDenton
Copy link
Contributor Author

I'm closing in favour of #100127. Though I may reopen if that isn't merged.

@ChrisDenton ChrisDenton closed this Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows: Dynamically loaded functions may not be loaded before user pre-main initializers
7 participants