From 23180a1b0e738b46cfa4eb41c064d46b6f2cd913 Mon Sep 17 00:00:00 2001 From: Jan De Landtsheer Date: Sat, 16 Aug 2025 20:23:25 +0200 Subject: [PATCH] Fix component build issues - Add binary detection logic for RFS build to handle different binary names - Remove non-existent 'vendored-openssl' feature from mycelium build - Add debugging output to show actual build results --- scripts/compile-components.sh | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/scripts/compile-components.sh b/scripts/compile-components.sh index 800cea9..116ac61 100755 --- a/scripts/compile-components.sh +++ b/scripts/compile-components.sh @@ -59,12 +59,29 @@ build_rust_component() { # Build with musl target for static linking cargo build --release --target x86_64-unknown-linux-musl - # Install binary to Alpine root - mkdir -p "$ALPINE_ROOT$install_path" - cp "target/x86_64-unknown-linux-musl/release/$binary_name" "$ALPINE_ROOT$install_path/" - chmod +x "$ALPINE_ROOT$install_path/$binary_name" + # Debug: Check what was actually built + echo " Checking build results..." + ls -la target/x86_64-unknown-linux-musl/release/ | grep -v "\.d$" | grep -v "\.rlib$" || true - echo " Success: $install_path/$binary_name installed to Alpine root (musl static)" + # Try to find the actual binary (might have different name) + local actual_binary="" + if [ -f "target/x86_64-unknown-linux-musl/release/$binary_name" ]; then + actual_binary="$binary_name" + else + # Look for executable files that might be our binary + actual_binary=$(find target/x86_64-unknown-linux-musl/release/ -maxdepth 1 -type f -executable ! -name "*.d" | head -1 | xargs basename 2>/dev/null || echo "") + fi + + if [ -n "$actual_binary" ] && [ -f "target/x86_64-unknown-linux-musl/release/$actual_binary" ]; then + # Install binary to Alpine root + mkdir -p "$ALPINE_ROOT$install_path" + cp "target/x86_64-unknown-linux-musl/release/$actual_binary" "$ALPINE_ROOT$install_path/$binary_name" + chmod +x "$ALPINE_ROOT$install_path/$binary_name" + echo " Success: $install_path/$binary_name installed to Alpine root (musl static, actual binary: $actual_binary)" + else + echo " Error: No executable binary found in target/x86_64-unknown-linux-musl/release/" + return 1 + fi return 0 } @@ -142,7 +159,8 @@ build_mycelium_component() { . ~/.cargo/env # Build with musl target for static linking from myceliumd directory - cargo build --release --target x86_64-unknown-linux-musl --features vendored-openssl + # Note: Removed --features vendored-openssl as it doesn't exist in current version + cargo build --release --target x86_64-unknown-linux-musl # Debug: Check what was actually built echo " Checking build results..."