File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 252
252
253
253
workspace_root=$( jq <<< " ${metadata}" -r ' .workspace_root' )
254
254
# TODO: This is a somewhat rough check as it does not look at the type of profile.
255
- if ! grep -Eq ' ^strip\s*=' " ${workspace_root} /Cargo.toml" && [[ -z " ${CARGO_PROFILE_RELEASE_STRIP:- } " ]]; then
255
+ if ! grep -Eq ' ^\s* strip\s*=' " ${workspace_root} /Cargo.toml" && [[ -z " ${CARGO_PROFILE_RELEASE_STRIP:- } " ]]; then
256
256
# On pre-1.77, align to Cargo 1.77+'s default: https://github.com/rust-lang/cargo/pull/13257
257
+ # However, set env on pre-1.79 because it is 1.79+ that actually works correctly due to https://github.com/rust-lang/cargo/issues/13617.
257
258
# strip option builds requires Cargo 1.59
258
- if [[ " ${rustc_minor_version} " -lt 77 ]] && [[ " ${rustc_minor_version} " -ge 59 ]]; then
259
- export CARGO_PROFILE_RELEASE_STRIP=debuginfo
260
- fi
259
+ case " ${target} " in
260
+ # Do not strip debuginfo on MSVC https://github.com/rust-lang/cargo/pull/13630
261
+ # This is the same behavior as pre-1.19.0 upload-rust-binary-action.
262
+ * -pc-windows-msvc) ;;
263
+ * )
264
+ if [[ " ${rustc_minor_version} " -lt 79 ]] && [[ " ${rustc_minor_version} " -ge 59 ]]; then
265
+ export CARGO_PROFILE_RELEASE_STRIP=debuginfo
266
+ fi
267
+ ;;
268
+ esac
261
269
fi
262
270
263
271
build () {
You can’t perform that action at this time.
0 commit comments