Skip to content

fix: Load proc-macros for rustc_private crates #14282

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 1 commit into from
Mar 8, 2023

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Mar 8, 2023

Fixes #13591

Verified that this makes things work in the clippy repo (like resolving sym things for example)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 8, 2023
@Veykril
Copy link
Member Author

Veykril commented Mar 8, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Mar 8, 2023

📌 Commit c978648 has been approved by Veykril

It is now in the queue for this repository.

@Veykril Veykril changed the title Load proc-macros for rustc_private crates fix: Load proc-macros for rustc_private crates Mar 8, 2023
@bors
Copy link
Contributor

bors commented Mar 8, 2023

⌛ Testing commit c978648 with merge aff6cb0...

@bors
Copy link
Contributor

bors commented Mar 8, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing aff6cb0 to master...

@bors bors merged commit aff6cb0 into rust-lang:master Mar 8, 2023
let path = dir_entry.path();
tracing::info!("p{:?}", path);
let extension = path.extension()?;
if extension == "dll" || extension == "so" {
Copy link
Member

Choose a reason for hiding this comment

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

macOS uses .dylib as extension. I did recommend using std::env::consts::DLL_EXTENSION instead. We can't load proc macros for another target anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, that's what I forgot to do properly 👍

None
})
.collect();
for p in rustc.packages() {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this check that the package is actually a proc macro? It seems like the current logic will attempt to load rustc_driver as proc macro as it is a dylib too.

Copy link
Member Author

Choose a reason for hiding this comment

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

It certainly should, I assumed there would only be proc-macro dylibs in there but that's clearly not a good assumption (and even then the check is better)

bors added a commit that referenced this pull request Mar 8, 2023
minor: Fixup dylib extensions for rustc_private proc-macro loading

Follow up to #14282
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustc private crates have unresolved references due to rustc_macros not being expandable
4 participants