Description
How do I determine which artifacts cargo produced and where? The used target directory depends on multiple environment variables (e.g. CARGO_TARGETDIR
), configuration settings (e.g. build.target-dir
and build.target
), command-line arguments (--target
, --release
). Not to mention it gets even more complicated when the package is part of a workspace. Of course it also depends on settings inside Cargo.toml
but at least for these settings there's the cargo metadata
command.
Now my question is if there is any easy way to know which artifacts were produced and where? Or do I have to parse all of the stuff above and mimic undocumented implementation details of how cargo determines output locations and names? If the latter is the case, then this greatly complicates integrating cargo into any other build system. For my specific use case, I need to provide a post-build step that is project-agnostic, i.e. all of the variables above might change. How should I go about?