From 341a97990445d15d71aba5b9843d75cd58c66c81 Mon Sep 17 00:00:00 2001 From: such-gitea Date: Sat, 24 Jan 2026 16:41:34 -0500 Subject: [PATCH] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 130 ++++++++++++++++++++---------------- 1 file changed, 73 insertions(+), 57 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 3a5ac84..f8540e6 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Build Wownero LWS (Static / Boost 1.90) +name: Build Wownero LWS (Split Jobs) on: push: branches: [ master, main ] @@ -11,7 +11,7 @@ env: jobs: # ================================================================== - # JOB 1: LINUX NATIVE (x86_64) - STRICT STATIC + # JOB 1: LINUX NATIVE (x86_64) # ================================================================== linux-native: runs-on: ubuntu-latest @@ -33,8 +33,9 @@ jobs: - name: Patch Source run: | - perl -pi -e 's/struct\s+rest_server::handler_loop\s+final/struct rest_server::handler_loop/g' src/rest_server.cpp - perl -pi -e 's/find_library\(ICU/# find_library(ICU/g' external/monero/CMakeLists.txt + # Broad regex to catch 'final' regardless of namespace qualification + perl -pi -e 's/handler_loop\s+final/handler_loop/g' src/rest_server.cpp + # Nuke Werror perl -pi -e 's/-Werror//g' CMakeLists.txt perl -pi -e 's/-Werror//g' external/monero/CMakeLists.txt @@ -44,26 +45,36 @@ jobs: mkdir -p /opt/wownero-sdk tar -xf sdk.tar.gz -C /opt/wownero-sdk - - name: Normalize SDK (The "Find It" Fix) + - name: Normalize SDK (Crucial Step) run: | + # 1. List files for debugging (so you can yell at me with proof if I fail) + echo "=== SDK CONTENT START ===" + find /opt/wownero-sdk -name "*.a" + echo "=== SDK CONTENT END ===" + + # 2. Find and Alias libraries + # This handles 'libzstd_pic.a' -> 'libzstd.a' mapping automatically cd /opt/wownero-sdk/lib - # Find zstd (handle _pic variant) - if [ ! -f libzstd.a ]; then - FOUND=$(find . -name "libzstd*.a" | head -n 1) - if [ ! -z "$FOUND" ]; then cp "$FOUND" libzstd.a; fi - fi - # Find zlib - if [ ! -f libz.a ]; then - FOUND=$(find . -name "libz*.a" | head -n 1) - if [ ! -z "$FOUND" ]; then cp "$FOUND" libz.a; fi - fi - # Find hidapi - if [ ! -f libhidapi.a ]; then - FOUND=$(find . -name "libhidapi*.a" | head -n 1) - if [ ! -z "$FOUND" ]; then cp "$FOUND" libhidapi.a; fi - fi - echo "SDK Library contents:" - ls -lh *.a + + find_and_copy() { + pattern=$1 + target=$2 + # Find the file, prefer exact match, then pattern + file=$(find . -name "$target" | head -n 1) + if [ -z "$file" ]; then + file=$(find . -name "$pattern" | head -n 1) + fi + + if [ ! -z "$file" ] && [ "$file" != "./$target" ]; then + echo "Aliasing $file to $target" + cp "$file" "$target" + fi + } + + find_and_copy "libzstd*.a" "libzstd.a" + find_and_copy "libz*.a" "libz.a" + find_and_copy "libhidapi*.a" "libhidapi.a" + find_and_copy "libusb*.a" "libusb-1.0.a" - name: Install Modern CMake run: | @@ -76,8 +87,7 @@ jobs: mkdir build && cd build SDK_DIR="/opt/wownero-sdk" - # Force finding libs in SDK. - # -static flag in linker forces purely static binary. + # Force Absolute Paths to the Normalized Libs cmake .. -DCMAKE_BUILD_TYPE=Release \ -DBUILD_STATIC=ON \ -DCMAKE_PREFIX_PATH="$SDK_DIR" \ @@ -98,12 +108,9 @@ jobs: -DHIDAPI_LIBRARY="$SDK_DIR/lib/libhidapi.a" \ -DZSTD_LIBRARY="$SDK_DIR/lib/libzstd.a" \ -DZSTD_INCLUDE_DIR="$SDK_DIR/include" \ - -DZLIB_LIBRARY="$SDK_DIR/lib/libz.a" \ - -DZLIB_INCLUDE_DIR="$SDK_DIR/include" \ - -DLIBEVENT_LIBRARY="$SDK_DIR/lib/libevent.a" \ - -DLIBEVENT_INCLUDE_DIR="$SDK_DIR/include" \ - -DUSE_READLINE=OFF \ - -DCMAKE_EXE_LINKER_FLAGS="-static -L$SDK_DIR/lib" + -DLIBEVENT_LIBRARY=$SDK_DIR/lib/libevent.a \ + -DLIBEVENT_INCLUDE_DIR=$SDK_DIR/include \ + -DUSE_READLINE=OFF make -j$(nproc) @@ -119,7 +126,7 @@ jobs: path: release/*.tar.gz # ================================================================== - # JOB 2: LINUX CROSS (ARM64 / RISCV64) - STRICT STATIC + # JOB 2: LINUX CROSS (ARM64 / RISCV64) # ================================================================== linux-cross: runs-on: ubuntu-latest @@ -149,7 +156,7 @@ jobs: - name: Patch Source run: | - perl -pi -e 's/struct\s+rest_server::handler_loop\s+final/struct rest_server::handler_loop/g' src/rest_server.cpp + perl -pi -e 's/handler_loop\s+final/handler_loop/g' src/rest_server.cpp perl -pi -e 's/find_library\(ICU/# find_library(ICU/g' external/monero/CMakeLists.txt perl -pi -e 's/-Werror//g' CMakeLists.txt perl -pi -e 's/-Werror//g' external/monero/CMakeLists.txt @@ -160,12 +167,19 @@ jobs: mkdir -p /opt/wownero-sdk tar -xf sdk.tar.gz -C /opt/wownero-sdk - - name: Normalize SDK + - name: Normalize SDK (Crucial Step) run: | cd /opt/wownero-sdk/lib - if [ ! -f libzstd.a ]; then FOUND=$(find . -name "libzstd*.a" | head -n 1); if [ ! -z "$FOUND" ]; then cp "$FOUND" libzstd.a; fi; fi - if [ ! -f libz.a ]; then FOUND=$(find . -name "libz*.a" | head -n 1); if [ ! -z "$FOUND" ]; then cp "$FOUND" libz.a; fi; fi - if [ ! -f libhidapi.a ]; then FOUND=$(find . -name "libhidapi*.a" | head -n 1); if [ ! -z "$FOUND" ]; then cp "$FOUND" libhidapi.a; fi; fi + find_and_copy() { + pattern=$1; target=$2 + file=$(find . -name "$target" | head -n 1) + if [ -z "$file" ]; then file=$(find . -name "$pattern" | head -n 1); fi + if [ ! -z "$file" ] && [ "$file" != "./$target" ]; then cp "$file" "$target"; fi + } + find_and_copy "libzstd*.a" "libzstd.a" + find_and_copy "libz*.a" "libz.a" + find_and_copy "libhidapi*.a" "libhidapi.a" + ls -lh *.a - name: Install Modern CMake run: | @@ -175,19 +189,17 @@ jobs: - name: Generate Toolchain run: | - # NO SYSROOT set here to avoid the "compiler broken" error. - # We rely on the compiler wrapper to know where standard libs are. cat < cross.cmake set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_PROCESSOR ${{ matrix.proc }}) set(CMAKE_C_COMPILER ${{ matrix.target }}-gcc) set(CMAKE_CXX_COMPILER ${{ matrix.target }}-g++) - # Only look in SDK. + # Relaxed search mode to find RT/Pthread set(CMAKE_FIND_ROOT_PATH /opt/wownero-sdk) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) EOF @@ -196,8 +208,7 @@ jobs: mkdir build && cd build SDK_DIR="/opt/wownero-sdk" - # -static : Force fully static binary - # -lrt : Explicitly link librt (needed for Boost on Linux) + # Explicitly set RT library variable to 'rt' so CMake finds it in system cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross.cmake \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_STATIC=ON \ @@ -219,12 +230,12 @@ jobs: -DHIDAPI_LIBRARY="$SDK_DIR/lib/libhidapi.a" \ -DZSTD_LIBRARY="$SDK_DIR/lib/libzstd.a" \ -DZSTD_INCLUDE_DIR="$SDK_DIR/include" \ - -DZLIB_LIBRARY="$SDK_DIR/lib/libz.a" \ - -DZLIB_INCLUDE_DIR="$SDK_DIR/include" \ -DLIBEVENT_LIBRARY=$SDK_DIR/lib/libevent.a \ -DLIBEVENT_INCLUDE_DIR=$SDK_DIR/include \ - -DUSE_READLINE=OFF \ - -DCMAKE_EXE_LINKER_FLAGS="-static -L$SDK_DIR/lib -lrt" + -DZLIB_LIBRARY="$SDK_DIR/lib/libz.a" \ + -DZLIB_INCLUDE_DIR=$SDK_DIR/include \ + -DRT_LIBRARY=rt \ + -DUSE_READLINE=OFF make -j$(nproc) @@ -240,7 +251,7 @@ jobs: path: release/*.tar.gz # ================================================================== - # JOB 3: WINDOWS (x86_64) - STRICT STATIC + # JOB 3: WINDOWS (x86_64) # ================================================================== windows: runs-on: ubuntu-latest @@ -262,9 +273,10 @@ jobs: - name: Patch Source run: | - perl -pi -e 's/struct\s+rest_server::handler_loop\s+final/struct rest_server::handler_loop/g' src/rest_server.cpp - # Nuke all ICU checks (icuio, icuin, icuuc) + perl -pi -e 's/handler_loop\s+final/handler_loop/g' src/rest_server.cpp + # Nuke ICU checks completely perl -pi -e 's/find_library\(ICU/# find_library(ICU/g' external/monero/CMakeLists.txt + # Nuke ICONV check completely (Windows) perl -pi -e 's/find_library\(ICONV/# find_library(ICONV/g' external/monero/CMakeLists.txt perl -pi -e 's/-Werror//g' CMakeLists.txt perl -pi -e 's/-Werror//g' external/monero/CMakeLists.txt @@ -278,10 +290,16 @@ jobs: - name: Normalize SDK & Dummy RT run: | cd /opt/wownero-sdk/lib - if [ ! -f libzstd.a ]; then FOUND=$(find . -name "libzstd*.a" | head -n 1); if [ ! -z "$FOUND" ]; then cp "$FOUND" libzstd.a; fi; fi - if [ ! -f libz.a ]; then FOUND=$(find . -name "libz*.a" | head -n 1); if [ ! -z "$FOUND" ]; then cp "$FOUND" libz.a; fi; fi - if [ ! -f libhidapi.a ]; then FOUND=$(find . -name "libhidapi*.a" | head -n 1); if [ ! -z "$FOUND" ]; then cp "$FOUND" libhidapi.a; fi; fi - if [ ! -f libiconv.a ]; then FOUND=$(find . -name "libiconv*.a" | head -n 1); if [ ! -z "$FOUND" ]; then cp "$FOUND" libiconv.a; fi; fi + find_and_copy() { + pattern=$1; target=$2 + file=$(find . -name "$target" | head -n 1) + if [ -z "$file" ]; then file=$(find . -name "$pattern" | head -n 1); fi + if [ ! -z "$file" ] && [ "$file" != "./$target" ]; then cp "$file" "$target"; fi + } + find_and_copy "libzstd*.a" "libzstd.a" + find_and_copy "libz*.a" "libz.a" + find_and_copy "libhidapi*.a" "libhidapi.a" + find_and_copy "libiconv*.a" "libiconv.a" # DUMMY RT FOR WINDOWS echo "" > dummy.c @@ -390,10 +408,8 @@ jobs: - name: Patch Source run: | - perl -pi -e 's/struct\s+rest_server::handler_loop\s+final/struct rest_server::handler_loop/g' src/rest_server.cpp + perl -pi -e 's/handler_loop\s+final/handler_loop/g' src/rest_server.cpp perl -pi -e 's/find_library\(ICU/# find_library(ICU/g' external/monero/CMakeLists.txt - perl -pi -e 's/-Werror//g' CMakeLists.txt - perl -pi -e 's/-Werror//g' external/monero/CMakeLists.txt - name: Install CMake run: brew install cmake