taiki-e / upload-rust-binary-action

GitHub Action for building and uploading Rust binary to GitHub Releases.
Apache License 2.0
227 stars 19 forks source link

Warning: arm-linux-gnueabihf-strip not found, skip stripping #59

Closed VorpalBlade closed 5 months ago

VorpalBlade commented 9 months ago

When running release jobs using this action and cross compiling to Linuxes that are not x86-64 or i686 I get the following warnings in the builds:

upload-assets (aarch64-unknown-linux-musl, ubuntu-latest)
aarch64-linux-gnu-strip not found, skip stripping

upload-assets (armv7-unknown-linux-musleabihf, ubuntu-latest)
arm-linux-gnueabihf-strip not found, skip stripping

upload-assets (aarch64-unknown-linux-gnu, ubuntu-latest)
aarch64-linux-gnu-strip not found, skip stripping

upload-assets (armv7-unknown-linux-gnueabihf, ubuntu-latest)
arm-linux-gnueabihf-strip not found, skip stripping

Here is an example run of this: https://github.com/VorpalBlade/chezmoi_modify_manager/actions/runs/6699435637 And the relevant workflow: https://github.com/VorpalBlade/chezmoi_modify_manager/blob/main/.github/workflows/release.yml (specifically the job upload-assets).

Am I doing something wrong? Or is it a bug in the action whereby it doesn't install some required dependency? I seem to be doing the same things you do in your examples in your README though.

taiki-e commented 7 months ago

This is normal behavior. We originally used strip on all targets, but found that the strip installed by default on the runner did not work on some targets (https://github.com/taiki-e/upload-rust-binary-action/issues/8), so we changed the strip on those targets to not strip if the tool is not installed.

This warning is a note to users who expect strip to work by default on all targets, and if you actually want strip to work on all targets, you will need a cargo profile as documented. (Or, you should also not get this warning if you are using another cross-compilation way.)

This action was created before the strip in cargo profile was stabilized, so it required a strip on our part, but now that the the strip in cargo profile has been stable for some time, it may be appropriate to remove the strip on our part completely in favor of recommend using the strip in cargo profile. I plan to make that change, at least in v2.

taiki-e commented 5 months ago

strip will be the default in the next stable (1.77, https://github.com/rust-lang/cargo/pull/13257), so when that is released, strip on our part will be removed and this warning will be removed at the same time.

VorpalBlade commented 5 months ago

@taiki-e Hm, it would be great if we could actually do split debug info and upload that as well somewhere. Not being able to debug released binaries isn't great (though far less of a problem in Rust than C++ of course, but not all projects only depend on pure rust code)

taiki-e commented 5 months ago

You can disable it by setting profile (https://doc.rust-lang.org/cargo/reference/profiles.html#strip), and can split debuginfo (https://doc.rust-lang.org/cargo/reference/profiles.html#split-debuginfo).

taiki-e commented 5 months ago

There was a suggestion regarding supporting split debuginfo as an option for this action (https://github.com/taiki-e/upload-rust-binary-action/pull/49), but perhaps another approach should be considered once Cargo enables strip by default. Although, we could do that while controlling Cargo's strip settings via environment variables.