forked from such-gitea/wownero
Update .gitea/workflows/build.yaml
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Build Wownero Core (No-Touch Fix)
|
||||
name: Build Wownero Core (Restored v0.11.4.2 + Fix)
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
@@ -52,66 +52,175 @@ jobs:
|
||||
tar -xf cmake.tar.gz
|
||||
echo "$(pwd)/cmake-3.28.1-linux-x86_64/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Build Standard Dependencies (Override Boost Version)
|
||||
# This is the EXACT logic from v0.11.4.2 that worked for compilation
|
||||
- name: Sanitize Makefiles (Restored Working Config)
|
||||
run: |
|
||||
# 1. CLEAN SLATE (Critical fix for "missing separator" errors)
|
||||
cd contrib/depends
|
||||
git checkout packages/packages.mk packages/boost.mk funcs.mk
|
||||
cd ../..
|
||||
|
||||
# 2. RESTORE UPSTREAM FILES (Just in case)
|
||||
curl -L -o contrib/depends/funcs.mk https://codeberg.org/wownero/wownero/raw/branch/master/contrib/depends/funcs.mk
|
||||
curl -L -o contrib/depends/packages/packages.mk https://codeberg.org/wownero/wownero/raw/branch/master/contrib/depends/packages/packages.mk
|
||||
|
||||
# 3. INJECT ZLIB/ZSTD via sed (Proven to work)
|
||||
sed -i 's/^packages :=.*/packages := boost openssl expat libusb hidapi protobuf libiconv sodium zeromq unbound zlib zstd/' contrib/depends/packages/packages.mk
|
||||
|
||||
# 4. GENERATE ZLIB.MK
|
||||
cat <<'EOF' > contrib/depends/packages/zlib.mk
|
||||
package=zlib
|
||||
$(package)_version=1.3.1
|
||||
$(package)_download_path=https://zlib.net/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts=--static
|
||||
endef
|
||||
define $(package)_config_cmds
|
||||
CHOST=${host} ./configure $($(package)_config_opts) --prefix=$($(package)_staging_prefix_dir)
|
||||
endef
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) libz.a
|
||||
endef
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) install
|
||||
endef
|
||||
EOF
|
||||
sed -i 's/^ /\t/' contrib/depends/packages/zlib.mk
|
||||
|
||||
# 5. GENERATE ZSTD.MK
|
||||
cat <<'EOF' > contrib/depends/packages/zstd.mk
|
||||
package=zstd
|
||||
$(package)_version=1.5.5
|
||||
$(package)_download_path=https://github.com/facebook/zstd/releases/download/v$($(package)_version)/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4
|
||||
define $(package)_build_cmds
|
||||
$(MAKE) -C lib libzstd.a
|
||||
endef
|
||||
define $(package)_stage_cmds
|
||||
cp lib/libzstd.a $($(package)_staging_prefix_dir)/lib/
|
||||
cp lib/zstd.h $($(package)_staging_prefix_dir)/include/
|
||||
endef
|
||||
EOF
|
||||
sed -i 's/^ /\t/' contrib/depends/packages/zstd.mk
|
||||
|
||||
# 6. GENERATE BOOST.MK (Boost 1.90)
|
||||
cat <<'EOF' > contrib/depends/packages/boost.mk
|
||||
package=boost
|
||||
$(package)_version=1.90.0
|
||||
$(package)_download_path=https://archives.boost.io/release/$($(package)_version)/source/
|
||||
$(package)_file_name=$(package)_$(subst .,_,$($(package)_version)).tar.bz2
|
||||
$(package)_sha256_hash=49551aff3b22cbc5c5a9ed3dbc92f0e23ea50a0f7325b0d198b705e8ee3fc305
|
||||
$(package)_dependencies=libiconv
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts_release=variant=release
|
||||
$(package)_config_opts_debug=variant=debug
|
||||
$(package)_config_opts+=--layout=system --user-config=user-config.jam
|
||||
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
|
||||
|
||||
$(package)_config_opts_linux=threadapi=pthread runtime-link=static
|
||||
$(package)_config_opts_darwin=target-os=darwin runtime-link=shared
|
||||
$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static
|
||||
$(package)_config_opts_x86_64_mingw32=address-model=64
|
||||
$(package)_config_opts_i686_mingw32=address-model=32
|
||||
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
|
||||
$(package)_config_opts_x86_64_darwin=address-model=64
|
||||
$(package)_config_opts_aarch64_darwin=address-model=64 architecture=arm binary-format=mach-o abi=aapcs
|
||||
|
||||
$(package)_toolset_$(host_os)=gcc
|
||||
$(package)_archiver_$(host_os)=$($(package)_ar)
|
||||
$(package)_toolset_darwin=darwin
|
||||
$(package)_archiver_darwin=$($(package)_libtool)
|
||||
|
||||
$(package)_config_libraries=atomic,chrono,date_time,filesystem,program_options,regex,serialization,system,thread,locale,context,coroutine
|
||||
$(package)_cxxflags=-std=c++17 -fPIC
|
||||
endef
|
||||
define $(package)_preprocess_cmds
|
||||
echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$(boost_archiver_$(host_os))\" <arflags>\"$($(package)_arflags)\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
|
||||
endef
|
||||
define $(package)_config_cmds
|
||||
./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries)
|
||||
endef
|
||||
define $(package)_build_cmds
|
||||
./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
|
||||
endef
|
||||
define $(package)_stage_cmds
|
||||
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
|
||||
endef
|
||||
EOF
|
||||
sed -i 's/^ /\t/' contrib/depends/packages/boost.mk
|
||||
|
||||
- name: Build Dependencies
|
||||
run: |
|
||||
cd contrib/depends
|
||||
|
||||
# Boost 1.90.0 Constants
|
||||
BOOST_VER="1.90.0"
|
||||
BOOST_HASH="49551aff3b22cbc5c5a9ed3dbc92f0e23ea50a0f7325b0d198b705e8ee3fc305"
|
||||
|
||||
# Patch download URL to new location (archives.boost.io)
|
||||
# We use sed on the specific line to avoid touching recipes
|
||||
sed -i 's|dl.bintray.com/boostorg/release|archives.boost.io/release|g' packages/boost.mk
|
||||
|
||||
# Force rebuild of boost with new version
|
||||
# We explicitly pass variables to make to override the file defaults
|
||||
make HOST=${{ matrix.target }} boost_version=$BOOST_VER boost_sha256_hash=$BOOST_HASH -j$(nproc)
|
||||
|
||||
# Build the rest of the dependencies
|
||||
make HOST=${{ matrix.target }} -j$(nproc)
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Manual Static Lib Build (Using Generated Toolchain)
|
||||
# NEW: MANUAL ZLIB/ZSTD BUILD IF DEPENDS FAILS TO PACKAGE
|
||||
# -----------------------------------------------------
|
||||
- name: Build Static Zlib & Zstd (Manual CMake)
|
||||
- name: Harvest or Build Missing Libs
|
||||
run: |
|
||||
DEPENDS_DIR="$(pwd)/contrib/depends/${{ matrix.target }}"
|
||||
TOOLCHAIN="$DEPENDS_DIR/share/toolchain.cmake"
|
||||
LIB_DIR="contrib/depends/${{ matrix.target }}/lib"
|
||||
INC_DIR="contrib/depends/${{ matrix.target }}/include"
|
||||
WORK_DIR="contrib/depends/work/build/${{ matrix.target }}"
|
||||
|
||||
mkdir -p temp_libs
|
||||
cd temp_libs
|
||||
# Setup basic compiler env for manual fallback
|
||||
export CC="${{ matrix.target }}-gcc"
|
||||
export CXX="${{ matrix.target }}-g++"
|
||||
export AR="${{ matrix.target }}-ar"
|
||||
|
||||
# 1. 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/build/cmake
|
||||
cmake . -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN" \
|
||||
-DCMAKE_INSTALL_PREFIX="$DEPENDS_DIR" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DZSTD_BUILD_STATIC=ON \
|
||||
-DZSTD_BUILD_SHARED=OFF \
|
||||
-DZSTD_BUILD_PROGRAMS=OFF \
|
||||
-DZSTD_BUILD_TESTS=OFF
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ../../..
|
||||
echo "Checking $LIB_DIR..."
|
||||
|
||||
# 2. 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
|
||||
cmake . -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN" \
|
||||
-DCMAKE_INSTALL_PREFIX="$DEPENDS_DIR" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd ..
|
||||
# --- ZSTD ---
|
||||
if [ ! -f "$LIB_DIR/libzstd.a" ]; then
|
||||
echo "Zstd missing in prefix. Hunting..."
|
||||
# Try finding it in the work dir first
|
||||
FOUND=$(find $WORK_DIR -name "libzstd.a" -o -name "libzstd_static.a" | head -n 1)
|
||||
|
||||
if [ -n "$FOUND" ]; then
|
||||
cp -v "$FOUND" $LIB_DIR/libzstd.a
|
||||
find $WORK_DIR -name "zstd.h" | head -n 1 | xargs -I {} cp -v {} $INC_DIR/
|
||||
else
|
||||
echo "Zstd build failed. Building manually..."
|
||||
mkdir -p temp_zstd && cd temp_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
|
||||
make lib-release
|
||||
cp lib/libzstd.a $LIB_DIR/
|
||||
cp lib/zstd.h $INC_DIR/
|
||||
cd ../..
|
||||
fi
|
||||
fi
|
||||
|
||||
# Verify
|
||||
echo "Verifying libs in $DEPENDS_DIR/lib"
|
||||
ls -l $DEPENDS_DIR/lib/libz*.a
|
||||
# --- ZLIB ---
|
||||
if [ ! -f "$LIB_DIR/libz.a" ]; then
|
||||
echo "Zlib missing in prefix. Hunting..."
|
||||
FOUND=$(find $WORK_DIR -name "libz.a" -o -name "libz_static.a" | head -n 1)
|
||||
|
||||
if [ -n "$FOUND" ]; then
|
||||
cp -v "$FOUND" $LIB_DIR/libz.a
|
||||
find $WORK_DIR -name "zlib.h" | head -n 1 | xargs -I {} cp -v {} $INC_DIR/
|
||||
else
|
||||
echo "Zlib build failed. Building manually..."
|
||||
mkdir -p temp_zlib && cd temp_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 depends on platform
|
||||
if [[ "${{ matrix.target }}" == *"mingw"* ]]; then
|
||||
make -f win32/Makefile.gcc BINARY_PATH=$LIB_DIR INCLUDE_PATH=$INC_DIR LIBRARY_PATH=$LIB_DIR SHARED_MODE=0 STATIC_MODE=1 install
|
||||
cp libz.a $LIB_DIR/libz.a || true
|
||||
else
|
||||
./configure --static --prefix=$(pwd)/inst
|
||||
make install
|
||||
cp inst/lib/libz.a $LIB_DIR/
|
||||
cp inst/include/zlib.h $INC_DIR/
|
||||
cp inst/include/zconf.h $INC_DIR/
|
||||
fi
|
||||
cd ../..
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Build Wownero Core
|
||||
run: |
|
||||
@@ -145,15 +254,12 @@ jobs:
|
||||
find build/bin -type f -exec cp -v {} output/bin/ \;
|
||||
cp -v $LIB_DIR/*.a output/lib/
|
||||
|
||||
# Verify Critical Libs
|
||||
if [ ! -f output/lib/libz.a ] && [ ! -f output/lib/libz_static.a ]; then
|
||||
echo "FATAL: libz.a missing"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f output/lib/libzstd.a ]; then
|
||||
echo "FATAL: libzstd.a missing"
|
||||
exit 1
|
||||
fi
|
||||
echo "=== ARTIFACT CONTENTS ==="
|
||||
ls -l output/lib/
|
||||
|
||||
# Fail if critical libs are STILL missing
|
||||
if [ ! -f output/lib/libz.a ] && [ ! -f output/lib/libz_static.a ]; then echo "FATAL: libz.a missing"; exit 1; fi
|
||||
if [ ! -f output/lib/libzstd.a ]; then echo "FATAL: libzstd.a missing"; exit 1; fi
|
||||
|
||||
cp -r src output/include/wownero-src
|
||||
cp -r $INC_DIR/* output/include/
|
||||
|
||||
Reference in New Issue
Block a user