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

Switch to building GMP from an unofficial git mirror #14767

Merged
merged 1 commit into from
Jan 5, 2024
Merged
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
23 changes: 14 additions & 9 deletions scripts/docker/buildpack-deps/Dockerfile.ubuntu.clang.ossfuzz
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
# (c) 2016-2021 solidity contributors.
#------------------------------------------------------------------------------
FROM gcr.io/oss-fuzz-base/base-clang:latest as base
LABEL version="2"
LABEL version="3"

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update; \
apt-get -qqy install --no-install-recommends \
automake libtool bison texinfo \
build-essential sudo \
software-properties-common \
ninja-build git wget \
Expand Down Expand Up @@ -108,18 +109,22 @@ RUN set -ex; \
# with sanitized version. Do not perform apt
# remove because it removes mlton as well that
# we need for building libabicoder
cd /usr/src/; \
git clone --depth 1 --branch gmp-6.2.1 https://github.com/gmp-mirror/gmp-6.2 gmp/; \
rm -r gmp/.git/; \
test \
"$(tar --create gmp/ --sort=name --mtime=1970-01-01Z --owner=0 --group=0 --numeric-owner | sha256sum)" = \
"d606ff6a4ce98692f9920031e85ea8fcf4a65ce1426f6f0048b8794aefed174b -"; \
# NOTE: This removes also libgmp.so, which git depends on
Copy link
Collaborator

Choose a reason for hiding this comment

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

And also wget, and probably a ton of other stuff.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, but git is relevant because we're using it a few lines above. The comment is there to explain why the removal of the installed GMP has to be done here and not before.

rm -f /usr/lib/x86_64-linux-gnu/libgmp.*; \
rm -f /usr/include/x86_64-linux-gnu/gmp.h; \
cd /usr/src; \
wget -q 'https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz' -O gmp.tar.xz; \
test "$(sha256sum gmp.tar.xz)" = "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2 gmp.tar.xz"; \
tar -xf gmp.tar.xz; \
cd gmp-6.2.1; \
./configure --prefix=/usr --enable-static=yes; \
cd gmp/; \
autoreconf -i; \
./configure --prefix=/usr --enable-static=yes --enable-maintainer-mode; \
make -j; \
make check; \
make install; \
rm -rf /usr/src/gmp-6.2.1; \
rm -f /usr/src/gmp.tar.xz
rm -rf /usr/src/gmp/

# libabicoder
RUN set -ex; \
Expand Down
Loading