Skip to content

Commit

Permalink
build: add option to build without debug symbols
Browse files Browse the repository at this point in the history
Signed-off-by: Niladri Halder <[email protected]>
  • Loading branch information
niladrih committed Oct 22, 2024
1 parent 1aba340 commit 995ca77
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ parse_common_arg() {
STATIC_LINKING="false"
shift
;;
---no-debug-symbols)
DISABLE_DEBUG_SYMBOLS="true"
shift
;;
--skip-bins)
shift
BUILD_BINARIES=
Expand Down Expand Up @@ -459,7 +463,7 @@ build_images() {
# the images we already have locally.
if [ -z "$SKIP_BUILD" ]; then
echo "Building $image:$TAG ..."
$NIX_BUILD --out-link "$archive-image" -A "images.$BUILD_TYPE.$archive" --arg allInOne "$ALL_IN_ONE" --arg incremental "$INCREMENTAL" --argstr product_prefix "$PRODUCT_PREFIX"
$NIX_BUILD --out-link "$archive-image" -A "images.$BUILD_TYPE.$archive" --arg allInOne "$ALL_IN_ONE" --arg noDebugSymbols "$DISABLE_DEBUG_SYMBOLS" --arg incremental "$INCREMENTAL" --argstr product_prefix "$PRODUCT_PREFIX"
if [ -n "$CONTAINER_LOAD" ]; then
container_load "$archive-image"
if [ "$image" != "$image_basename" ]; then
Expand Down Expand Up @@ -562,7 +566,7 @@ build_bins() {
mkdir -p "$BINARY_OUT_LINK"
for name in $BUILD_BINARIES; do
echo "Building static $name ..."
$NIX_BUILD --out-link "$BINARY_OUT_LINK/$name" -A "$PROJECT.$BUILD_TYPE.$name" --arg allInOne "$ALL_IN_ONE" --arg static "$STATIC_LINKING"
$NIX_BUILD --out-link "$BINARY_OUT_LINK/$name" -A "$PROJECT.$BUILD_TYPE.$name" --arg allInOne "$ALL_IN_ONE" --arg static "$STATIC_LINKING" --arg noDebugSymbols "$DISABLE_DEBUG_SYMBOLS"
done
fi
}
Expand Down Expand Up @@ -599,6 +603,7 @@ common_help() {
--incremental Builds components in two stages allowing for faster rebuilds during development.
--build-bins Builds all the static binaries.
--no-static-linking Don't build the binaries with static linking.
--no-debug-symbols Don't add debug symbols when building Rust binaries.
--build-bin Specify which binary to build.
--skip-bins Don't build the static binaries.
--build-binary-out <path> Specify the outlink path for the binaries (otherwise it's the current directory).
Expand Down Expand Up @@ -637,6 +642,7 @@ INCREMENTAL="false"
DEFAULT_BINARIES=${BUILD_BINARIES:-}
BUILD_BINARIES=
STATIC_LINKING="true"
DISABLE_DEBUG_SYMBOLS="false"
BINARY_OUT_LINK="."
CARGO_VENDOR_DIR=${CARGO_VENDOR_DIR:-}
CARGO_VENDOR_ATTEMPTS=${CARGO_VENDOR_ATTEMPTS:-25}
Expand Down

0 comments on commit 995ca77

Please sign in to comment.