diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 1698951..a4a6f0b 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Build Wownero LWS (Symlink + Manual Git) +name: Build Wownero LWS (Double Symlink Fix) on: push: branches: [ master, main ] @@ -11,7 +11,7 @@ env: jobs: # ================================================================== - # JOB 1: LINUX NATIVE (x86_64) - Symlink Fix + # JOB 1: LINUX NATIVE (x86_64) - Double Symlink Fix # ================================================================== linux-native: runs-on: ubuntu-latest @@ -21,9 +21,11 @@ jobs: steps: - name: Fix DNS run: echo "192.168.88.230 git.such.software" >> /etc/hosts - - name: Install Static System Libs - run: apt-get update && apt-get install -y libc6-dev + - name: Install Static System Libs + # We need libevent-dev to get the libevent.a file + run: apt-get update && apt-get install -y libc6-dev libevent-dev + - name: Manual Checkout env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -51,25 +53,30 @@ jobs: mkdir -p /opt/wownero-sdk tar -xf sdk.tar.gz -C /opt/wownero-sdk - - name: Normalize SDK & Create Symlink + - name: Normalize SDK & Symlink System Libs run: | cd /opt/wownero-sdk/lib find . -name "libzstd*.a" -exec cp -n {} libzstd.a \; || true find . -name "libz*.a" ! -name "*zmq*" -exec cp -n {} libz.a \; || true find . -name "libhidapi*.a" -exec cp -n {} libhidapi.a \; || true - # SYMLINK FIX: Find system librt.a and link it HERE. - # This tricks CMake into finding it "inside" our SDK without nuking the system. + # FIX 1: Symlink system librt.a SYSTEM_RT=$(find /usr -name "librt.a" | head -n 1) if [ -n "$SYSTEM_RT" ]; then - echo "Creating symlink for $SYSTEM_RT" ln -s "$SYSTEM_RT" librt.a + echo "Symlinked $SYSTEM_RT" else - echo "FATAL: System librt.a not found!" - exit 1 + echo "WARNING: System librt.a not found." + fi + + # FIX 2: Symlink system libevent.a (Forces Static Link) + SYSTEM_EVENT=$(find /usr -name "libevent.a" | head -n 1) + if [ -n "$SYSTEM_EVENT" ]; then + ln -s "$SYSTEM_EVENT" libevent.a + echo "Symlinked $SYSTEM_EVENT" + else + echo "WARNING: System libevent.a not found." fi - - ls -lh *.a - name: Install Modern CMake run: | @@ -82,7 +89,7 @@ jobs: mkdir build && cd build SDK_DIR="/opt/wownero-sdk" - # Note: We do NOT need to specify -DRT_LIBRARY because the symlink handles it. + # The -DLIBEVENT_LIBRARY flag points to our symlink, guaranteeing static linking. cmake .. -DCMAKE_BUILD_TYPE=Release \ -DBUILD_STATIC=ON \ -DCMAKE_PREFIX_PATH="$SDK_DIR" \ @@ -192,8 +199,10 @@ jobs: set(CMAKE_SYSTEM_PROCESSOR ${{ matrix.proc }}) set(CMAKE_C_COMPILER ${{ matrix.target }}-gcc) set(CMAKE_CXX_COMPILER ${{ matrix.target }}-g++) + # Explicit CFLAGS set(CMAKE_C_FLAGS "-D_GNU_SOURCE -D_XOPEN_SOURCE=700" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS "-D_GNU_SOURCE -D_XOPEN_SOURCE=700" CACHE STRING "" FORCE) + set(CMAKE_FIND_ROOT_PATH /opt/wownero-sdk) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) @@ -248,7 +257,7 @@ jobs: path: release/*.tar.gz # ================================================================== - # JOB 3: WINDOWS (x86_64) + # JOB 3: WINDOWS (x86_64) - Disable ZMQ Async # ================================================================== windows: runs-on: ubuntu-latest @@ -284,9 +293,8 @@ jobs: 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 FOR WINDOWS - sed -i '1s/^/#define _WIN32_WINNT 0x0601\n#define WIN32_LEAN_AND_MEAN\n#ifdef _WIN32\n#include \n#endif\n/' src/net/zmq_async.h - sed -i 's/boost::asio::posix::stream_descriptor/boost::asio::windows::stream_handle/g' src/net/zmq_async.h + # FIX 3: DISABLE ZMQ_ASYNC ON WINDOWS + sed -i '/zmq_async.cpp/d' src/net/CMakeLists.txt - name: Download SDK run: | @@ -302,7 +310,7 @@ jobs: find . -name "libhidapi*.a" -exec cp -n {} libhidapi.a \; || true find . -name "libiconv*.a" -exec cp -n {} libiconv.a \; || true - # Create dummy librt.a directly in lib + # Create dummy librt.a echo "" > dummy.c x86_64-w64-mingw32-gcc -c dummy.c -o dummy.o x86_64-w64-mingw32-ar rcs librt.a dummy.o @@ -430,6 +438,7 @@ jobs: mkdir build && cd build SDK_DIR="$(pwd)/../wownero-sdk" + # Explicitly set ZSTD and ZLIB to ensure we don't accidentally link system dylibs cmake .. -DCMAKE_BUILD_TYPE=Release \ -DBUILD_STATIC=ON \ -DBoost_USE_STATIC_RUNTIME=OFF \