Skip to content

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