Skip to content
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

Use $CARGO_BUILD_TARGET_DIR to determine where output should go #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

antifuchs
Copy link

What does this PR do?

This PR adjusts the file-name creation routines (which make all the target/machine paths) to take CARGO_BUILD_TARGET_DIR into account, which should enable workspace builds as in #19.

It also adjusts the way filename handling is done to use PathBuf, and switches to create_dir_all (which should ensure subdirectories, if they ever get added, get created correctly).

Testing /:

I couldn't formulate a reasonable test for this - all the tools I tried (trybuild mainly) reset the cargo env variables, which makes it impossible to adjust that. But I tried the build in a workspace crate by pulling in the patched version of machine by path... and that worked.)

The canonical target location is `target/`, but that can be
customized (e.g. in workspace builds), so construct the correct path
name for the output files. This also uses PathBuf construction
functions instead of the slightly more error-prone format! statements
to construct those pathnames.
@pjenvey
Copy link

pjenvey commented Jan 25, 2023

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants