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

(DO NOT MERGE) fix: proc_macro_srv: temporary abi fix (rust-lang/rust#84717) #9047

Closed
wants to merge 1 commit into from

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented May 29, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented May 29, 2021

Canceled.

@lnicola
Copy link
Member Author

lnicola commented May 29, 2021

bors r+

bors bot added a commit that referenced this pull request May 29, 2021
9047: fix: proc_macro_srv: temporary abi fix (rust-lang/rust#84717) r=lnicola a=lnicola

bors r+

9048: Add some lint completion tests r=Veykril a=Veykril

bors r+

Co-authored-by: cynecx <me@cynecx.net>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
@bors
Copy link
Contributor

bors bot commented May 29, 2021

Build failed (retrying...):

bors bot added a commit that referenced this pull request May 29, 2021
9047: fix: proc_macro_srv: temporary abi fix (rust-lang/rust#84717) r=lnicola a=lnicola

bors r+

Co-authored-by: cynecx <me@cynecx.net>
@bors
Copy link
Contributor

bors bot commented May 29, 2021

Build failed:

@lnicola
Copy link
Member Author

lnicola commented May 29, 2021

I think we need to wait for the rustc PR to hit stable before merging this.

@lnicola lnicola changed the title fix: proc_macro_srv: temporary abi fix (rust-lang/rust#84717) (DO NOT MERGE) fix: proc_macro_srv: temporary abi fix (rust-lang/rust#84717) May 29, 2021
@cynecx
Copy link
Contributor

cynecx commented Jun 1, 2021

We might need this too: rust-lang/rust@92b2894

@TheRawMeatball
Copy link

Does this PR solve the issue yet? I tried manually merging this PR to use it, but it still resulted in the proc macro server crashing. Is there anything to make this work, at least on my own machine?

@lnicola
Copy link
Member Author

lnicola commented Jun 20, 2021

We also need at least #9047 (comment).

@TheRawMeatball
Copy link

But that seems to already be a part of latest nightly? I'm trying to use the latest nightly as of right now, and thought merging this PR into master on my PC would work but apparently it doesn't.

@lnicola
Copy link
Member Author

lnicola commented Jun 20, 2021

It's in the latest nightly compiler, but needs to be ported to that rust-analyzer PR.

@yotamofek
Copy link
Contributor

yotamofek commented Jun 21, 2021

yotamofek@aeb7b18

I made this commit on top of @lnicola 's adaptations to be able to use rust-analyzer with the latest nightly, so putting this link here in case it may save anyone a bit of time.

bors bot added a commit that referenced this pull request Jul 13, 2021
9550: Proc macro multi abi proof of concept r=matklad a=alexjg

#8925 was irritating me so I thought I would have a bash at fixing it. What I've done here is copy the `crates/proc_macro_srv/src/proc_macro` code (which is copied from `<RUST>/library/proc_macro`) to `crates/proc_macro_srv/src/proc_macro_nightly` and the modified the nightly version to include the changes from #9047 and yotamofek@aeb7b18

This gives us the code to support both stable and nightly ABIs. Then we use the `proc_macro_api::version::read_dylib_info` to determine which version of the ABI to load when creating a `ProcMacroLibraryLibLoading` (which is now an enum). 

This seems to work for me.  The code could be cleaned up but I wanted to see if the approach makes sense before I spend more time on it.

I've split the change into two commits, the first is just copying and modifying the `proc_macro` crate, the second contains most of the interesting work around figuring out which ABI to use.

Co-authored-by: Alex Good <alex@memoryandthought.me>
Co-authored-by: alexjg <alex@memoryandthought.me>
@lnicola
Copy link
Member Author

lnicola commented Jul 13, 2021

Superseded by #9550

@lnicola lnicola closed this Jul 13, 2021
@lnicola lnicola deleted the literal-from-str branch July 13, 2021 11:19
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.

None yet

4 participants