Skip to content

Commit

Permalink
Introduce ubuntu2404 clang docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-matic committed Aug 29, 2024
1 parent 9e8369f commit 75b1863
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/buildpack-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2204.clang'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2204'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2404'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2404.clang'

jobs:
buildpack-deps:
Expand All @@ -24,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
image_variant: [emscripten, ubuntu.clang.ossfuzz, ubuntu2004, ubuntu2204.clang, ubuntu2204, ubuntu2404]
image_variant: [emscripten, ubuntu.clang.ossfuzz, ubuntu2004, ubuntu2204.clang, ubuntu2204, ubuntu2404, ubuntu2404.clang]

steps:
- uses: actions/checkout@v4
Expand Down
37 changes: 37 additions & 0 deletions scripts/ci/buildpack-deps_test_ubuntu2404.clang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -ex

ROOTDIR="$(dirname "$0")/../.."
# shellcheck source=scripts/common.sh
source "${ROOTDIR}/scripts/common.sh"

prerelease_source="${1:-ci}"

cd "${ROOTDIR}"

# shellcheck disable=SC2166
if [ "$CIRCLE_BRANCH" = release -o -n "$CIRCLE_TAG" -o -n "$FORCE_RELEASE" ]
then
echo -n >prerelease.txt
else
# Use last commit date rather than build date to avoid ending up with builds for
# different platforms having different version strings (and therefore producing different bytecode)
# if the CI is triggered just before midnight.
TZ=UTC git show --quiet --date="format-local:%Y.%-m.%-d" --format="${prerelease_source}.%cd" >prerelease.txt
fi

if [ -n "$CIRCLE_SHA1" ]
then
echo -n "$CIRCLE_SHA1" >commit_hash.txt
fi

mkdir -p build
cd build

# shellcheck disable=SC2166
[ -n "$COVERAGE" -a "$CIRCLE_BRANCH" != release -a -z "$CIRCLE_TAG" ] && CMAKE_OPTIONS="$CMAKE_OPTIONS -DCOVERAGE=ON"

# shellcheck disable=SC2086
cmake .. -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" $CMAKE_OPTIONS -G "Unix Makefiles"

make
107 changes: 107 additions & 0 deletions scripts/docker/buildpack-deps/Dockerfile.ubuntu2404.clang
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# vim:syntax=dockerfile
#------------------------------------------------------------------------------
# Dockerfile for building and testing Solidity Compiler on CI
# Target: Ubuntu 19.04 (Disco Dingo) Clang variant
# URL: https://hub.docker.com/r/ethereum/solidity-buildpack-deps
#
# This file is part of solidity.
#
# solidity is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# solidity is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with solidity. If not, see <http://www.gnu.org/licenses/>
#
# (c) 2016-2019 solidity contributors.
#------------------------------------------------------------------------------
FROM buildpack-deps:noble AS base
LABEL version="1"

ARG DEBIAN_FRONTEND=noninteractive

# From Python3.11, pip requires a virtual environment, and will thus terminate when installing packages globally.
# Since we're building this image from scratch, it's perfectly fine to use the below flag.
ENV PIP_BREAK_SYSTEM_PACKAGES 1

RUN set -ex; \
dist=$(grep DISTRIB_CODENAME /etc/lsb-release | cut -d= -f2); \
echo "deb http://ppa.launchpad.net/ethereum/cpp-build-deps/ubuntu $dist main" >> /etc/apt/sources.list ; \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1c52189c923f6ca9 ; \
apt-get update; \
apt-get install -qqy --no-install-recommends \
build-essential \
clang \
cmake \
jq \
lsof \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libcln-dev \
libz3-static-dev \
ninja-build \
python3-pip \
software-properties-common \
sudo \
z3-static; \
pip3 install \
codecov \
colorama \
deepdiff \
parsec \
pygments-lexer-solidity \
pylint \
requests \
tabulate \
z3-solver;

# Eldarica
RUN set -ex; \
apt-get update; \
apt-get install -qy \
openjdk-11-jre \
unzip; \
eldarica_version="2.1"; \
wget "https://github.com/uuverifiers/eldarica/releases/download/v${eldarica_version}/eldarica-bin-${eldarica_version}.zip" -O /opt/eld_binaries.zip; \
test "$(sha256sum /opt/eld_binaries.zip)" = "0ac43f45c0925383c9d2077f62bbb515fd792375f3b2b101b30c9e81dcd7785c /opt/eld_binaries.zip"; \
unzip /opt/eld_binaries.zip -d /opt; \
rm -f /opt/eld_binaries.zip;

# CVC5
RUN set -ex; \
cvc5_version="1.1.2"; \
wget "https://github.com/cvc5/cvc5/releases/download/cvc5-${cvc5_version}/cvc5-Linux-static.zip" -O /opt/cvc5.zip; \
test "$(sha256sum /opt/cvc5.zip)" = "cf291aef67da8eaa8d425a51f67f3f72f36db8b1040655dc799b64e3d69e6086 /opt/cvc5.zip"; \
unzip /opt/cvc5.zip -x "cvc5-Linux-static/lib/cmake/*" -d /opt; \
mv /opt/cvc5-Linux-static/bin/* /usr/bin; \
mv /opt/cvc5-Linux-static/lib/* /usr/lib; \
mv /opt/cvc5-Linux-static/include/* /usr/include; \
rm -rf /opt/cvc5-Linux-static /opt/cvc5.zip;

FROM base AS libraries

ENV CC clang
ENV CXX clang++

# EVMONE
RUN set -ex; \
wget -O /usr/src/evmone.tar.gz https://github.com/ethereum/evmone/releases/download/v0.12.0/evmone-0.12.0-linux-x86_64.tar.gz; \
test "$(sha256sum /usr/src/evmone.tar.gz)" = "1c7b5eba0c8c3b3b2a7a05101e2d01a13a2f84b323989a29be66285dba4136ce /usr/src/evmone.tar.gz"; \
cd /usr; \
tar -xf /usr/src/evmone.tar.gz; \
rm -rf /usr/src/evmone.tar.gz

FROM base
COPY --from=libraries /usr/lib /usr/lib
COPY --from=libraries /usr/bin /usr/bin
COPY --from=libraries /usr/include /usr/include
COPY --from=libraries /opt/eldarica /opt/eldarica
ENV PATH="$PATH:/opt/eldarica"

0 comments on commit 75b1863

Please sign in to comment.