Skip to content
This repository was archived by the owner on Oct 2, 2025. It is now read-only.

Commit 9a605d0

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 34cf71e + cdacc88 commit 9a605d0

File tree

64 files changed

+2430
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2430
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PLATFORMS := ubuntu-2004 ubuntu-2204 ubuntu-2404 debian-12 centos-7 centos-8 rhel-9 opensuse-156 fedora-40 fedora-41
1+
PLATFORMS := ubuntu-2004 ubuntu-2204 ubuntu-2404 debian-12 centos-7 centos-8 rhel-9 opensuse-156 fedora-40 fedora-41 fedora-42
22
SLS_BINARY ?= ./node_modules/serverless/bin/serverless.js
33

44
deps:

builder/Dockerfile.fedora-42

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
FROM fedora:42
2+
3+
ENV OS_IDENTIFIER fedora-42
4+
5+
RUN dnf -y upgrade \
6+
&& dnf -y install dnf-plugins-core \
7+
&& dnf -y install \
8+
autoconf \
9+
automake \
10+
bzip2-devel \
11+
cairo-devel \
12+
flexiblas-devel \
13+
gcc-c++ \
14+
gcc-gfortran \
15+
java-21-openjdk-devel \
16+
libICE-devel \
17+
libSM-devel \
18+
libX11-devel \
19+
libXmu-devel \
20+
libXt-devel \
21+
libcurl-devel \
22+
libicu-devel \
23+
libjpeg-devel \
24+
libpng-devel \
25+
libtiff-devel \
26+
libtool \
27+
make \
28+
ncurses-devel \
29+
pango-devel \
30+
pcre-devel \
31+
pcre2-devel \
32+
readline-devel \
33+
rpm-build \
34+
tcl-devel \
35+
tex \
36+
texinfo-tex \
37+
texlive-collection-latexrecommended \
38+
tk-devel \
39+
unzip \
40+
valgrind-devel \
41+
which \
42+
wget \
43+
xz-devel \
44+
zlib-devel \
45+
&& dnf clean all
46+
47+
# Install AWS CLI
48+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
49+
unzip awscliv2.zip && \
50+
./aws/install && \
51+
rm -rf aws awscliv2.zip
52+
53+
RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
54+
55+
RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(cat /tmp/arch).rpm" && \
56+
dnf install -y "nfpm_$(cat /tmp/arch).rpm" && \
57+
rm "nfpm_$(cat /tmp/arch).rpm"
58+
59+
RUN chmod 0777 /opt
60+
61+
# Configure flags for that don't use the defaults in build.sh
62+
ENV CONFIGURE_OPTIONS="\
63+
--enable-R-shlib \
64+
--with-tcltk \
65+
--enable-memory-profiling \
66+
--with-x \
67+
--with-system-valgrind-headers \
68+
--with-tcl-config=/usr/lib64/tclConfig.sh \
69+
--with-tk-config=/usr/lib64/tkConfig.sh \
70+
--enable-prebuilt-html \
71+
--with-blas=flexiblas \
72+
--with-lapack=flexiblas"
73+
74+
# Make sure that patching Java does not break R.
75+
# R's default JAVA_HOME path includes the exact Java version on CentOS/RHEL, which
76+
# requires users to run `R CMD javareconf` even on minor/patch upgrades. Use the
77+
# major version symlink to avoid this.
78+
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Java-support
79+
# https://solutions.posit.co/envs-pkgs/using-rjava/
80+
ENV JAVA_HOME=/usr/lib/jvm/jre-11-openjdk
81+
82+
# R 3.x requires PCRE2 for Pango support on RHEL 9
83+
ENV INCLUDE_PCRE2_IN_R_3 yes
84+
85+
COPY package.fedora-42 /package.sh
86+
COPY build.sh .
87+
COPY patches /patches
88+
ENTRYPOINT ./build.sh

