From 1cc95fbd104992b63dc630d59207a5db87ecd624 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Thu, 15 Jan 2026 14:42:19 +0100 Subject: [PATCH] fix(local-build): Add Go compiler and target preparation to toolchain build - Add target/compile step to build kernel and prepare target environment - Add golang/host/compile step to build host Go compiler for Go packages - Combine tools/install and toolchain/install with target/compile for complete prereq build - Use print_warning instead of error for non-fatal build issues This fixes the toolchain build to properly support Go packages (secubox-app-cs-firewall-bouncer, secubox-app-crowdsec) which require the host Go compiler. Co-Authored-By: Claude Opus 4.5 --- secubox-tools/local-build.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/secubox-tools/local-build.sh b/secubox-tools/local-build.sh index 464795d8..704a83a4 100755 --- a/secubox-tools/local-build.sh +++ b/secubox-tools/local-build.sh @@ -2117,6 +2117,24 @@ EOF print_info "Downloading package sources..." make download -j$(nproc) V=s 2>&1 | grep -v "^make\[" || true + # Build prerequisite targets first + # This builds tools, toolchain, and target preparation in one step + print_header "Building Prerequisites (Tools + Toolchain)" + print_info "This may take 1-2 hours on first run..." + + # Build tools, toolchain, and target preparation (needed for packages) + if ! make tools/install toolchain/install target/compile V=s -j$(nproc) 2>&1 | tee build-prereqs.log; then + print_warning "Prerequisites build had issues, continuing..." + fi + print_success "Prerequisites built" + + # Build Go compiler for host (needed for Go packages) + print_header "Building Go Compiler (for Go packages)" + if ! make package/feeds/packages/lang/golang/host/compile V=s -j$(nproc) 2>&1 | tee build-golang.log; then + print_warning "Go compiler build had issues, some packages may fail" + fi + print_success "Go compiler ready" + # Build specific packages or all native SecuBox packages print_header "Compiling Native Packages"