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

Fix R 3.3.0-3.3.2 builds #179

Merged
merged 3 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on previous notes, CentOS 7 was supposedly unaffected, and I do see an installer up at https://cdn.rstudio.com/r/centos-7/pkgs/R-3.3.0-1-1.x86_64.rpm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, OK. OTOH, it also does not hurt to do it for CentOS 7 as well, and then it is simpler if we do it everywhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, that's a fine reason to keep it in then.

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`).