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

On some projects it somehow invalidates cargo cache #29

Open
Ddystopia opened this issue Jul 11, 2023 · 7 comments
Open

On some projects it somehow invalidates cargo cache #29

Ddystopia opened this issue Jul 11, 2023 · 7 comments
Labels
question Further information is needed

Comments

@Ddystopia
Copy link
Contributor

On some of projects, if I use ra-multiplex, it will conflict with cargo. I am often running cargo check even if I can see diagnostics in the editor, and at some projects it will show Blocking waiting for file lock on build directory and then recompile all dependencies. I don't know what should I show you, logs etc, I would like to provide any information if I can.

@pr2502
Copy link
Owner

pr2502 commented Aug 19, 2023

Are you sure this is an issue specific to ra-multiplex? We never touch the target directory, this to me sounds like a rust-analyzer issue.

Please try if you can reproduce the issue without ra-multiplex.

@Ddystopia
Copy link
Contributor Author

I know it is a bit strange, but when I've switched to rust-analyzer, everything vere good. For now I can't access my PC so I would not be helpful

@pr2502
Copy link
Owner

pr2502 commented Aug 25, 2023

Hmm, I have another guess. Do you use RUSTC_FLAGS to set some parameters? Contents of RUSTC_FLAGS are used as part of the hash calculation and changing it causes a full rebuild. As it is now ra-multiplex doesn't pass on any env vars to rust-analyzer, cargo check without the RUST_FLAGS set could then cause a full rebuild.

@Ddystopia
Copy link
Contributor Author

Now I've looked at my shell history in my dotfile repo in GitHub to check it (I won't have access to the PC untill ±6th September so I could not actively participate in finding the possible bug), and I was running cargo clippy with custom arguments on the cli.

I do not remember clearly, but at this time it is possible that I've used #26 PR to pass cargo clippy, and it is possible that it had different cli args.

Sorry for such an incomplete issue and thank you for your work!

@IndianBoy42
Copy link

Hmm, I have another guess. Do you use RUSTC_FLAGS to set some parameters? Contents of RUSTC_FLAGS are used as part of the hash calculation and changing it causes a full rebuild. As it is now ra-multiplex doesn't pass on any env vars to rust-analyzer, cargo check without the RUST_FLAGS set could then cause a full rebuild.

I guess that the inheritance of environment variables may continue to be a problem. like the PATH variable problem in #27). Even if we add all the cargo/rust env vars manually, build scripts may look at arbitrary env vars (like checking CC if it builds some native libraries). I wonder if its possible to start the server from the editor/client and then move the ownership to the daemon so it persists after the client stops). That sounds platform specific and complicated.

@pr2502
Copy link
Owner

pr2502 commented Aug 28, 2023

I wonder if its possible to start the server from the editor/client and then move the ownership to the daemon so it persists after the client stops.

Not possible on linux, you can only reparent to pid 1, no idea how this works on other platforms but I doubt it.

@Ddystopia
Copy link
Contributor Author

Just want to post here a workaround: You could just change cargo target dir so they would not invalidate each other

@pr2502 pr2502 added the question Further information is needed label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is needed
Projects
None yet
Development

No branches or pull requests

3 participants