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

Set current working directory for procedural macros #11353

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

vlad20012
Copy link
Member

Fixes #11079

@lnicola
Copy link
Member

lnicola commented Jan 27, 2022

What happens with stderr here? Do these end up in rust-analyzer's stderr (and in the Code output panel)? Should they be eprintln!s?

@vlad20012 vlad20012 force-pushed the proc-macro-pwd branch 2 times, most recently from 9ed20ca to 902b088 Compare January 27, 2022 13:05
@vlad20012
Copy link
Member Author

What happens with stderr here? Do these end up in rust-analyzer's stderr (and in the Code output panel)? Should they be eprintln!s?

According to this line:

https://github.com/rust-analyzer/rust-analyzer/blob/e149a15edd354dd0f995532d16a3e8dc21367e06/crates/proc_macro_api/src/process.rs#L91

the expander inherits stderr from the main RA process.
Alternatively, we can:

  1. Turn it into a hard error, i.e. consider a macro expansion as failed if we can't set the dir
  2. Add the error to Response::ExpandMacro and log it somehow on the RA side

@lnicola
Copy link
Member

lnicola commented Jan 27, 2022

Yeah, I think it's fine.

bors d+

@bors
Copy link
Contributor

bors bot commented Jan 27, 2022

✌️ vlad20012 can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@vlad20012
Copy link
Member Author

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 27, 2022

@bors bors bot merged commit b55a1c5 into rust-lang:master Jan 27, 2022
bors bot added a commit to intellij-rust/intellij-rust that referenced this pull request Jan 31, 2022
8489: Update `ra_ap_proc_macro_srv` to `0.0.94`, fix disk usage, fix pwd r=vlad20012 a=vlad20012

This update consists of rust-lang/rust-analyzer#11365, rust-lang/rust-analyzer#11353 and rust-lang/rust-analyzer#11356 PRs

Fixes #7709
Fixes #8238 in a proper way (#8271 was a hacky hotfix)

changelog: Don't fill up disk space by proc macro DLLs on Windows

Co-authored-by: vlad20012 <beskvlad@gmail.com>
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.

set current working directory for procedural macros
2 participants