Use subdirectory within target/tests/#84
Merged
Conversation
Or to put it another way, do not assume that the project's
target/tests/target/ is ours to use as we wish.
Specifically,
* Change the the pathname to pass to cargo in `CARGO_TARGET_DIR`
to add `/ "macrotest"` at the end.
* Create it, which is now necessary, because it's not a parent
of `project.dir`.
* Construct it in `Project::prepare`, rather than in `cargo()`.
(Because the creation should be done in `prepare()`, not `cargo()`.)
* So, pass the value though in a new `pub` field in `Project`.
* Abolish the now-unused `target_dir` field of `Project`.
Empirically, this is sufficient on its own to resolve
eupn#83
dtolnay/trybuild#218
(I don't know precisely what the difference is between trybuild's and
mcarotest's build invocations. It is possible that it would be better
for cargo to be able to cache both in the target directory, but I
think we should use a namespaced directory, regardless.)
eupn
approved these changes
Aug 12, 2023
taiki-e
approved these changes
Mar 30, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Use subdirectory within target/tests/
Or to put it another way, do not assume that the project's
target/tests/target/is ours to use as we wish.Specifically,
CARGO_TARGET_DIRto add/ "macrotest"at the end.project.dir.Project::prepare, rather than incargo(). (Because the creation should be done inprepare(), notcargo().)pubfield inProject.target_dirfield ofProject.Empirically, this is sufficient on its own to resolve
#83
dtolnay/trybuild#218
(I don't know precisely what the difference is between trybuild's and macrotest's build invocations. It is possible that it would be better for cargo to be able to cache both in the target directory, but I think we should use a namespaced directory, regardless.)
I have submitted a similar merge request dtolnay/trybuild#219 for trybuild, which, likewise, is sufficient on its own to resolve the problem I was experiencing. I think these changes should be made to both packages.
Closes #83