forked from such-gitea/wownero-lws
Update .gitea/workflows/build.yaml
Some checks failed
Build Wownero LWS (Split Jobs) / macos (arm64, macos-arm64, aarch64-apple-darwin11) (push) Failing after 2m2s
Build Wownero LWS (Split Jobs) / linux-native (push) Failing after 2m40s
Build Wownero LWS (Split Jobs) / macos (x86_64, macos-x64, x86_64-apple-darwin11) (push) Failing after 59s
Build Wownero LWS (Split Jobs) / linux-cross (aarch64, /usr/aarch64-linux-gnu, aarch64-linux-gnu) (push) Failing after 3m7s
Build Wownero LWS (Split Jobs) / linux-cross (riscv64, /usr/riscv64-linux-gnu, riscv64-linux-gnu) (push) Failing after 1m34s
Build Wownero LWS (Split Jobs) / windows (push) Failing after 2m52s
Some checks failed
Build Wownero LWS (Split Jobs) / macos (arm64, macos-arm64, aarch64-apple-darwin11) (push) Failing after 2m2s
Build Wownero LWS (Split Jobs) / linux-native (push) Failing after 2m40s
Build Wownero LWS (Split Jobs) / macos (x86_64, macos-x64, x86_64-apple-darwin11) (push) Failing after 59s
Build Wownero LWS (Split Jobs) / linux-cross (aarch64, /usr/aarch64-linux-gnu, aarch64-linux-gnu) (push) Failing after 3m7s
Build Wownero LWS (Split Jobs) / linux-cross (riscv64, /usr/riscv64-linux-gnu, riscv64-linux-gnu) (push) Failing after 1m34s
Build Wownero LWS (Split Jobs) / windows (push) Failing after 2m52s
This commit is contained in:
@@ -28,53 +28,49 @@ jobs:
|
||||
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: |
|
||||
# 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/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
|
||||
perl -pi -e 's/-Werror//g' CMakeLists.txt
|
||||
perl -pi -e 's/-Werror//g' external/monero/CMakeLists.txt
|
||||
|
||||
- name: Build Static Deps (ZLIB/ZSTD)
|
||||
run: |
|
||||
mkdir -p deps/lib deps/include
|
||||
cd deps
|
||||
|
||||
# ZLIB
|
||||
curl -L -o zlib.tar.gz https://zlib.net/zlib-1.3.1.tar.gz
|
||||
tar -xf zlib.tar.gz && cd zlib-1.3.1
|
||||
./configure --static --prefix=$(pwd)/..
|
||||
make install
|
||||
cd ..
|
||||
|
||||
# ZSTD
|
||||
curl -L -o zstd.tar.gz https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz
|
||||
tar -xf zstd.tar.gz && cd zstd-1.5.5
|
||||
# Simple make for static lib
|
||||
make lib-release
|
||||
cp lib/libzstd.a ../lib/
|
||||
cp lib/zstd.h ../include/
|
||||
cd ..
|
||||
|
||||
- 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-linux-gnu.tar.gz"
|
||||
mkdir -p /opt/wownero-sdk
|
||||
tar -xf sdk.tar.gz -C /opt/wownero-sdk
|
||||
|
||||
- name: Normalize SDK (Crucial Step)
|
||||
- name: Fix Libraries
|
||||
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_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"
|
||||
if [ -f /opt/wownero-sdk/lib/libhidapi-libusb.a ] && [ ! -f /opt/wownero-sdk/lib/libhidapi.a ]; then
|
||||
cp /opt/wownero-sdk/lib/libhidapi-libusb.a /opt/wownero-sdk/lib/libhidapi.a
|
||||
fi
|
||||
|
||||
- name: Install Modern CMake
|
||||
run: |
|
||||
@@ -86,11 +82,11 @@ jobs:
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
SDK_DIR="/opt/wownero-sdk"
|
||||
DEPS_DIR="$(pwd)/../deps"
|
||||
|
||||
# Force Absolute Paths to the Normalized Libs
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_STATIC=ON \
|
||||
-DCMAKE_PREFIX_PATH="$SDK_DIR" \
|
||||
-DCMAKE_PREFIX_PATH="$SDK_DIR;$DEPS_DIR" \
|
||||
-DBOOST_ROOT="$SDK_DIR" \
|
||||
-DBoost_NO_SYSTEM_PATHS=ON \
|
||||
-DBoost_NO_BOOST_CMAKE=ON \
|
||||
@@ -106,11 +102,15 @@ jobs:
|
||||
-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" \
|
||||
-DZSTD_LIBRARY="$DEPS_DIR/lib/libzstd.a" \
|
||||
-DZSTD_INCLUDE_DIR="$DEPS_DIR/include" \
|
||||
-DZLIB_LIBRARY="$DEPS_DIR/lib/libz.a" \
|
||||
-DZLIB_INCLUDE_DIR="$DEPS_DIR/include" \
|
||||
-DLIBEVENT_LIBRARY=$SDK_DIR/lib/libevent.a \
|
||||
-DLIBEVENT_INCLUDE_DIR=$SDK_DIR/include \
|
||||
-DUSE_READLINE=OFF
|
||||
-DUSE_READLINE=OFF \
|
||||
-DCMAKE_CXX_FLAGS="-D_GNU_SOURCE" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-static"
|
||||
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -139,8 +139,10 @@ jobs:
|
||||
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
|
||||
@@ -156,30 +158,43 @@ jobs:
|
||||
|
||||
- name: Patch Source
|
||||
run: |
|
||||
perl -pi -e 's/handler_loop\s+final/handler_loop/g' src/rest_server.cpp
|
||||
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
|
||||
perl -pi -e 's/-Werror//g' CMakeLists.txt
|
||||
perl -pi -e 's/-Werror//g' external/monero/CMakeLists.txt
|
||||
|
||||
- name: Build Static Deps (ZLIB/ZSTD) Cross
|
||||
run: |
|
||||
mkdir -p deps/lib deps/include
|
||||
cd deps
|
||||
|
||||
# ZLIB Cross
|
||||
curl -L -o zlib.tar.gz https://zlib.net/zlib-1.3.1.tar.gz
|
||||
tar -xf zlib.tar.gz && cd zlib-1.3.1
|
||||
CC=${{ matrix.target }}-gcc ./configure --static --prefix=$(pwd)/..
|
||||
make install
|
||||
cd ..
|
||||
|
||||
# ZSTD Cross
|
||||
curl -L -o zstd.tar.gz https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz
|
||||
tar -xf zstd.tar.gz && cd zstd-1.5.5
|
||||
# Set CC/CXX for cross compilation
|
||||
CC=${{ matrix.target }}-gcc CXX=${{ matrix.target }}-g++ AR=${{ matrix.target }}-ar make lib-release
|
||||
cp lib/libzstd.a ../lib/
|
||||
cp lib/zstd.h ../include/
|
||||
cd ..
|
||||
|
||||
- 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 (Crucial Step)
|
||||
- name: Fix Libraries
|
||||
run: |
|
||||
cd /opt/wownero-sdk/lib
|
||||
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
|
||||
if [ -f /opt/wownero-sdk/lib/libhidapi-libusb.a ] && [ ! -f /opt/wownero-sdk/lib/libhidapi.a ]; then
|
||||
cp /opt/wownero-sdk/lib/libhidapi-libusb.a /opt/wownero-sdk/lib/libhidapi.a
|
||||
fi
|
||||
|
||||
- name: Install Modern CMake
|
||||
run: |
|
||||
@@ -194,8 +209,10 @@ jobs:
|
||||
set(CMAKE_SYSTEM_PROCESSOR ${{ matrix.proc }})
|
||||
set(CMAKE_C_COMPILER ${{ matrix.target }}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${{ matrix.target }}-g++)
|
||||
# Explicitly set CFLAGS to fix strptime issue
|
||||
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)
|
||||
|
||||
# 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 BOTH)
|
||||
@@ -207,12 +224,13 @@ jobs:
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
SDK_DIR="/opt/wownero-sdk"
|
||||
DEPS_DIR="$(pwd)/../deps"
|
||||
|
||||
# Explicitly set RT library variable to 'rt' so CMake finds it in system
|
||||
# -lrt needs to be explicit for cross builds sometimes
|
||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross.cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_STATIC=ON \
|
||||
-DCMAKE_PREFIX_PATH="$SDK_DIR" \
|
||||
-DCMAKE_PREFIX_PATH="$SDK_DIR;$DEPS_DIR" \
|
||||
-DBOOST_ROOT="$SDK_DIR" \
|
||||
-DBoost_NO_SYSTEM_PATHS=ON \
|
||||
-DBoost_NO_BOOST_CMAKE=ON \
|
||||
@@ -228,12 +246,12 @@ jobs:
|
||||
-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" \
|
||||
-DZSTD_LIBRARY="$DEPS_DIR/lib/libzstd.a" \
|
||||
-DZSTD_INCLUDE_DIR="$DEPS_DIR/include" \
|
||||
-DZLIB_LIBRARY="$DEPS_DIR/lib/libz.a" \
|
||||
-DZLIB_INCLUDE_DIR="$DEPS_DIR/include" \
|
||||
-DLIBEVENT_LIBRARY=$SDK_DIR/lib/libevent.a \
|
||||
-DLIBEVENT_INCLUDE_DIR=$SDK_DIR/include \
|
||||
-DZLIB_LIBRARY="$SDK_DIR/lib/libz.a" \
|
||||
-DZLIB_INCLUDE_DIR=$SDK_DIR/include \
|
||||
-DRT_LIBRARY=rt \
|
||||
-DUSE_READLINE=OFF
|
||||
|
||||
@@ -273,13 +291,17 @@ jobs:
|
||||
|
||||
- name: Patch Source
|
||||
run: |
|
||||
perl -pi -e 's/handler_loop\s+final/handler_loop/g' src/rest_server.cpp
|
||||
# Nuke ICU checks completely
|
||||
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
|
||||
# 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
|
||||
|
||||
# FORCE PATCH STRPTIME for Windows
|
||||
# This replaces #include <string> with #include <string>\n#include <ctime>
|
||||
# And effectively forces the compiler to ignore the strptime missing error by providing a dummy or relying on other headers
|
||||
# Actually, easiest hack for Windows builds in Monero deps is usually defining it away or using a polyfill.
|
||||
# We will try defining _GNU_SOURCE globally first.
|
||||
|
||||
- name: Download SDK
|
||||
run: |
|
||||
@@ -287,24 +309,14 @@ jobs:
|
||||
mkdir -p /opt/wownero-sdk
|
||||
tar -xf sdk.tar.gz -C /opt/wownero-sdk
|
||||
|
||||
- name: Normalize SDK & Dummy RT
|
||||
- name: Fix Libraries & Dummy RT
|
||||
run: |
|
||||
cd /opt/wownero-sdk/lib
|
||||
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
|
||||
if [ -f /opt/wownero-sdk/lib/libhidapi-libusb.a ] && [ ! -f /opt/wownero-sdk/lib/libhidapi.a ]; then
|
||||
cp /opt/wownero-sdk/lib/libhidapi-libusb.a /opt/wownero-sdk/lib/libhidapi.a
|
||||
fi
|
||||
echo "" > dummy.c
|
||||
x86_64-w64-mingw32-gcc -c dummy.c -o dummy.o
|
||||
x86_64-w64-mingw32-ar rcs librt.a dummy.o
|
||||
x86_64-w64-mingw32-ar rcs /opt/wownero-sdk/lib/librt.a dummy.o
|
||||
|
||||
- name: Install Modern CMake
|
||||
run: |
|
||||
@@ -321,6 +333,9 @@ jobs:
|
||||
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
||||
|
||||
# Fix for strptime:
|
||||
set(CMAKE_CXX_FLAGS "-DWIN32_LEAN_AND_MEAN" 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 ONLY)
|
||||
@@ -335,6 +350,18 @@ jobs:
|
||||
mkdir build && cd build
|
||||
SDK_DIR="/opt/wownero-sdk"
|
||||
|
||||
# Windows has ZLIB in SDK, we found that out.
|
||||
LIBZ=$(find $SDK_DIR -name libz.a | head -n 1)
|
||||
if [ -z "$LIBZ" ]; then LIBZ="$SDK_DIR/lib/libz.a"; fi
|
||||
|
||||
# ZSTD too
|
||||
LIBZSTD=$(find $SDK_DIR -name libzstd.a | head -n 1)
|
||||
if [ -z "$LIBZSTD" ]; then LIBZSTD="$SDK_DIR/lib/libzstd.a"; fi
|
||||
|
||||
# ICONV too
|
||||
LIBICONV=$(find $SDK_DIR -name libiconv.a | head -n 1)
|
||||
if [ -z "$LIBICONV" ]; then LIBICONV="$SDK_DIR/lib/libiconv.a"; fi
|
||||
|
||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross.cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_STATIC=ON \
|
||||
@@ -354,12 +381,13 @@ jobs:
|
||||
-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" \
|
||||
-DZSTD_LIBRARY="$LIBZSTD" \
|
||||
-DZSTD_INCLUDE_DIR=$SDK_DIR/include \
|
||||
-DLIBEVENT_LIBRARY=$SDK_DIR/lib/libevent.a \
|
||||
-DLIBEVENT_INCLUDE_DIR=$SDK_DIR/include \
|
||||
-DICONV_LIBRARY="$SDK_DIR/lib/libiconv.a" \
|
||||
-DICONV_LIBRARY="$LIBICONV" \
|
||||
-DICONV_INCLUDE_DIR=$SDK_DIR/include \
|
||||
-DICONV_LIBRARIES="$LIBICONV" \
|
||||
-DRT_LIBRARY=$SDK_DIR/lib/librt.a \
|
||||
-DUSE_READLINE=OFF \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-static -Wl,--allow-multiple-definition"
|
||||
@@ -408,7 +436,7 @@ jobs:
|
||||
|
||||
- name: Patch Source
|
||||
run: |
|
||||
perl -pi -e 's/handler_loop\s+final/handler_loop/g' src/rest_server.cpp
|
||||
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
|
||||
|
||||
- name: Install CMake
|
||||
|
||||
Reference in New Issue
Block a user