Build production Shardok optimized and profileable (#8750)

This commit is contained in:
2026-07-21 22:22:54 -07:00
committed by GitHub
parent e5be07b3b8
commit 2785015212
3 changed files with 27 additions and 3 deletions
+21 -2
View File
@@ -68,12 +68,17 @@ jobs:
- name: Ensure Bazel installed
uses: ./.github/actions/setup-bazel
- name: Build Shardok ARM64 binary (cross-compile for Linux ARM64)
- name: Build optimized, profileable Shardok ARM64 binary
run: |
set -ex
echo "=== Building shardok-server binary for linux-aarch64 ==="
bazel build \
-c opt \
--strip=never \
--copt=-gline-tables-only \
--copt=-fno-omit-frame-pointer \
--linkopt=-Wl,--build-id=sha1 \
--platforms=//:linux_arm64 \
--extra_toolchains=@llvm_toolchain_linux_arm64//:cc-toolchain-aarch64-linux \
//src/main/cpp/net/eagle0/shardok:shardok-server
@@ -103,6 +108,15 @@ jobs:
else
echo "WARNING: Binary e_machine is $E_MACHINE (expected 00b7 for aarch64)"
fi
BINARY_DESCRIPTION=$(file "$LINUX_BIN")
echo "Binary description: $BINARY_DESCRIPTION"
for REQUIRED_TEXT in "ARM aarch64" "BuildID" "with debug_info" "not stripped"; do
if [[ "$BINARY_DESCRIPTION" != *"$REQUIRED_TEXT"* ]]; then
echo "ERROR: Profileable release binary is missing '$REQUIRED_TEXT'"
exit 1
fi
done
elif [ "$MAGIC" = "cfaeedfe" ] || [ "$MAGIC" = "cffaedfe" ]; then
echo "ERROR: Binary is Mach-O format (macOS) - cross-compilation failed!"
exit 1
@@ -111,13 +125,18 @@ jobs:
file "$LINUX_BIN" || true
fi
- name: Build Shardok ARM64 Docker image
- name: Build optimized, profileable Shardok ARM64 Docker image
id: build-shardok
run: |
set -ex
# Keep this in sync with the standalone binary build above.
bazel build \
-c opt \
--strip=never \
--copt=-gline-tables-only \
--copt=-fno-omit-frame-pointer \
--linkopt=-Wl,--build-id=sha1 \
--platforms=//:linux_arm64 \
--extra_toolchains=@llvm_toolchain_linux_arm64//:cc-toolchain-aarch64-linux \
//ci:shardok_server_image_arm64
+1 -1
View File
@@ -214,7 +214,7 @@ oci_push(
#
# Shardok Server ARM64 Docker Image (for the Hetzner deployment host)
#
# Build: bazel build //ci:shardok_server_image_arm64 --platforms=//:linux_arm64 --extra_toolchains=@llvm_toolchain_linux_arm64//:cc-toolchain-aarch64-linux
# Build: ./scripts/build_shardok_linux_arm64_ci.sh //ci:shardok_server_image_arm64
# Load: bazel run //ci:shardok_server_load_arm64
# Push: bazel run //ci:shardok_server_push_arm64
#
+5
View File
@@ -11,6 +11,11 @@ if [ -n "${BAZEL_OUTPUT_BASE:-}" ]; then
fi
"${bazel_cmd[@]}" build \
-c opt \
--strip=never \
--copt=-gline-tables-only \
--copt=-fno-omit-frame-pointer \
--linkopt=-Wl,--build-id=sha1 \
--platforms=//:linux_arm64 \
--extra_toolchains=@llvm_toolchain_linux_arm64//:cc-toolchain-aarch64-linux \
"$@" \