-
Notifications
You must be signed in to change notification settings - Fork 105
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
Respect Cargo target directory configuration #159
Conversation
Had to temporarily remove my own |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR. I've added some suggestions, the primary one being to add support for the synonym var name as per https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir
As a general comment, could you please include a sample dev experience walkthrough of how to leverage these improvements? This way I don't have to guess if I did the right set up to verify changes are doing what they are intended to accomplish.
Fixes leptos-rs#74, leptos-rs#127, leptos-rs#157 It would cause a crash when the target directory was not in the workspace
- Replace hard-coded strings with constant - Add "CARGO_BUILD_TARGET_DIR" synonym
@aperepel [build]
target-dir = ".cargo/targetShare" This shares the target directory between projects. I personally do this to speed up compilation and save disk-usage by re-using already compiled dependencies (between projects), other people might have other reasons. With this configuration, one would expect that:
(Ideally there'd be a test demonstrating all this, but see my original PR comment for why I didn't manage to make one) |
Hello, what's the status here? I've been using a binary compiled from this PR for quite some time now (without any issues) and I'd love to see this merged so I can use other updates as well. Is there anything I can help with? (code, testing, review, ...) |
Sorry for the delay here — I've been reviewing PRs post-0.5 and am going to start going through these now. |
No worries, thank you |
Changes:
target/server
andtarget/front
CARGO_TARGET_DIR
is not "target" #74Result::unwrap()
on anErr
value: Could not remove base #157cargo leptos watch
fails when CARGO_TARGET_DIR is defined #186pathdiff
site-root
to the/site/
subfolder of the cargo target directorySome
inparse()
,but that would forces
Some
checks everywhere.Didn't manage to add additional regression tests:
.cargo/config.toml
from where cargo is invoked,and does not take the
--manifest-path
into account-C <DIR>
flag tocargo
to change directory before invoking rust-lang/cargo#10098cwd
, though it'sn't used for thecargo metadata
call,and isn't set to the directory of the actual project/workspace being tested. I can't figure out what exactly it's supposed to do,
and I don't feel confident doing something with it.
Additional notes/things to look at that are outside the scope of this PR:
src/ext/path.rs