Skip to content

Commit

Permalink
rm Miracl and remaining i386 (32-bit) build support (#2250)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed May 30, 2024
1 parent 0f430c7 commit 828fd63
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 276 deletions.
56 changes: 6 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ jobs:
- os: linux
cpu: amd64
evmc: evmc
#- os: linux
# cpu: i386
# evmc: evmc
- os: macos
cpu: amd64
evmc: evmc
Expand All @@ -48,9 +45,6 @@ jobs:
- os: linux
cpu: amd64
evmc: nimvm
#- os: linux
# cpu: i386
# evmc: nimvm
- os: windows
cpu: amd64
evmc: nimvm
Expand Down Expand Up @@ -93,12 +87,6 @@ jobs:
echo "GOARCH=${GOARCH}" >> $GITHUB_ENV
echo "USE_MIRACL=${USE_MIRACL}" >> $GITHUB_ENV
# libminiupnp / natpmp
if [[ '${{ runner.os }}' == 'Linux' && '${{ matrix.target.cpu }}' == 'i386' ]]; then
export CFLAGS="${CFLAGS} -m32 -mno-adx"
echo "CFLAGS=${CFLAGS}" >> $GITHUB_ENV
fi
ncpu=''
case '${{ runner.os }}' in
'Linux')
Expand All @@ -120,26 +108,6 @@ jobs:
echo "ENABLE_EVMC=0" >> $GITHUB_ENV
fi
- name: Install build dependencies (Linux i386)
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
run: |
sudo dpkg --add-architecture i386
sudo apt-fast update -qq
sudo DEBIAN_FRONTEND='noninteractive' apt-fast install \
--no-install-recommends -yq gcc-multilib g++-multilib \
libz-dev:i386 libbz2-dev:i386 libssl-dev:i386 libpcre3-dev:i386
mkdir -p external/bin
cat << EOF > external/bin/gcc
#!/bin/bash
exec $(which gcc) -m32 "\$@"
EOF
cat << EOF > external/bin/g++
#!/bin/bash
exec $(which g++) -m32 "\$@"
EOF
chmod 755 external/bin/gcc external/bin/g++
echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH
- name: Install build dependencies (Macos)
# Some home brew modules were reported missing
if: runner.os == 'Macos'
Expand All @@ -155,13 +123,6 @@ jobs:
path: rocks-db-cache-${{ matrix.target.cpu }}
key: 'rocksdb-v2-${{ matrix.target.os }}-${{ matrix.target.cpu }}'

- name: Build and install rocksdb (Linux i386)
# no librocksdb-dev:i386
if: runner.os == 'Linux' && matrix.target.cpu == 'i386'
run: |
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_rocksdb.sh
bash build_rocksdb.sh rocks-db-cache-${{ matrix.target.cpu }}
- name: Install rocksdb (Linux amd64)
# mysterious illegal instruction error if we build our own librocksdb
if: runner.os == 'Linux' && matrix.target.cpu == 'amd64'
Expand Down Expand Up @@ -282,17 +243,12 @@ jobs:
env CC=gcc make ${DEFAULT_MAKE_FLAGS}
build/nimbus --help
# CC, GOARCH, and CGO_ENABLED are needed to select correct compiler 32/64 bit
if [[ '${{ matrix.target.cpu }}' == 'i386' ]]; then
# hide CI failures
env CC=gcc GOARCH=${GOARCH} CXX=g++ CGO_ENABLED=1 make ${DEFAULT_MAKE_FLAGS} test || true
else
# pushd vendor/nimbus-eth2
# env NIMBUSEL_BINARY=../../build/nimbus NIMBUSEL_GENESIS=scripts/nimbusel_genesis.json \
# ./scripts/launch_local_testnet.sh --nodes=3 --stop-at-epoch=7 \
# --disable-htop --reuse-binaries --run-nimbus-el --dl-eth2 --verbose --kill-old-processes
# popd
env CC=gcc GOARCH=${GOARCH} CXX=g++ CGO_ENABLED=1 make ${DEFAULT_MAKE_FLAGS} test
fi
# pushd vendor/nimbus-eth2
# env NIMBUSEL_BINARY=../../build/nimbus NIMBUSEL_GENESIS=scripts/nimbusel_genesis.json \
# ./scripts/launch_local_testnet.sh --nodes=3 --stop-at-epoch=7 \
# --disable-htop --reuse-binaries --run-nimbus-el --dl-eth2 --verbose --kill-old-processes
# popd
env CC=gcc GOARCH=${GOARCH} CXX=g++ CGO_ENABLED=1 make ${DEFAULT_MAKE_FLAGS} test
- name: Run nimbus-eth1 tests (Macos)
if: runner.os == 'Macos'
Expand Down
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ all: | $(TOOLS) nimbus
# must be included after the default target
-include $(BUILD_SYSTEM_DIR)/makefiles/targets.mk

# default: use blst
USE_MIRACL := 0

# default: use nim native evm
ENABLE_EVMC := 0

Expand All @@ -182,10 +179,6 @@ ifneq ($(USE_LIBBACKTRACE), 0)
deps: | libbacktrace
endif

ifneq ($(USE_MIRACL), 0)
NIM_PARAMS += -d:BLS_FORCE_BACKEND=miracl
endif

ifneq ($(ENABLE_EVMC), 0)
NIM_PARAMS += -d:evmc_enabled
T8N_PARAMS := -d:chronicles_enabled=off
Expand Down
5 changes: 0 additions & 5 deletions config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ switch("warning", "ObservableStores:off")
# Too many false positives for "Warning: method has lock level <unknown>, but another method has 0 [LockLevel]"
switch("warning", "LockLevel:off")

if defined(windows) and defined(i386):
# avoid undefined reference to 'sqrx_mont_384x' when compiling in 32 bit mode
# without actually using __BLST_PORTABLE__ or __BLST_NO_ASM__
switch("define", "BLS_FORCE_BACKEND:miracl")

# nim-kzg shipping their own blst, nimbus-eth1 too.
# disable nim-kzg's blst
switch("define", "kzgExternalBlst")
Expand Down
Loading

0 comments on commit 828fd63

Please sign in to comment.