-
Notifications
You must be signed in to change notification settings - Fork 121
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 build.target
when getting target dir
#554
Conversation
build.target
when getting target dirbuild.target
when getting target dir
Codecov Report
@@ Coverage Diff @@
## 0.33.0 #554 +/- ##
==========================================
+ Coverage 93.01% 93.05% +0.04%
==========================================
Files 98 98
Lines 19283 19278 -5
==========================================
+ Hits 17936 17940 +4
+ Misses 1347 1338 -9
Continue to review full report at Codecov.
|
cargo FS structure looks like this:
so it can be wrong behavior. Is it better to introduce a new env var? |
src/lib/environment/crateinfo.rs
Outdated
deserializer: D, | ||
) -> Result<Option<String>, D::Error> { | ||
Option::<String>::deserialize(deserializer)? | ||
.map(|target| target.trim_end_matches(".json").to_string()) |
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.
why do we need it in the deserialize? why not keep it simple and do it in the usage as today?
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.
'Cause it will lead us to code repetition. We need to trim string in crate_target_dir
and crate_target_triple
, but original string can be useful for env var like CARGO_MAKE_IS_CUSTOM_TARGET_TRIPLE
Thanks a lot for the continued effort on this one :)
can you explain a bit? what new var did you have in mind? how would they be used if there were 2, meaning how do users know which one to use? |
Behavior with custom target triple:
I don't know can What about workspaces?
Something like
User will decide which directory he needs - folder of custom target triple ( |
@ark0f thanks a lot for the answers and PR. i agree with your approach of adding another env var. |
Oh, I missed this PR... It's great and I've verified, it fixes my use case. Curiously, I'm also using a custom target, but its being set on |
cargo_metadata
cratebuild.target
when getting target dirRustTarget
to cope better with future changesCARGO_MAKE_CRATE_CUSTOM_TRIPLE_TARGET_DIRECTORY
env varFixes #557