diff --git a/build.sh b/build.sh index 33cbab7..ffa3405 100755 --- a/build.sh +++ b/build.sh @@ -30,12 +30,17 @@ export CARGO_TARGET_DIR=$PWD/target/lambda function package() { file="$1" - strip "$file" + if [[ "${PROFILE}" == "release" ]]; then + objcopy --only-keep-debug "$file" "$file.debug" + objcopy --strip-debug --strip-unneeded "$file" + objcopy --add-gnu-debuglink="$file.debug" "$file" + fi rm "$file.zip" > 2&>/dev/null || true # note: would use printf "@ $(basename $file)\n@=bootstrap" | zipnote -w "$file.zip" # if not for https://bugs.launchpad.net/ubuntu/+source/zip/+bug/519611 if [ "$file" != ./bootstrap ] && [ "$file" != bootstrap ]; then mv "${file}" bootstrap + mv "${file}.debug" bootstrap.debug > 2&>/dev/null || true fi zip "$file.zip" bootstrap rm bootstrap @@ -53,4 +58,4 @@ cd "${CARGO_TARGET_DIR}/${TARGET_PROFILE}" package "$BIN" fi -) 1>&2 \ No newline at end of file +) 1>&2