Skip to content

Retain debug information in a separate file #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -53,4 +58,4 @@ cd "${CARGO_TARGET_DIR}/${TARGET_PROFILE}"
package "$BIN"
fi

) 1>&2
) 1>&2