(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 https://github.com/dtolnay/trybuild/pull/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.
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_DIR
to add/ "macrotest"
at the end.project.dir
.Project::prepare
, rather than incargo()
. (Because the creation should be done inprepare()
, notcargo()
.)pub
field inProject
.target_dir
field ofProject
.Empirically, this is sufficient on its own to resolve https://github.com/eupn/macrotest/issues/83 https://github.com/dtolnay/trybuild/issues/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 https://github.com/dtolnay/trybuild/pull/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