Skip to content

Commit 81be487

Browse files
committed
Merge branch 'strip-binaries-with-cargo'
2 parents a27ec77 + 321e5c8 commit 81be487

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ once_cell = "1.13"
7171
[profile.release]
7272
opt-level = 3
7373
lto = true
74+
strip = true
7475

7576
# Key generation may take over one minute without optimizations
7677
# enabled.

build.sh

+3-13
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,12 @@ function sign_win {
200200
}
201201

202202
# Build the daemon and other Rust/C++ binaries, optionally
203-
# sign them, strip them of debug symbols and copy to `dist-assets/`.
203+
# sign them, and copy to `dist-assets/`.
204204
function build {
205205
local current_target=${1:-""}
206206
local for_target_string=" for local target $HOST"
207-
local stripbin="strip"
208207
if [[ -n $current_target ]]; then
209208
for_target_string=" for $current_target"
210-
211-
if [[ "$current_target" == "aarch64-unknown-linux-gnu" && "$(uname -m)" != "aarch64" ]]; then
212-
stripbin="aarch64-linux-gnu-strip"
213-
fi
214209
fi
215210

216211
################################################################################
@@ -287,13 +282,8 @@ function build {
287282
local source="$cargo_output_dir/$binary"
288283
local destination="$destination_dir/$binary"
289284

290-
if [[ "$(uname -s)" == "MINGW"* || "$binary" == *.dylib ]]; then
291-
log_info "Copying $source => $destination"
292-
cp "$source" "$destination"
293-
else
294-
log_info "Stripping $source => $destination"
295-
"${stripbin}" "$source" -o "$destination"
296-
fi
285+
log_info "Copying $source => $destination"
286+
cp "$source" "$destination"
297287

298288
if [[ "$SIGN" == "true" && "$(uname -s)" == "MINGW"* ]]; then
299289
sign_win "$destination"

0 commit comments

Comments
 (0)