Skip to content

Commit

Permalink
Merge pull request #179 from rstudio/fix/R-3.3.x-zlib
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi authored Jul 20, 2023
2 parents b541a8f + ee6c49c commit 03dbd45
Show file tree
Hide file tree
Showing 15 changed files with 79 additions and 12 deletions.
1 change: 1 addition & 0 deletions builder/Dockerfile.centos-7
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ ENV R_RD4PDF="times,hyper"

COPY package.centos-7 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh
1 change: 1 addition & 0 deletions builder/Dockerfile.centos-8
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ ENV R_RD4PDF="times,hyper"

COPY package.centos-8 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh
1 change: 1 addition & 0 deletions builder/Dockerfile.debian-10
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ ENV PAGER /usr/bin/pager

COPY package.debian-10 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh
1 change: 1 addition & 0 deletions builder/Dockerfile.debian-11
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ ENV INCLUDE_PCRE2_IN_R_3 yes

COPY package.debian-11 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh
1 change: 1 addition & 0 deletions builder/Dockerfile.debian-12
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ ENV INCLUDE_PCRE2_IN_R_3 yes

COPY package.debian-12 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh
1 change: 1 addition & 0 deletions builder/Dockerfile.opensuse-154
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,5 @@ ENV JAVA_HOME=/usr/lib64/jvm/jre-11-openjdk

COPY package.opensuse-154 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh
1 change: 1 addition & 0 deletions builder/Dockerfile.rhel-9
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ ENV INCLUDE_PCRE2_IN_R_3 yes

COPY package.rhel-9 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh
1 change: 1 addition & 0 deletions builder/Dockerfile.ubuntu-2004
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ ENV PAGER /usr/bin/pager

COPY package.ubuntu-2004 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh
1 change: 1 addition & 0 deletions builder/Dockerfile.ubuntu-2204
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ ENV INCLUDE_PCRE2_IN_R_3 yes

COPY package.ubuntu-2204 /package.sh
COPY build.sh .
COPY patches /patches
ENTRYPOINT ./build.sh
4 changes: 4 additions & 0 deletions builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ patch_r() {
if [ -f "/patches/R-${1}.patch" ]; then
patch -p1 < "/patches/R-${1}.patch"
fi

if [ -f "/patches/R-${1}-${OS_IDENTIFIER}.patch" ]; then
patch -p1 < "/patches/R-${1}-${OS_IDENTIFIER}.patch"
fi
}

# compile_r() - $1 as r version
Expand Down
20 changes: 20 additions & 0 deletions builder/patches/R-3.3.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/configure b/configure
index e53821d..d26fd72 100755
--- a/configure
+++ b/configure
@@ -35496,10 +35496,11 @@ else
#include <string.h>
#include <zlib.h>
int main() {
-#ifdef ZLIB_VERSION
-/* Work around Debian bug: it uses 1.2.3.4 even though there was no such
- version on the master site zlib.net */
- exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);
+#ifdef ZLIB_VERNUM
+ if (ZLIB_VERNUM < 0x1250) {
+ exit(1);
+ }
+ exit(0);
#else
exit(1);
#endif
20 changes: 20 additions & 0 deletions builder/patches/R-3.3.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/configure b/configure
index e53821d..d26fd72 100755
--- a/configure
+++ b/configure
@@ -35496,10 +35496,11 @@ else
#include <string.h>
#include <zlib.h>
int main() {
-#ifdef ZLIB_VERSION
-/* Work around Debian bug: it uses 1.2.3.4 even though there was no such
- version on the master site zlib.net */
- exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);
+#ifdef ZLIB_VERNUM
+ if (ZLIB_VERNUM < 0x1250) {
+ exit(1);
+ }
+ exit(0);
#else
exit(1);
#endif
20 changes: 20 additions & 0 deletions builder/patches/R-3.3.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/configure b/configure
index e53821d..d26fd72 100755
--- a/configure
+++ b/configure
@@ -35496,10 +35496,11 @@ else
#include <string.h>
#include <zlib.h>
int main() {
-#ifdef ZLIB_VERSION
-/* Work around Debian bug: it uses 1.2.3.4 even though there was no such
- version on the master site zlib.net */
- exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);
+#ifdef ZLIB_VERNUM
+ if (ZLIB_VERNUM < 0x1250) {
+ exit(1);
+ }
+ exit(0);
#else
exit(1);
#endif
12 changes: 6 additions & 6 deletions builder/patches/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Patches

Patches can be applied for specific R versions and platforms. To add a patch, create a patch file
at `patches/R-${R_VERSION}.patch` (such as `patches/R-devel.patch`), and add the following line
to the platform Dockerfile:
Patches can be applied for specific R versions and platforms. To add a patch for an R version on
all platforms, create a patch file at `patches/R-${R_VERSION}.patch` (such as
`patches/R-devel.patch`).

```dockerfile
COPY patches /patches
```
To add a patch for an R version on a specific platform create a patch file at
`patches/R-${R_VERSION}-${OS_IDENTIFIER}.patch` (such as
`patches/R-3.3.0-centos-8.patch`).
6 changes: 0 additions & 6 deletions handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,6 @@ def queue_builds(event, context):
job_ids = []
for version in event['versions_to_build']:
for platform in event['supported_platforms']:
# In R 3.3.0, 3.3.1, and 3.3.2, the configure script check for the
# zlib version fails to handle versions longer than 5 characters.
# Skip builds affected by this bug. Most newer distros will be affected.
# https://github.com/rstudio/r-builds/issues/76
if version in ['3.3.0', '3.3.1', '3.3.2'] and platform not in ['centos-7']:
continue
job_ids.append(_submit_job(version, platform))
event['jobIds'] = job_ids
return event
Expand Down

0 comments on commit 03dbd45

Please sign in to comment.