Skip to content

Test explorer forces rebuild of procedural macros #17121

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

Closed
zaneduffield opened this issue Apr 22, 2024 · 2 comments
Closed

Test explorer forces rebuild of procedural macros #17121

zaneduffield opened this issue Apr 22, 2024 · 2 comments
Labels
A-test-explorer Issues related to the test explorer lsp extension and vscode test api C-bug Category: bug

Comments

@zaneduffield
Copy link

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

0.3.1924-standalone (5dbe3fe 2024-04-14)

rustc version: (eg. output of rustc -V)

rustc 1.77.1 (7cf61ebde 2024-03-27)

editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)

VSCode, v0.3.1924


When a crate uses procedural macros, the new Test Explorer seems to disagree with cargo in my terminal about what needs to be recompiled. It's as if they are using different build settings (e.g. RUSTFLAGS).

Specifically, if I alternate cargo test and the 'Run Tests' button in the Test Explorer UI, then they takes turns rebuilding the procedural macros

   Compiling proc-macro2 v1.0.81
   Compiling quote v1.0.36
   Compiling syn v2.0.60
   Compiling yare-macro v3.0.0
   Compiling yare v3.0.0
   Compiling ra-proc-macro-rebuild-issue v0.1.0

I don't have any value for the RUSTFLAGS environment variable (or any other setting that I know of that might influence build cache invalidation). Furthermore, this issue doesn't seem to occur when the project doesn't use procedural macros.

Also, I can reproduce this issue with the first version of RA that had the Test Explorer.

Reproducible example: https://github.com/zaneduffield/ra-proc-macro-rebuild-issue

@zaneduffield zaneduffield added the C-bug Category: bug label Apr 22, 2024
@zaneduffield
Copy link
Author

Similar to #17149.
I'll see if the workaround described in #17149 (comment) works for me tomorrow.

@zaneduffield
Copy link
Author

Similar to #17149. I'll see if the workaround described in #17149 (comment) works for me tomorrow.

I can confirm that this workaround does work for me.

@HKalbasi HKalbasi added the A-test-explorer Issues related to the test explorer lsp extension and vscode test api label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-test-explorer Issues related to the test explorer lsp extension and vscode test api C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants