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

Use rustc_codegen_llvm's get_dylib_metadata to unblock proc macros. #268

Merged
merged 1 commit into from Nov 20, 2020

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Nov 20, 2020

Given what I found in #192 (comment), proc macros should've been working already, but their loading was silently failing. After getting RUSTC_LOG to work (needs rust-lang/rust#79238 and/or #267), I could see this:

   WARN rustc_metadata::locator no metadata found: TODO: implement get_dylib_metadata

That's a warn! in rustc_metadata, so ideally it would be visible by default, but it's not, due to rust-lang/rust#76824.
(It should also be reported as an error, but I'm not sure if the LLVM backend has non-fatal metadata loading errors)


The main problem is that rustc_metadata is relying on rustc_codegen_spirv to load proc macro metadata.

This PR works around that by grabbing rustc_codegen_llvm's, but we should probably copy what rustc_codegen_cranelift does, instead, or fix rustc to not rely on the codegen backend for proc macro metadata.
(EDIT: filed rust-lang/rust#79239 for future improvements there)

Fixes #192.

@eddyb eddyb requested a review from khyperia November 20, 2020 18:15
@eddyb eddyb mentioned this pull request Nov 20, 2020
Copy link
Contributor

@khyperia khyperia left a comment

Choose a reason for hiding this comment

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

ahahah oh noooo :'(

@mergify mergify bot merged commit 28f604e into EmbarkStudios:main Nov 20, 2020
@eddyb eddyb deleted the proc-macros branch November 20, 2020 18:39
@khyperia khyperia mentioned this pull request Nov 26, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support proc-macros
2 participants