Skip to content

Commit 8601073

Browse files
Fix strip command permission error in build script
- Add chmod u+w before stripping to ensure binary is writable - Move chmod +x before strip command for proper permissions - Add fallback with warning if strip fails (not critical for functionality) - Fix 'Permission denied' error when stripping Bazel-built binaries - Ensure build continues even if strip operation fails
1 parent 6e3de4b commit 8601073

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/build-deb.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ mkdir -p "$BIN_DIR"
3333
# Copy the Bazel-built binary to the temporary directory
3434
cp bazel-bin/src/perf_to_profile "$BIN_DIR/"
3535

36-
# Strip the binary to reduce size and remove debug symbols
37-
strip "$BIN_DIR/perf_to_profile"
38-
39-
# Make sure the binary is executable
36+
# Make sure the binary is writable and executable before stripping
37+
chmod u+w "$BIN_DIR/perf_to_profile"
4038
chmod +x "$BIN_DIR/perf_to_profile"
4139

40+
# Strip the binary to reduce size and remove debug symbols
41+
strip "$BIN_DIR/perf_to_profile" || echo "Warning: Could not strip binary (not critical)"
42+
4243
# Check binary dependencies for debugging
4344
echo "Binary dependencies:"
4445
ldd "$BIN_DIR/perf_to_profile" || echo "Static binary (no dynamic dependencies)"

0 commit comments

Comments
 (0)