bevyengine / bevy-website

The source files for the official Bevy website
https://bevyengine.org
MIT License
193 stars 330 forks source link

Section on rust-analyzer should recommend enabling seperate cargo directories #1380

Open alice-i-cecile opened 3 months ago

alice-i-cecile commented 3 months ago

Rust-analyzer › Cargo: Target Dir Optional path to a rust-analyzer specific target directory. This prevents rust-analyzer's cargo check and initial build-script and proc-macro building from locking the Cargo.lock at the expense of duplicating build artifacts. Set to true to use a subdirectory of the existing target directory or set to a path relative to the workspace to use that path.

This is a huge QoL / iteration speed improvement. It should be mentioned right after we talk about rust-analyzer. Call out both the pros and cons.

IceSentry commented 2 months ago

If it is mentioned it should also be made very clear that it will use even more memory since it duplicated the target directory. People already complain that the target is too big when using bevy and this won't help with that.

BD103 commented 2 months ago

I'm not sure I understand what is being discussed here: are you recommending that you set the path to the target directory in rust-analyzer to something other than the actual target directory, just so it does not lock cargo check and other commands?

I agree with IceSentry that this may cause a lot of extra files, especially since that you're far less likely to run cargo clean for that rust-analyzer specific directory. I feel like it could also lead to inconsistencies and confusion, though I haven't tested that specifically so it may be fine.

alice-i-cecile commented 2 months ago

Alright, I'm fine to leave this out.

IceSentry commented 2 months ago

To be clear, I 100% think this should be recommended. I use it all the time and it's extremely useful. I just think it should be accompanied by a warning that it uses a lot more space.

@BD103 the rust-analyzer target folder is embedded in the base target folder so running cargo clean will also clean it. That part is not a concern. cargo-sweep doesn't pick it up, but it's not an official project anyway.

BD103 commented 2 months ago

@BD103 the rust-analyzer target folder is embedded in the base target folder so running cargo clean will also clean it. That part is not a concern. cargo-sweep doesn't pick it up, but it's not an official project anyway.

Ok, that makes sense as long as the proper warnings are kept. This shouldn't be conveyed as costless.