-
Notifications
You must be signed in to change notification settings - Fork 93
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
Added support for target-dir in config file. #177
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If you fold the two new matches into one here, the code becomes shorter and you avoid an
unwrap
.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.
No, because I want to do
td.join("target")
ifconfig
is None orconfig.target_dir()?
is None. So the only way I can think of to avoid the unwrap is to have nested matches and havetd.join("target")
twice. Not sure if that's better.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.
Hm I see.
Either way please move
let target_dir
down to the other dir stuff here.But then, wouldn't this work?
That's equivalent to your code, right?
However, it makes me wonder if this is really what we want. This directory will be outside the tempdir, right? We'll be spilling files into the user's dir and they might get mixed up with other stuff? Shouldn't this be more like
td.join(target_dir)
or so?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.
Ah, good idea. Yes, that's equivalent and better, I'll use that.
From my point of view it's the desired behavior. Without setting the target-dir, the files are put into a temp directory. With the target-dir, the files are put into that directory, relative to the root directory of the project. So for example, you can set it to
"build/sysroot"
and then all files go into"<yourproject>/build/sysroot"
.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.
What is target-dir usually used for? Isn't that to change
target
to something else? So as a user I would expect by projects stuff to be put there, but not the sysroot.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.
hm, I created the patch quite some time ago, but I remember that without target-dir, Xargo was putting all kinds of things in the usual target directory. I just tested it again and actually, using a temp directory for the sysroot and using
CARGO_TARGET_DIR
to store the project stuff at a different place, looks fine.Maybe Xargo behaves differently now or I'm missing something. However, I would suggest that we close the PR for now and I report back if there still is a good reason for target-dir.
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.
All right. Thanks a lot for looking into this!