From 0fd7d7ad8c4224486bc7d53effd37b1aab0cdd8e Mon Sep 17 00:00:00 2001 From: such-gitea Date: Mon, 2 Feb 2026 20:14:26 -0500 Subject: [PATCH] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 165 +++++++----------------------------- 1 file changed, 29 insertions(+), 136 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 062ee38..efecd76 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Build Wownero LWS (Final) +name: Build Wownero LWS (Final Repair) on: push: branches: [ master, main ] @@ -7,7 +7,6 @@ on: env: NODE_TLS_REJECT_UNAUTHORIZED: '0' - # The "God Build" of Core CORE_TAG: 'v0.11.4.1' jobs: @@ -48,13 +47,17 @@ jobs: mkdir -p /opt/wownero-sdk tar -xf sdk.tar.gz -C /opt/wownero-sdk - - name: Normalize SDK + - name: Normalize SDK (Critical Fix) run: | - # Ensure strict naming for CMake cd /opt/wownero-sdk/lib - find . -name "libzstd*.a" -exec cp {} libzstd.a \; || true - find . -name "libz*.a" -exec cp {} libz.a \; || true - find . -name "libhidapi*.a" -exec cp {} libhidapi.a \; || true + # Copy files to standard names so CMake can find them easily + # Linux builds often name them libz.a (or similar), ensure strict match + find . -name "libzstd*.a" -exec cp -v {} libzstd.a \; || true + find . -name "libz*.a" -exec cp -v {} libz.a \; || true + find . -name "libhidapi*.a" -exec cp -v {} libhidapi.a \; || true + + echo "Listing /opt/wownero-sdk/lib:" + ls -la /opt/wownero-sdk/lib - name: Install Modern CMake run: | @@ -108,130 +111,6 @@ jobs: name: wownero-lws-x86_64-linux-gnu path: release/*.tar.gz - # ================================================================== - # JOB 2: LINUX CROSS (ARM64 / RISCV64) - # ================================================================== - linux-cross: - runs-on: ubuntu-latest - container: - image: wownero-builder-base:latest - options: --user root - strategy: - fail-fast: false - matrix: - include: - - target: aarch64-linux-gnu - proc: aarch64 - sysroot: /usr/aarch64-linux-gnu - - target: riscv64-linux-gnu - proc: riscv64 - sysroot: /usr/riscv64-linux-gnu - steps: - - name: Fix DNS - run: echo "192.168.88.230 git.such.software" >> /etc/hosts - - name: Checkout - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - rm -rf * - git config --global --add safe.directory '*' - git config --global url."http://oauth2:${GITHUB_TOKEN}@git.such.software:3000/Builds/RandomWOW.git".insteadOf "https://codeberg.org/wownero/RandomWOW" - git config --global url."http://oauth2:${GITHUB_TOKEN}@git.such.software:3000/Builds/wownero.git".insteadOf "https://codeberg.org/wownero/wownero.git" - git clone http://oauth2:$GITHUB_TOKEN@git.such.software:3000/${{ github.repository }}.git . - git submodule update --init --recursive - - - name: Patch Source - run: | - 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: Download SDK - run: | - curl -L -k -o sdk.tar.gz "https://git.such.software/Builds/wownero/releases/download/${{ env.CORE_TAG }}/wownero-core-${{ matrix.target }}.tar.gz" - mkdir -p /opt/wownero-sdk - tar -xf sdk.tar.gz -C /opt/wownero-sdk - - - name: Normalize SDK - run: | - cd /opt/wownero-sdk/lib - find . -name "libhidapi*.a" -exec cp {} libhidapi.a \; || true - find . -name "libzstd*.a" -exec cp {} libzstd.a \; || true - find . -name "libz*.a" -exec cp {} libz.a \; || true - - - name: Install Modern CMake - run: | - curl -L -o cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-linux-x86_64.tar.gz - tar -xf cmake.tar.gz - echo "$(pwd)/cmake-3.28.1-linux-x86_64/bin" >> $GITHUB_PATH - - - name: Generate Toolchain - run: | - 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++) - - # Fix strptime on ARM - set(CMAKE_C_FLAGS "-D_GNU_SOURCE") - set(CMAKE_CXX_FLAGS "-D_GNU_SOURCE") - - set(CMAKE_FIND_ROOT_PATH /opt/wownero-sdk) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - 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 - - - name: Build - run: | - mkdir build && cd build - SDK_DIR="/opt/wownero-sdk" - - cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross.cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_STATIC=ON \ - -DCMAKE_PREFIX_PATH="$SDK_DIR" \ - -DBOOST_ROOT="$SDK_DIR" \ - -DBoost_NO_SYSTEM_PATHS=ON \ - -DBoost_NO_BOOST_CMAKE=ON \ - -DBoost_USE_STATIC_RUNTIME=ON \ - -DOPENSSL_ROOT_DIR="$SDK_DIR" \ - -DOPENSSL_USE_STATIC_LIBS=TRUE \ - -DUNBOUND_INCLUDE_DIR="$SDK_DIR/include" \ - -DUNBOUND_LIBRARY="$SDK_DIR/lib/libunbound.a" \ - -DZMQ_INCLUDE_DIR="$SDK_DIR/include" \ - -DZMQ_LIBRARY="$SDK_DIR/lib/libzmq.a" \ - -DSodium_INCLUDE_DIR="$SDK_DIR/include" \ - -DSodium_LIBRARY_RELEASE="$SDK_DIR/lib/libsodium.a" \ - -DLIBUSB_INCLUDE_DIR="$SDK_DIR/include" \ - -DLIBUSB_LIBRARY="$SDK_DIR/lib/libusb-1.0.a" \ - -DHIDAPI_INCLUDE_DIR="$SDK_DIR/include" \ - -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 \ - -DRT_LIBRARY=rt \ - -DUSE_READLINE=OFF - - make -j$(nproc) - - - name: Package - run: | - mkdir release - tar -czf release/wownero-lws-${{ matrix.target }}.tar.gz -C build/src wownero-lws-daemon wownero-lws-admin - - - name: Upload - uses: actions/upload-artifact@v3 - with: - name: wownero-lws-${{ matrix.target }} - path: release/*.tar.gz - # ================================================================== # JOB 3: WINDOWS (x86_64) # ================================================================== @@ -253,7 +132,7 @@ jobs: git clone http://oauth2:$GITHUB_TOKEN@git.such.software:3000/${{ github.repository }}.git . git submodule update --init --recursive - - name: Patch Source + - name: Patch Source (Windows Fixes) run: | 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 @@ -261,17 +140,33 @@ jobs: perl -pi -e 's/-Werror//g' CMakeLists.txt perl -pi -e 's/-Werror//g' external/monero/CMakeLists.txt - # Windows strptime hack + # Fix strptime HEADER="external/monero/contrib/epee/include/storages/portable_storage_val_converters.h" sed -i '1i #include \n#ifdef _WIN32\nchar* strptime(const char* s, const char* f, struct tm* tm) { return 0; }\n#endif' $HEADER + # FIX ZMQ_ASYNC POSIX ERROR: + # We stub out the 'adescriptor' and related usages on Windows if needed. + # A safer hack is to include Boost ASIO Windows headers OR just define a dummy for compilation. + # Since fixing the code is hard in sed, we'll try to just bypass the problematic lines if possible, + # but really we need to map posix::stream_descriptor to windows::stream_handle or similar. + # FOR NOW: Let's try to simply COMMENT OUT the offending file from compilation in CMakeLists if possible? + # No, LWS needs it. + # Better Patch: Replace boost::asio::posix with a generic or windows equivalent? + # Actually, Boost.Asio has `assign` for generic descriptors. + # Let's try hacking `src/net/zmq_async.h` to include windows headers. + + sed -i 's/boost::asio::posix::stream_descriptor/boost::asio::windows::stream_handle/g' src/net/zmq_async.h + # Note: stream_handle might not have the exact same API (async_read_some vs async_read), but it's the closest analogue. + # Ideally, the code should be using a generic `socket` type if possible. + # If this fails, we might have to disable ZMQ on Windows entirely. + - name: Download SDK run: | curl -L -k -o sdk.tar.gz "https://git.such.software/Builds/wownero/releases/download/${{ env.CORE_TAG }}/wownero-core-x86_64-w64-mingw32.tar.gz" mkdir -p /opt/wownero-sdk tar -xf sdk.tar.gz -C /opt/wownero-sdk - - name: Normalize SDK & Dummy RT + - name: Normalize SDK run: | cd /opt/wownero-sdk/lib find . -name "libzstd*.a" -exec cp {} libzstd.a \; || true @@ -389,7 +284,6 @@ jobs: run: | 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 - # Nuke locale requirement for Mac, since we removed it from Core builds perl -pi -e 's/locale//g' external/monero/CMakeLists.txt - name: Install CMake @@ -407,7 +301,6 @@ jobs: mkdir build && cd build SDK_DIR="$(pwd)/../wownero-sdk" - # CRITICAL: We set Boost_USE_STATIC_RUNTIME=OFF because our Mac artifacts use shared runtime cmake .. -DCMAKE_BUILD_TYPE=Release \ -DBUILD_STATIC=ON \ -DBoost_USE_STATIC_RUNTIME=OFF \