builder/build.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,24 @@ compile_r() {
101101
# https://cran.r-project.org/doc/manuals/r-release/NEWS.3.html
102102
# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Using-Fortran
103103
# https://gcc.gnu.org/gcc-10/porting_to.html
104+
export CFLAGS="-g -O2"
105+
export FFLAGS="-g -O2"
104106
gcc_major_version=$(gcc -dumpversion | cut -d '.' -f 1)
105107
if _version_is_less_than "${r_version}" 3.6.2 && _version_is_greater_than "${gcc_major_version}" 9; then
106108
# Default CFLAGS/FFLAGS for all R 3.x versions is '-g -O2' when using GCC
107-
export CFLAGS='-g -O2 -fcommon'
108-
export FFLAGS='-g -O2 -fallow-argument-mismatch'
109-
echo "Setting CFLAGS: ${CFLAGS}"
110-
echo "Setting FFLAGS: ${FFLAGS}"
109+
export CFLAGS="$CFLAGS -fcommon"
110+
export FFLAGS="$FFLAGS -fallow-argument-mismatch"
111111
fi
112112

113+
# GCC 15 and above needs -std=gnu11, because it defaults to C23, and R
114+
# versions below R 4.5.0 do not compile in C23 mode.
115+
if _version_is_less_than "${r_version}" 4.5.0 && _version_is_greater_than "${gcc_major_version}" 14; then
116+
export CFLAGS="$CFLAGS -std=gnu11"
117+
fi
118+
119+
echo "Setting CFLAGS: ${CFLAGS}"
120+
echo "Setting FFLAGS: ${FFLAGS}"
121+
113122
# Avoid a PCRE2 dependency for R 3.5 and 3.6. R 3.x uses PCRE1, but R 3.5+
114123
# will link against PCRE2 if present, although it is not actually used.
115124
# Since there's no way to disable this in the configure script, and we need

builder/docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,15 @@ services:
119119
image: r-builds:fedora-41
120120
volumes:
121121
- ./integration/tmp:/tmp/output
122+
fedora-42:
123+
command: ./build.sh
124+
environment:
125+
- R_VERSION=${R_VERSION}
126+
- R_INSTALL_PATH=${R_INSTALL_PATH}
127+
- LOCAL_STORE=/tmp/output
128+
build:
129+
context: .
130+
dockerfile: Dockerfile.fedora-42
131+
image: r-builds:fedora-42
132+
volumes:
133+
- ./integration/tmp:/tmp/output

builder/package.fedora-42

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/bin/bash
2+
3+
if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
4+
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
5+
fi
6+
7+
# R 3.x requires PCRE1. On RHEL 9, R 3.x also requires PCRE2 for Pango support.
8+
pcre_libs='- pcre2-devel'
9+
if [[ "${R_VERSION}" =~ ^3 ]]; then
10+
pcre_libs='- pcre2-devel
11+
- pcre-devel'
12+
fi
13+
14+
# R 4.5.0 and later require libzstd (with headers to link against libR)
15+
zstd_libs='# - libzstd-devel'
16+
if grep -q '^LIBS *=.*[-]lzstd' ${R_INSTALL_PATH}/lib/R/etc/Makeconf; then
17+
zstd_libs='- libzstd-devel'
18+
fi
19+
20+
blas_lib='flexiblas-devel'
21+
22+
# Create postremove script to remove empty directories, as nFPM doesn't include them in the RPM files.
23+
cat <<EOF >> /after-remove.sh
24+
if [ -d ${R_INSTALL_PATH} ]; then
25+
rm -r ${R_INSTALL_PATH}
26+
fi
27+
EOF
28+
29+
scripts="scripts:
30+
postremove: /after-remove.sh
31+
"
32+
33+
if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch
34+
35+
cat <<EOF > /tmp/nfpm.yml
36+
name: R-${R_VERSION}
37+
version: 1
38+
version_schema: none
39+
arch: $(cat /tmp/arch)
40+
release: 1
41+
maintainer: Posit Software, PBC <https://github.com/rstudio/r-builds>
42+
description: |
43+
GNU R statistical computation and graphics system
44+
vendor: Posit Software, PBC
45+
homepage: https://www.r-project.org
46+
license: GPLv2+
47+
depends:
48+
- bzip2-devel
49+
- gcc
50+
- gcc-c++
51+
- gcc-gfortran
52+
- libcurl-devel
53+
- libicu-devel
54+
- libSM
55+
- libtiff
56+
- libXmu
57+
- libXt
58+
${zstd_libs}
59+
- make
60+
- ${blas_lib}
61+
- pango
62+
${pcre_libs}
63+
- tcl
64+
- tk
65+
- unzip
66+
- util-linux-core
67+
- which
68+
- xz-devel
69+
- zip
70+
- zlib-devel
71+
contents:
72+
- src: ${R_INSTALL_PATH}
73+
dst: ${R_INSTALL_PATH}
74+
${scripts}
75+
EOF
76+
77+
nfpm package \
78+
-f /tmp/nfpm.yml \
79+
-p rpm \
80+
-t "/tmp/output/${OS_IDENTIFIER}"
81+
82+
export PKG_FILE=$(ls /tmp/output/${OS_IDENTIFIER}/R-${R_VERSION}*.rpm | head -1)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
R-3.0.3-fedora-42.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
R-3.0.3-fedora-42.patch
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
R-3.0.3-fedora-42.patch
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
diff --git a/configure b/configure
2+
index 6aea90a..add4f05 100755
3+
--- a/configure
4+
+++ b/configure
5+
@@ -33626,7 +33626,7 @@ char BZ2_bzlibVersion ();
6+
7+
#endif
8+
int
9+
-main ()
10+
+main (void)
11+
{
12+
return BZ2_bzlibVersion ();
13+
;
14+
@@ -33690,9 +33690,11 @@ else
15+
/* end confdefs.h. */
16+
17+
#ifdef HAVE_BZLIB_H
18+
+#include <stdlib.h> // for exit
19+
+#include <string.h> // for strcmp
20+
#include <bzlib.h>
21+
#endif
22+
-int main() {
23+
+int main(void) {
24+
char *ver = BZ2_bzlibVersion();
25+
exit(strcmp(ver, "1.0.6") < 0);
26+
}
27+
From 5c5c426023c4f2c9d22582a5f94f9b3337f4973b Mon Sep 17 00:00:00 2001
28+
From: plummer <plummer@00db46b3-68df-0310-9c12-caf00c1e9a41>
29+
Date: Wed, 16 Apr 2025 21:29:31 +0000
30+
Subject: [PATCH] Fixes for Tcl v9
31+
32+
git-svn-id: https://svn.r-project.org/R/trunk@88149 00db46b3-68df-0310-9c12-caf00c1e9a41
33+
---
34+
src/library/tcltk/src/tcltk.c | 46 ++++++++++++++++++++---------------
35+
1 file changed, 26 insertions(+), 20 deletions(-)
36+
37+
diff --git a/src/library/tcltk/src/tcltk.c b/src/library/tcltk/src/tcltk.c
38+
index a326ddb6731..c55c9b31424 100644
39+
--- a/src/library/tcltk/src/tcltk.c
40+
+++ b/src/library/tcltk/src/tcltk.c
41+
@@ -36,6 +36,11 @@
42+
43+
Tcl_Interp *RTcl_interp;
44+
45+
+/* For Tcl < 8.7 */
46+
+#ifndef TCL_SIZE_MAX
47+
+typedef int Tcl_Size;
48+
+#endif
49+
+
50+
static void RTcl_dec_refcount(SEXP R_tclobj)
51+
{
52+
Tcl_DecrRefCount((Tcl_Obj *) R_ExternalPtrAddr(R_tclobj));
53+
@@ -331,9 +336,9 @@ SEXP RTcl_StringFromObj(SEXP args)
54+
55+
SEXP RTcl_ObjAsCharVector(SEXP args)
56+
{
57+
- int count;
58+
+ Tcl_Size count, i;
59+
Tcl_Obj **elem, *obj;
60+
- int ret, i;
61+
+ int ret;
62+
SEXP ans;
63+
64+
if (TYPEOF(CADR(args)) != EXTPTRSXP)
65+
@@ -341,10 +346,10 @@ SEXP RTcl_ObjAsCharVector(SEXP args)
66+
obj = (Tcl_Obj *) R_ExternalPtrAddr(CADR(args));
67+
if (!obj) error(_("invalid tclObj -- perhaps saved from another session?"));
68+
ret = Tcl_ListObjGetElements(RTcl_interp, obj, &count, &elem);
69+
- if (ret != TCL_OK)
70+
+ if (ret != TCL_OK || count > R_XLEN_T_MAX)
71+
return RTcl_StringFromObj(args);
72+
-
73+
- PROTECT(ans = allocVector(STRSXP, count));
74+
+
75+
+ PROTECT(ans = allocVector(STRSXP, (R_xlen_t) count));
76+
for (i = 0 ; i < count ; i++) {
77+
char *s;
78+
Tcl_DString s_ds;
79+
@@ -405,9 +410,9 @@ SEXP RTcl_ObjFromCharVector(SEXP args)
80+
81+
SEXP RTcl_ObjAsDoubleVector(SEXP args)
82+
{
83+
- int count;
84+
+ Tcl_Size count, i;
85+
Tcl_Obj **elem, *obj;
86+
- int ret, i;
87+
+ int ret;
88+
double x;
89+
SEXP ans;
90+
91+
@@ -422,10 +427,10 @@ SEXP RTcl_ObjAsDoubleVector(SEXP args)
92+
93+
/* Then try as list */
94+
ret = Tcl_ListObjGetElements(RTcl_interp, obj, &count, &elem);
95+
- if (ret != TCL_OK) /* didn't work, return NULL */
96+
+ if (ret != TCL_OK || count > R_XLEN_T_MAX) /* didn't work, return NULL */
97+
return R_NilValue;
98+
-
99+
- ans = allocVector(REALSXP, count);
100+
+
101+
+ ans = allocVector(REALSXP, (R_xlen_t) count);
102+
for (i = 0 ; i < count ; i++){
103+
ret = Tcl_GetDoubleFromObj(RTcl_interp, elem[i], &x);
104+
if (ret != TCL_OK) x = NA_REAL;
105+
@@ -470,9 +475,9 @@ SEXP RTcl_ObjFromDoubleVector(SEXP args)
106+
107+
SEXP RTcl_ObjAsIntVector(SEXP args)
108+
{
109+
- int count;
110+
+ Tcl_Size count, i;
111+
Tcl_Obj **elem, *obj;
112+
- int ret, i;
113+
+ int ret;
114+
int x;
115+
SEXP ans;
116+
117+
@@ -487,10 +492,10 @@ SEXP RTcl_ObjAsIntVector(SEXP args)
118+
119+
/* Then try as list */
120+
ret = Tcl_ListObjGetElements(RTcl_interp, obj, &count, &elem);
121+
- if (ret != TCL_OK) /* didn't work, return NULL */
122+
+ if (ret != TCL_OK || count > R_XLEN_T_MAX) /* didn't work, return NULL */
123+
return R_NilValue;
124+
-
125+
- ans = allocVector(INTSXP, count);
126+
+
127+
+ ans = allocVector(INTSXP, (R_xlen_t) count);
128+
for (i = 0 ; i < count ; i++){
129+
ret = Tcl_GetIntFromObj(RTcl_interp, elem[i], &x);
130+
if (ret != TCL_OK) x = NA_INTEGER;
131+
@@ -525,7 +530,7 @@ SEXP RTcl_ObjFromIntVector(SEXP args)
132+
133+
SEXP RTcl_ObjAsRawVector(SEXP args)
134+
{
135+
- int nb, count, i, j;
136+
+ Tcl_Size count, nb, i, j;
137+
Tcl_Obj **elem, *obj;
138+
unsigned char *ret;
139+
SEXP ans, el;
140+
@@ -536,7 +541,7 @@ SEXP RTcl_ObjAsRawVector(SEXP args)
141+
if (!obj) error(_("invalid tclObj -- perhaps saved from another session?"));
142+
ret = Tcl_GetByteArrayFromObj(obj, &nb);
143+
if (ret) {
144+
- ans = allocVector(RAWSXP, nb);
145+
+ ans = allocVector(RAWSXP, (R_xlen_t) nb);
146+
for (j = 0 ; j < nb ; j++) RAW(ans)[j] = ret[j];
147+
return ans;
148+
}
149+
@@ -544,10 +549,11 @@ SEXP RTcl_ObjAsRawVector(SEXP args)
150+
/* Then try as list */
151+
if (Tcl_ListObjGetElements(RTcl_interp, obj, &count, &elem)
152+
!= TCL_OK) return R_NilValue;
153+
-
154+
- PROTECT(ans = allocVector(VECSXP, count));
155+
+ if (count > R_XLEN_T_MAX) return R_NilValue;
156+
+
157+
+ PROTECT(ans = allocVector(VECSXP, (R_xlen_t) count));
158+
for (i = 0 ; i < count ; i++) {
159+
- el = allocVector(RAWSXP, nb);
160+
+ el = allocVector(RAWSXP, (R_xlen_t) nb);
161+
SET_VECTOR_ELT(ans, i, el);
162+
ret = Tcl_GetByteArrayFromObj(elem[i], &nb);
163+
for (j = 0 ; j < nb ; j++) RAW(el)[j] = ret[j];
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
R-3.1.3-fedora-42.patch

0 commit comments

Comments
 (0)