-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
65 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,61 @@ | ||
FROM --platform=linux/riscv64 riscv64/ubuntu:22.04 | ||
FROM ubuntu:22.04 as base-builder | ||
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 | ||
# | ||
|
||
FROM base-builder as boost-builder | ||
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 mkdir -p /opt/boost | ||
RUN ./bootstrap.sh --prefix=/opt/boost | ||
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 | ||
# | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.25 | ||
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* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters