diff --git a/tests/bounties/Makefile b/tests/bounties/Makefile index c8219f7..81c837e 100644 --- a/tests/bounties/Makefile +++ b/tests/bounties/Makefile @@ -7,7 +7,7 @@ all: $(MAKE) -C busybox-bounty riscv64 VERSION=1.36.1 - $(MAKE) -C solidity-bounty riscv64 VERSION=0.8.24 + $(MAKE) -C solidity-bounty riscv64 VERSION=0.8.25 clean: $(MAKE) -C lua-bounty clean diff --git a/tests/bounties/solidity-bounty/Dockerfile b/tests/bounties/solidity-bounty/Dockerfile index 3e12c3d..aba9761 100644 --- a/tests/bounties/solidity-bounty/Dockerfile +++ b/tests/bounties/solidity-bounty/Dockerfile @@ -1,10 +1,56 @@ -FROM --platform=linux/riscv64 riscv64/ubuntu:22.04 +FROM ubuntu:22.04 as build RUN apt-get update && apt-get upgrade -y -RUN apt-get install -y --no-install-recommends ca-certificates build-essential wget xz-utils -RUN apt-get install -y --no-install-recommends cmake libboost-all-dev libcln-dev libcvc4-dev -WORKDIR /root -COPY Makefile . -COPY --chmod=755 start.sh . +RUN apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + crossbuild-essential-riscv64 \ + git \ + make \ + wget \ + xz-utils + +# +# Build Boost +# + +WORKDIR /opt/build +RUN wget "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.gz" +RUN tar xzf boost_1_74_0.tar.gz +WORKDIR /opt/build/boost_1_74_0 +RUN ./bootstrap.sh --prefix=/usr +RUN echo "using gcc : riscv64 : riscv64-linux-gnu-g++ ;" > "${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 +# + +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 +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_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..8b2fe92 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 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..492f58d 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.25", "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.25/_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