diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02e8c75..7d6d857 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,8 @@ jobs: cpu: i386 - os: macos cpu: amd64 + - os: macos + cpu: arm64 - os: windows cpu: amd64 #- os: windows @@ -34,8 +36,15 @@ jobs: shell: bash - target: os: macos + cpu: amd64 builder: macos-12 shell: bash + - target: + os: macos + cpu: arm64 + # On macos-14, we get an M1 cpu + builder: macos-14 + shell: bash - target: os: windows builder: windows-2019 @@ -122,6 +131,8 @@ jobs: run: | if [[ '${{ matrix.target.cpu }}' == 'amd64' ]]; then PLATFORM=x64 + elif [[ '${{ matrix.target.cpu }}' == 'arm64' ]]; then + PLATFORM=arm64 else PLATFORM=x86 fi @@ -148,7 +159,7 @@ jobs: - name: Build Nim and Nimble run: | curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh - env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} NIM_COMMIT=${{ matrix.branch }} \ + env MAKE="${MAKE_CMD} -j${ncpu}" V=1 ARCH_OVERRIDE=${PLATFORM} NIM_COMMIT=${{ matrix.branch }} \ QUICK_AND_DIRTY_COMPILER=1 QUICK_AND_DIRTY_NIMBLE=1 CC=gcc \ bash build_nim.sh nim csources dist/nimble NimBinaries echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH diff --git a/ssz_serialization/digest.nim b/ssz_serialization/digest.nim index b706771..3243261 100644 --- a/ssz_serialization/digest.nim +++ b/ssz_serialization/digest.nim @@ -20,7 +20,7 @@ import nimcrypto/[hash, sha2], stew/ptrops, ./types const PREFER_BLST_SHA256* {.booldefine.} = true # TODO https://github.com/prysmaticlabs/hashtree/issues/28 -const PREFER_HASHTREE_SHA256* {.booldefine.} = not defined(arm64) +const PREFER_HASHTREE_SHA256* {.booldefine.} = true when PREFER_BLST_SHA256: import blscurve @@ -38,10 +38,11 @@ else: {.hint: "nimcrypto SHA256 backend enabled".} type DigestCtx* = sha2.sha256 -when PREFER_HASHTREE_SHA256 and - (defined(arm64) or defined(amd64)) and - ((defined(gcc) and (defined(linux) or defined(windows))) or - (defined(clang) and defined(linux))): +when PREFER_HASHTREE_SHA256 and (defined(arm64) or defined(amd64)) and ( + ((defined(linux) or defined(windows)) and defined(gcc)) or + (defined(linux) and defined(clang)) or + (defined(macosx) and defined(clang) and defined(arm64)) +): {.hint: "Hashtree SHA256 backend enabled".} const USE_HASHTREE_SHA256 = true diff --git a/vendor/hashtree b/vendor/hashtree index 616c243..1efb91a 160000 --- a/vendor/hashtree +++ b/vendor/hashtree @@ -1 +1 @@ -Subproject commit 616c243905b38285373771a30e9ba13bf96a3aa8 +Subproject commit 1efb91ade509aeb1ee1dbac57dc9b1985afcdf17