Usually in rust you can set strip=true or strip="symbols" in your Cargo.toml. This doesn't work for Vita, since it strips the relocation information from the elf, which causes vita-elf-create to fail.
Previously we had an additional vita-specific strip step configurable via Cargo.toml.
This PR changes the behavior in the following way:
Before calling cargo build it now does an additional cargo 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.
The additional stripping pass is now configurable separately for dev and release builds, being enabled for release builds by default. This pass always uses --strip-unneeded which does not break vita-elf-create and still yields smaller binaries.
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.