feat: Improved strip
config handling
#22
Merged
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.
Usually in rust you can set
strip=true
orstrip="symbols"
in your Cargo.toml. This doesn't work for Vita, since it strips the relocation information from theelf
, which causesvita-elf-create
to fail.Previously we had an additional vita-specific
strip
step configurable viaCargo.toml
.This PR changes the behavior in the following way:
cargo build
it now does an additionalcargo build ... -Z unstable-options --unit-graph
. This unstable option does a dry-run of the build emitting a JSON with a graph. This JSON is parsed to check if symbol stripping was enabled, and if the build failed AND we stripping was detected,cargo-vita
now emits a sensible warning, improving the devx. Since this cargo feature is unstable (for 4 years already), if it fails, the output is ignored and does NOT fail the build.--strip-unneeded
which does not breakvita-elf-create
and still yields smaller binaries.