diff --git a/Dockerfile b/Dockerfile index 43059f2..9bb1f62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,7 @@ set -e apt update apt upgrade -y apt install -y --no-install-recommends \ + lua5.4 \ build-essential \ ca-certificates \ wget @@ -57,6 +58,7 @@ WORKDIR /opt/build # install bubblewrap (for sanboxing) ARG BUBBLEWRAP_VER=0.8.0 RUN < "${HOME}/user-config.jam" +RUN ./b2 toolset=gcc-riscv64 headers +RUN ./b2 toolset=gcc-riscv64 link=static variant=release runtime-link=static \ + --with-system --with-filesystem --with-test --with-program_options \ + install -j `nproc` + +# +# Build Solidity +# + +FROM base-builder as solidity-builder +WORKDIR /opt/build +RUN apt-get install -y --no-install-recommends cmake ARG VERSION -RUN make download VERSION=${VERSION} -RUN make VERSION=${VERSION} +RUN wget -O solidity-${VERSION}.tar.gz https://github.com/ethereum/solidity/releases/download/v${VERSION}/solidity_${VERSION}.tar.gz +RUN tar xzf solidity-${VERSION}.tar.gz +COPY --from=boost-builder /opt/boost /opt/boost +RUN cmake \ + -S solidity_${VERSION} \ + -B solidity_${VERSION}/build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc \ + -DCMAKE_CXX_COMPILER=riscv64-linux-gnu-g++ \ + -DBoost_INCLUDE_DIR=/opt/boost \ + -DBoost_USE_STATIC_RUNTIME=ON \ + -DUSE_CVC4=OFF \ + -DUSE_Z3=OFF \ + -DTESTS=OFF + +RUN make -C solidity_${VERSION}/build -j `nproc` solc + +# +# Create the .tar.xz file +# + +RUN mv solidity_${VERSION}/build/solc/solc . +COPY --chmod=755 start.sh . +RUN tar cfJ /root/solidity-${VERSION}-bounty_riscv64.tar.xz solc start.sh diff --git a/tests/bounties/solidity-bounty/Makefile b/tests/bounties/solidity-bounty/Makefile index 59b53d3..7354c0d 100644 --- a/tests/bounties/solidity-bounty/Makefile +++ b/tests/bounties/solidity-bounty/Makefile @@ -1,49 +1,12 @@ ARCH=$(shell uname -m) -VERSION=0.8.24 -SOURCE_TAR=solidity-$(VERSION).tar.gz -SOURCE_DIR=solidity_$(VERSION) -BUILD_DIR=$(SOURCE_DIR)/build -BOUNTY_TAR=solidity-$(VERSION)-bounty_$(ARCH).tar.xz +VERSION=0.8.26 BOUNTY_RISCV64_TAR=solidity-$(VERSION)-bounty_riscv64.tar.xz -CMAKEFLAGS=-DTESTS=OFF -DUSE_Z3=OFF - -all: $(BOUNTY_TAR) - riscv64: $(BOUNTY_RISCV64_TAR) -download: | $(SOURCE_DIR) - -$(BOUNTY_TAR): solc start.sh - tar cfJ $@ $^ - -$(BUILD_DIR)/solc/solc: | $(SOURCE_DIR) $(BUILD_DIR) - $(MAKE) -C $(BUILD_DIR) solc - -$(BUILD_DIR): - cmake -S $(SOURCE_DIR) -B $(BUILD_DIR) $(CMAKEFLAGS) - -solc: $(BUILD_DIR)/solc/solc - cp $< $@ - -$(SOURCE_DIR): $(SOURCE_TAR) - tar xzf $< - -$(SOURCE_TAR): - wget -O $(SOURCE_TAR) https://github.com/ethereum/solidity/releases/download/v$(VERSION)/solidity_$(VERSION).tar.gz - -ifneq ($(ARCH), riscv64) $(BOUNTY_RISCV64_TAR): Dockerfile start.sh docker build --tag solidity-bounty-cp --file Dockerfile --progress plain --build-arg VERSION=$(VERSION) . - docker create --platform=linux/riscv64 --name solidity-bounty-cp solidity-bounty-cp + docker create --name solidity-bounty-cp solidity-bounty-cp docker cp solidity-bounty-cp:/root/$@ $@ docker rm solidity-bounty-cp touch $@ -endif - -clean: - rm -f solc $(SOURCE_DIR)-bounty_*.tar.xz - if [ -d "$(BUILD_DIR)" ]; then $(MAKE) -C $(BUILD_DIR) clean; fi - -distclean: clean - rm -rf solidity* diff --git a/tests/bounties/solidity-bounty/info.json b/tests/bounties/solidity-bounty/info.json index 2fce593..4f24192 100644 --- a/tests/bounties/solidity-bounty/info.json +++ b/tests/bounties/solidity-bounty/info.json @@ -1,5 +1,5 @@ { - "name": "Solidity 0.8.24", + "name": "Solidity 0.8.26", "description": "Solidity is a programming language for implementing smart contracts on various blockchain platforms, most notably, Ethereum.", - "imgLink": "https://upload.wikimedia.org/wikipedia/commons/9/98/Solidity_logo.svg" + "imgLink": "https://docs.soliditylang.org/en/v0.8.26/_static/img/logo-dark.svg" } diff --git a/tests/bounties/solidity-bounty/start.sh b/tests/bounties/solidity-bounty/start.sh index c89858d..e7731c3 100755 --- a/tests/bounties/solidity-bounty/start.sh +++ b/tests/bounties/solidity-bounty/start.sh @@ -1,5 +1,5 @@ #!/bin/sh -./solc --standard-json $1 +./solc $1 status=$? # Status is always 139 when program crashes with "Segmentation fault" (SIGSEGV) if [ $status -eq 139 ]; then