From 13003b792887f853d32ce01469f2bc181ca89f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Thu, 19 Jan 2023 00:37:27 +0100 Subject: [PATCH 1/8] Provide `libpcre2` in docker images --- docker/alpine.Dockerfile | 2 +- docker/ubuntu.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/alpine.Dockerfile b/docker/alpine.Dockerfile index faf8f0d4..98652bc8 100644 --- a/docker/alpine.Dockerfile +++ b/docker/alpine.Dockerfile @@ -3,7 +3,7 @@ FROM alpine:3.16 as runtime RUN \ apk add --update --no-cache --force-overwrite \ # core dependencies - gcc gmp-dev libevent-static musl-dev pcre-dev \ + gcc gmp-dev libevent-static musl-dev pcre2-dev \ # stdlib dependencies libxml2-dev openssl-dev openssl-libs-static tzdata yaml-static zlib-static \ # dev tools diff --git a/docker/ubuntu.Dockerfile b/docker/ubuntu.Dockerfile index 74558ff4..b802d9fd 100644 --- a/docker/ubuntu.Dockerfile +++ b/docker/ubuntu.Dockerfile @@ -7,7 +7,7 @@ RUN \ apt-get update && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y tzdata gcc pkg-config libssl-dev libxml2-dev libyaml-dev libgmp-dev git make \ - libpcre3-dev libevent-dev libz-dev && \ + libpcre2-dev libevent-dev libz-dev && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ARG crystal_targz From 3d7ad19bfd98d5179729bf75f408b9012bd00f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Thu, 19 Jan 2023 00:41:43 +0100 Subject: [PATCH 2/8] Build PCRE2 for bundled package --- linux/Makefile | 4 ++-- linux/bundled.dockerfile | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index eeeb7a90..81379627 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -22,7 +22,7 @@ PREVIOUS_CRYSTAL_RELEASE_LINUX64_TARGZ ?= https://github.com/crystal-lang/crysta SHARDS_VERSION = v0.17.2 GC_VERSION = v8.2.2 -LIBPCRE_VERSION = 8.45 +LIBPCRE2_VERSION = 10.42 LIBEVENT_VERSION = release-2.1.12-stable OUTPUT_DIR = build @@ -44,7 +44,7 @@ BUILD_ARGS64 = $(BUILD_ARGS_COMMON) \ --build-arg gnu_target=x86_64-unknown-linux-gnu BUILD_ARGS64_BUNDLED = $(BUILD_ARGS64) \ - --build-arg libpcre_version=$(LIBPCRE_VERSION) \ + --build-arg libpcre2_version=$(LIBPCRE2_VERSION) \ --build-arg libevent_version=$(LIBEVENT_VERSION) .PHONY: all diff --git a/linux/bundled.dockerfile b/linux/bundled.dockerfile index e3bf407a..3637ad9e 100644 --- a/linux/bundled.dockerfile +++ b/linux/bundled.dockerfile @@ -5,11 +5,11 @@ RUN apt-get update \ ENV CFLAGS="-fPIC -pipe ${release:+-O2}" -# build libpcre -FROM debian AS libpcre -ARG libpcre_version -RUN curl https://ftp.exim.org/pub/pcre/pcre-${libpcre_version}.tar.gz | tar -zx \ - && cd pcre-${libpcre_version} \ +# build libpcre2 +FROM debian AS libpcre2 +ARG libpcre2_version +RUN curl https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${libpcre2_version}/pcre2-${libpcre2_version}.tar.gz | tar -zx \ + && cd pcre2-${libpcre2_version} \ && ./configure --disable-shared --disable-cpp --enable-jit --enable-utf --enable-unicode-properties \ && make -j$(nproc) @@ -27,13 +27,13 @@ RUN git clone https://github.com/libevent/libevent \ FROM debian ARG crystal_version ARG package_iteration -ARG libpcre_version +ARG libpcre2_version ARG libevent_version RUN mkdir -p /output/lib/crystal/lib/ # Copy libraries -COPY --from=libpcre pcre-${libpcre_version}/.libs/libpcre.a /output/lib/crystal/lib/ +COPY --from=libpcre2 pcre2-${libpcre2_version}/.libs/libpcre2-8.a /output/lib/crystal/lib/ COPY --from=libevent libevent/.libs/libevent.a libevent/.libs/libevent_pthreads.a /output/lib/crystal/lib/ # Create tarball From 9276b6b4429d140ddc915ca87787aebe70d61598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Thu, 19 Jan 2023 00:42:09 +0100 Subject: [PATCH 3/8] Update suggested packages for snapcraft --- snapcraft/README.md | 2 +- snapcraft/crystal-snap-wrapper | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/snapcraft/README.md b/snapcraft/README.md index 2df37e9b..dba383da 100644 --- a/snapcraft/README.md +++ b/snapcraft/README.md @@ -44,7 +44,7 @@ The following are the suggested packages to be able to use the whole standard li ``` $ sudo apt-get install gcc pkg-config git tzdata \ - libpcre3-dev libevent-dev libyaml-dev \ + libpcre2-dev libevent-dev libyaml-dev \ libgmp-dev libssl-dev libxml2-dev ``` diff --git a/snapcraft/crystal-snap-wrapper b/snapcraft/crystal-snap-wrapper index 8add6a2c..d171b36f 100755 --- a/snapcraft/crystal-snap-wrapper +++ b/snapcraft/crystal-snap-wrapper @@ -14,7 +14,7 @@ if [ ! -f $SNAP_USER_COMMON/env-check-success ]; then The following are the suggested packages to be able to use the whole standard library capabilities. $ sudo apt-get install gcc pkg-config git tzdata \\ - libpcre3-dev libevent-dev libyaml-dev \\ + libpcre2-dev libevent-dev libyaml-dev \\ libgmp-dev libssl-dev libxml2-dev You can find more detailed information in: From 96f82c496386e8489659ca831da84170abb0135b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 1 Feb 2023 22:32:22 +0100 Subject: [PATCH 4/8] fixup! Build PCRE2 for bundled package --- linux/bundled.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/bundled.dockerfile b/linux/bundled.dockerfile index 3637ad9e..8a506ea7 100644 --- a/linux/bundled.dockerfile +++ b/linux/bundled.dockerfile @@ -8,7 +8,7 @@ ENV CFLAGS="-fPIC -pipe ${release:+-O2}" # build libpcre2 FROM debian AS libpcre2 ARG libpcre2_version -RUN curl https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${libpcre2_version}/pcre2-${libpcre2_version}.tar.gz | tar -zx \ +RUN curl -L https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${libpcre2_version}/pcre2-${libpcre2_version}.tar.gz | tar -zx \ && cd pcre2-${libpcre2_version} \ && ./configure --disable-shared --disable-cpp --enable-jit --enable-utf --enable-unicode-properties \ && make -j$(nproc) From 74ee2fee4d972747bf62e56897c59e17cc277853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 1 Feb 2023 22:32:52 +0100 Subject: [PATCH 5/8] Fix lib locations in bundled tarball --- linux/bundled.dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/bundled.dockerfile b/linux/bundled.dockerfile index 8a506ea7..b6390daf 100644 --- a/linux/bundled.dockerfile +++ b/linux/bundled.dockerfile @@ -33,8 +33,8 @@ ARG libevent_version RUN mkdir -p /output/lib/crystal/lib/ # Copy libraries -COPY --from=libpcre2 pcre2-${libpcre2_version}/.libs/libpcre2-8.a /output/lib/crystal/lib/ -COPY --from=libevent libevent/.libs/libevent.a libevent/.libs/libevent_pthreads.a /output/lib/crystal/lib/ +COPY --from=libpcre2 pcre2-${libpcre2_version}/.libs/libpcre2-8.a /output/lib/crystal/ +COPY --from=libevent libevent/.libs/libevent.a libevent/.libs/libevent_pthreads.a /output/lib/crystal/ # Create tarball RUN mv /output /crystal-${crystal_version}-${package_iteration} \ From 21cfd726c75b6f8ca73525cd483ec294cea97cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Fri, 10 Feb 2023 21:22:35 +0100 Subject: [PATCH 6/8] Fix botched merged commit --- linux/bundled.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/bundled.dockerfile b/linux/bundled.dockerfile index 0eb8faf3..ab276546 100644 --- a/linux/bundled.dockerfile +++ b/linux/bundled.dockerfile @@ -33,7 +33,7 @@ ARG libevent_version RUN mkdir -p /output/lib/crystal/lib/ # Copy libraries -COPY --from=libpcre pcre-${libpcre_version}/.libs/libpcre.a /output/lib/crystal/ +COPY --from=libpcre2 pcre-${libpcre2_version}/.libs/libpcre2-8.a /output/lib/crystal/ COPY --from=libevent libevent/.libs/libevent.a libevent/.libs/libevent_pthreads.a /output/lib/crystal/ # Create tarball From 030ac39a452135c55cfd74bb6cd4cd58e8ceda22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Fri, 10 Feb 2023 21:27:36 +0100 Subject: [PATCH 7/8] fixup --- linux/bundled.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/bundled.dockerfile b/linux/bundled.dockerfile index ab276546..b6390daf 100644 --- a/linux/bundled.dockerfile +++ b/linux/bundled.dockerfile @@ -33,7 +33,7 @@ ARG libevent_version RUN mkdir -p /output/lib/crystal/lib/ # Copy libraries -COPY --from=libpcre2 pcre-${libpcre2_version}/.libs/libpcre2-8.a /output/lib/crystal/ +COPY --from=libpcre2 pcre2-${libpcre2_version}/.libs/libpcre2-8.a /output/lib/crystal/ COPY --from=libevent libevent/.libs/libevent.a libevent/.libs/libevent_pthreads.a /output/lib/crystal/ # Create tarball From ba86bea4c480ab5cdfc8bffb790aa6e2329e7914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Thu, 16 Feb 2023 19:51:24 +0100 Subject: [PATCH 8/8] Keep libpcre for now in build images --- docker/alpine.Dockerfile | 2 +- docker/ubuntu.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/alpine.Dockerfile b/docker/alpine.Dockerfile index 98652bc8..5eaf4ba6 100644 --- a/docker/alpine.Dockerfile +++ b/docker/alpine.Dockerfile @@ -3,7 +3,7 @@ FROM alpine:3.16 as runtime RUN \ apk add --update --no-cache --force-overwrite \ # core dependencies - gcc gmp-dev libevent-static musl-dev pcre2-dev \ + gcc gmp-dev libevent-static musl-dev pcre-dev pcre2-dev \ # stdlib dependencies libxml2-dev openssl-dev openssl-libs-static tzdata yaml-static zlib-static \ # dev tools diff --git a/docker/ubuntu.Dockerfile b/docker/ubuntu.Dockerfile index b802d9fd..292a31a6 100644 --- a/docker/ubuntu.Dockerfile +++ b/docker/ubuntu.Dockerfile @@ -7,7 +7,7 @@ RUN \ apt-get update && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y tzdata gcc pkg-config libssl-dev libxml2-dev libyaml-dev libgmp-dev git make \ - libpcre2-dev libevent-dev libz-dev && \ + libpcre3-dev libpcre2-dev libevent-dev libz-dev && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ARG crystal_targz