Skip to contentSkip to conversation

tests/docker: use stable URLs for zlib tarballs

PATCH In review Stefan Hajnoczi 5 participants 5 messages Aug 3 – Aug 4

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/docker: use stable URLs for zlib tarballs

The tarballs at https://zlib.net/zlib-X.Y.Z.tar.xz become unavailable when a new release is made. This breaks the emsdk-wasm64-cross.docker file that fetches the tarball and builds zlib from source.

There is actually an archive available with a stable URL. Use that instead. This does require switching from xz to gzip since xz tarballs are not available in the archive.

The upshot is that the emsdk-wasm64-cross Docker image build will continue working into the future without causing CI breakage when the zlib project makes a new release.

---
v2:
- Fix "bzip2 to gzip since bzip2" typo. It should have been xz instead of bzip2. [danpb]

 tests/docker/dockerfiles/emsdk-wasm64-cross.docker | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/docker/dockerfiles/emsdk-wasm64-cross.docker +2 -2
index c04a741b0e5..4f26ce7a269 100644
@@ -56,8 +56,8 @@ EOF
 FROM build-base AS zlib-dev
 ARG ZLIB_VERSION
 RUN mkdir -p /zlib
-RUN curl -Ls https://zlib.net/zlib-$ZLIB_VERSION.tar.xz | \
-    tar xJC /zlib --strip-components=1
+RUN curl -Ls https://zlib.net/fossils/zlib-$ZLIB_VERSION.tar.gz | \
+    tar xzC /zlib --strip-components=1
 WORKDIR /zlib
 RUN emconfigure ./configure --prefix=$TARGET --static
 RUN emmake make install -j$(nproc)
Signature · 1 line
2.55.0
Reviewed-by
#2 lore raw

Hi Stefan,

Quoted 21 lines

The tarballs at https://zlib.net/zlib-X.Y.Z.tar.xz become unavailable when a new release is made. This breaks the emsdk-wasm64-cross.docker file that fetches the tarball and builds zlib from source.

There is actually an archive available with a stable URL. Use that instead. This does require switching from xz to gzip since xz tarballs are not available in the archive.

The upshot is that the emsdk-wasm64-cross Docker image build will continue working into the future without causing CI breakage when the zlib project makes a new release.

---
v2:
- Fix "bzip2 to gzip since bzip2" typo. It should have been xz instead of bzip2. [danpb]

Review

Quoted 4 lines
 tests/docker/dockerfiles/emsdk-wasm64-cross.docker | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/tests/docker/dockerfiles/emsdk-wasm64-cross.docker

Quoted 4 lines

index c04a741b0e5..4f26ce7a269 100644

tests/docker/dockerfiles/emsdk-wasm64-cross.docker EOF · line 63

Quoted 10 lines
tests/docker/dockerfiles/emsdk-wasm64-cross.docker +2 -2
@@ -56,8 +56,8 @@ EOF
 FROM build-base AS zlib-dev
 ARG ZLIB_VERSION
 RUN mkdir -p /zlib
-RUN curl -Ls https://zlib.net/zlib-$ZLIB_VERSION.tar.xz | \
-    tar xJC /zlib --strip-components=1
+RUN curl -Ls https://zlib.net/fossils/zlib-$ZLIB_VERSION.tar.gz | \
+    tar xzC /zlib --strip-components=1
 WORKDIR /zlib
 RUN emconfigure ./configure --prefix=$TARGET --static
 RUN emmake make install -j$(nproc)

Thank you for the fix.

Regards,
Kohei Tokunaga

Tested-by Reviewed-by on v1 1/1
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 29 lines · Stefan Hajnoczi

The tarballs at https://zlib.net/zlib-X.Y.Z.tar.xz become unavailable when a new release is made. This breaks the emsdk-wasm64-cross.docker file that fetches the tarball and builds zlib from source.

There is actually an archive available with a stable URL. Use that instead. This does require switching from xz to gzip since xz tarballs are not available in the archive.

The upshot is that the emsdk-wasm64-cross Docker image build will continue working into the future without causing CI breakage when the zlib project makes a new release.

---
v2:
- Fix "bzip2 to gzip since bzip2" typo. It should have been xz instead of bzip2. [danpb]

  tests/docker/dockerfiles/emsdk-wasm64-cross.docker | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tests/docker/dockerfiles/emsdk-wasm64-cross.docker +0 -0
index c04a741b0e5..4f26ce7a269 100644

tests/docker/dockerfiles/emsdk-wasm64-cross.docker EOF · line 57

Quoted 2 lines
tests/docker/dockerfiles/emsdk-wasm64-cross.docker +0 -0
@@ -56,8 +56,8 @@ EOF
  FROM build-base AS zlib-dev
  ARG ZLIB_VERSION

Even safer would be to have a ZLIB_SHA and assert it is correct.

Quoted 8 lines
tests/docker/dockerfiles/emsdk-wasm64-cross.docker +2 -2
  RUN mkdir -p /zlib
-RUN curl -Ls https://zlib.net/zlib-$ZLIB_VERSION.tar.xz | \
-    tar xJC /zlib --strip-components=1
+RUN curl -Ls https://zlib.net/fossils/zlib-$ZLIB_VERSION.tar.gz | \
+    tar xzC /zlib --strip-components=1
  WORKDIR /zlib
  RUN emconfigure ./configure --prefix=$TARGET --static
  RUN emmake make install -j$(nproc)
Reviewed-by on v1 1/1
#4 lore raw
In reply to Stefan Hajnoczi
Quoted 29 lines · Stefan Hajnoczi

The tarballs at https://zlib.net/zlib-X.Y.Z.tar.xz become unavailable when a new release is made. This breaks the emsdk-wasm64-cross.docker file that fetches the tarball and builds zlib from source.

There is actually an archive available with a stable URL. Use that instead. This does require switching from xz to gzip since xz tarballs are not available in the archive.

The upshot is that the emsdk-wasm64-cross Docker image build will continue working into the future without causing CI breakage when the zlib project makes a new release.

---
v2:
- Fix "bzip2 to gzip since bzip2" typo. It should have been xz instead of bzip2. [danpb]

 tests/docker/dockerfiles/emsdk-wasm64-cross.docker | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/docker/dockerfiles/emsdk-wasm64-cross.docker +0 -0
index c04a741b0e5..4f26ce7a269 100644

tests/docker/dockerfiles/emsdk-wasm64-cross.docker EOF · line 63

Quoted 10 lines
tests/docker/dockerfiles/emsdk-wasm64-cross.docker +2 -2
@@ -56,8 +56,8 @@ EOF
 FROM build-base AS zlib-dev
 ARG ZLIB_VERSION
 RUN mkdir -p /zlib
-RUN curl -Ls https://zlib.net/zlib-$ZLIB_VERSION.tar.xz | \
-    tar xJC /zlib --strip-components=1
+RUN curl -Ls https://zlib.net/fossils/zlib-$ZLIB_VERSION.tar.gz | \
+    tar xzC /zlib --strip-components=1
 WORKDIR /zlib
 RUN emconfigure ./configure --prefix=$TARGET --static
 RUN emmake make install -j$(nproc)

We could also switch to git clone with -single-branch -depth 1, but current patch works fine.
Feel free to apply it directly to staging/your tree.

Regards,
Pierrick