Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Eldarica on Ubuntu Clang images #14976

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion scripts/docker/buildpack-deps/Dockerfile.ubuntu.clang.ossfuzz
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# (c) 2016-2021 solidity contributors.
#------------------------------------------------------------------------------
FROM gcr.io/oss-fuzz-base/base-clang:latest as base
LABEL version="4"
LABEL version="5"

ARG DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -73,6 +73,16 @@ RUN set -ex; \
make install; \
rm -rf /usr/src/z3

# Eldarica
RUN set -ex; \
apt-get update; \
apt-get install -qy unzip openjdk-11-jre; \
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;

# OSSFUZZ: libprotobuf-mutator
RUN set -ex; \
git clone https://github.com/google/libprotobuf-mutator.git \
Expand Down Expand Up @@ -137,7 +147,13 @@ RUN set -ex; \
cp abicoder.hpp /usr/include; \
rm -rf /usr/src/Yul-Isabelle

# Cleanup
RUN set -ex; \
rm -rf /var/lib/apt/lists/*

Comment on lines 148 to +153
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cleanup is actually both superfluous and ineffective.

Thanks to the FROM base bit below we discard everything except for a few selected dirs anyway so we don't need to worry about cleaning up anywhere outside of these dirs.

And if we weren't doing that, removing stuff in a separate RUN command would not really remove it from the image. It would still be in the original layer and just marked as removed by layer above, but still taking up space.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right. Didn't know that. We can remove those then.

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"
19 changes: 17 additions & 2 deletions scripts/docker/buildpack-deps/Dockerfile.ubuntu2204.clang
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# (c) 2016-2019 solidity contributors.
#------------------------------------------------------------------------------
FROM buildpack-deps:jammy AS base
LABEL version="5"
LABEL version="6"

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -39,7 +39,20 @@ RUN set -ex; \
libboost-program-options-dev \
clang \
libz3-static-dev z3-static jq \
libcln-dev; \
libcln-dev;

# Eldarica
RUN set -ex; \
apt-get update; \
apt-get install -qy unzip openjdk-11-jre; \
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;

# Cleanup
RUN set -ex; \
rm -rf /var/lib/apt/lists/*

FROM base AS libraries
Expand All @@ -63,3 +76,5 @@ 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"