chore: macos ci failure

This commit is contained in:
darshankabariya 2025-10-15 22:56:53 +05:30
parent deebee45d7
commit 6683426bab
No known key found for this signature in database
GPG Key ID: 9A92CCD9899F0D22
3 changed files with 59 additions and 9 deletions

View File

@ -55,10 +55,17 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-15]
arch: [amd64]
exclude:
- os: macos-15
arch: amd64
include:
- os: macos-15
arch: arm64
runs-on: ${{ matrix.os }}
timeout-minutes: 45
name: build-${{ matrix.os }}
name: build-${{ matrix.os }}-${{ matrix.arch }}
steps:
- name: Checkout code
uses: actions/checkout@v4
@ -74,10 +81,12 @@ jobs:
path: |
vendor/
.git/modules
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
key: ${{ runner.os }}-${{ matrix.arch }}-vendor-modules-${{ steps.submodules.outputs.hash }}
- name: Build binaries
run: make V=1 QUICK_AND_DIRTY_COMPILER=1 all tools
run: |
OS=$([[ "${{runner.os}}" == "macOS" ]] && echo "macosx" || echo "linux")
make V=1 QUICK_AND_DIRTY_COMPILER=1 NIMFLAGS="-d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}" LIBRLN_TARGET_ARCH=${{matrix.arch}} all tools
build-windows:
needs: changes
@ -93,10 +102,17 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-15]
arch: [amd64]
exclude:
- os: macos-15
arch: amd64
include:
- os: macos-15
arch: arm64
runs-on: ${{ matrix.os }}
timeout-minutes: 45
name: test-${{ matrix.os }}
name: test-${{ matrix.os }}-${{ matrix.arch }}
steps:
- name: Checkout code
uses: actions/checkout@v4
@ -112,7 +128,7 @@ jobs:
path: |
vendor/
.git/modules
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
key: ${{ runner.os }}-${{ matrix.arch }}-vendor-modules-${{ steps.submodules.outputs.hash }}
- name: Run tests
run: |
@ -123,8 +139,11 @@ jobs:
fi
export MAKEFLAGS="-j1"
export NIMFLAGS="--colors:off -d:chronicles_colors:none"
export USE_LIBBACKTRACE=0
export LIBRLN_TARGET_ARCH=${{matrix.arch}}
OS=$([[ "${{runner.os}}" == "macOS" ]] && echo "macosx" || echo "linux")
export NIMFLAGS="--colors:off -d:chronicles_colors:none -d:disableMarchNative --os:${OS} --cpu:${{matrix.arch}}"
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=$postgres_enabled test
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=$postgres_enabled testwakunode2

View File

@ -178,6 +178,7 @@ nimbus-build-system-nimble-dir:
LIBRLN_BUILDDIR := $(CURDIR)/vendor/zerokit
LIBRLN_VERSION := v0.9.0
LIBRLN_TARGET_ARCH ?=
ifeq ($(detected_OS),Windows)
LIBRLN_FILE := rln.lib
@ -187,7 +188,7 @@ endif
$(LIBRLN_FILE):
echo -e $(BUILD_MSG) "$@" && \
./scripts/build_rln.sh $(LIBRLN_BUILDDIR) $(LIBRLN_VERSION) $(LIBRLN_FILE)
./scripts/build_rln.sh $(LIBRLN_BUILDDIR) $(LIBRLN_VERSION) $(LIBRLN_FILE) $(LIBRLN_TARGET_ARCH)
librln: | $(LIBRLN_FILE)
$(eval NIM_PARAMS += --passL:$(LIBRLN_FILE) --passL:-lm)

View File

@ -9,6 +9,7 @@ set -e
build_dir=$1
rln_version=$2
output_filename=$3
target_arch=$4 # Optional: target architecture (e.g., amd64, arm64)
[[ -z "${build_dir}" ]] && { echo "No build directory specified"; exit 1; }
[[ -z "${rln_version}" ]] && { echo "No rln version specified"; exit 1; }
@ -17,6 +18,28 @@ output_filename=$3
# Get the host triplet
host_triplet=$(rustc --version --verbose | awk '/host:/{print $2}')
# If target architecture is specified, map it to the appropriate rust target triplet
if [[ -n "${target_arch}" ]]; then
detected_OS=$(uname -s)
case "${detected_OS}" in
Darwin)
if [[ "${target_arch}" == "arm64" || "${target_arch}" == "aarch64" ]]; then
host_triplet="aarch64-apple-darwin"
elif [[ "${target_arch}" == "amd64" || "${target_arch}" == "x86_64" ]]; then
host_triplet="x86_64-apple-darwin"
fi
;;
Linux)
if [[ "${target_arch}" == "arm64" || "${target_arch}" == "aarch64" ]]; then
host_triplet="aarch64-unknown-linux-gnu"
elif [[ "${target_arch}" == "amd64" || "${target_arch}" == "x86_64" ]]; then
host_triplet="x86_64-unknown-linux-gnu"
fi
;;
esac
echo "Target architecture specified: ${target_arch}, using triplet: ${host_triplet}"
fi
tarball="${host_triplet}"
tarball+="-rln.tar.gz"
@ -49,6 +72,13 @@ else
exit 1
fi
# if submodule version = version in Makefile, build rln
cargo build --release -p rln --manifest-path "${build_dir}/rln/Cargo.toml"
cp "${build_dir}/target/release/librln.a" "${output_filename}"
# Determine the target directory based on whether we're cross-compiling
if [[ -n "${target_arch}" ]]; then
# Extract the rust target from host_triplet (which was already adjusted above if target_arch was set)
cargo build --release -p rln --manifest-path "${build_dir}/rln/Cargo.toml" --target "${host_triplet}"
cp "${build_dir}/target/${host_triplet}/release/librln.a" "${output_filename}"
else
cargo build --release -p rln --manifest-path "${build_dir}/rln/Cargo.toml"
cp "${build_dir}/target/release/librln.a" "${output_filename}"
fi
fi