From 798ee103cfd44222ce6988a844e244b955b5bd57 Mon Sep 17 00:00:00 2001 From: Mauricio 'Pacha' Vargas Sepulveda Date: Sun, 10 Nov 2024 01:22:32 -0500 Subject: [PATCH 1/6] fedora 36 clang-asan --- containers/fedora36-clang-asan/Dockerfile | 124 ++++++++++++++++++++++ containers/fedora36-clang-asan/r-check | 41 +++++++ 2 files changed, 165 insertions(+) create mode 100644 containers/fedora36-clang-asan/Dockerfile create mode 100755 containers/fedora36-clang-asan/r-check diff --git a/containers/fedora36-clang-asan/Dockerfile b/containers/fedora36-clang-asan/Dockerfile new file mode 100644 index 00000000..f0c66172 --- /dev/null +++ b/containers/fedora36-clang-asan/Dockerfile @@ -0,0 +1,124 @@ +FROM fedora:36 AS builder + +# ------------------------------------------------------------------------------------ +# Install dependencies for building clang and R from source + +RUN dnf update -y && \ + dnf install -y gcc gcc-c++ make cmake python3 git dnf-plugins-core && \ + dnf config-manager --set-enabled fedora-modular && \ + dnf groupinstall "Development Tools" -y && \ + dnf install -y ninja-build which && \ + dnf clean all + +# ------------------------------------------------------------------------------------ +# Build and install clang 19 from source + +RUN cd /tmp && \ + git clone https://github.com/llvm/llvm-project.git && \ + cd llvm-project && \ + git checkout release/19.x && \ + mkdir -p build && \ + cd build && \ + cmake -G Ninja ../llvm \ + -DLLVM_ENABLE_PROJECTS="clang" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/local/llvm-19 && \ + ninja && \ + ninja install && \ + cd /tmp && \ + rm -rf llvm-project + +# ------------------------------------------------------------------------------------ +# Build R from source + +ENV R_VERSION="2024-11-08_r87310" +RUN dnf builddep -y R && \ + curl -O https://cran.r-project.org/src/base-prerelease/R-devel_${R_VERSION}.tar.gz && \ + tar -xzvf R-devel_${R_VERSION}.tar.gz && \ + cd R-devel && \ + ./configure \ + --prefix=/opt/R/${R_VERSION} \ + --enable-R-shlib \ + --enable-memory-profiling && \ + make -j$(nproc) && \ + make install && \ + cd /tmp && \ + rm -rf R-devel + +# ------------------------------------------------------------------------------------ +# Final stage: Create a minimal image with only the necessary components + +FROM fedora:36 + +# Copy Clang and R from the builder stage +COPY --from=builder /usr/local/llvm-19 /usr/local/llvm-19 +COPY --from=builder /opt/R /opt/R + +# Install runtime dependencies +RUN dnf update -y && \ + dnf install -y glibc-langpack-en protobuf ImageMagick poppler pkg-config \ + perl qpdf tidy libgfortran libicu which && \ + dnf clean all + +# Set environment variables +ENV R_VERSION="2024-11-08_r87310" +ENV PATH="/usr/local/llvm-19/bin:/opt/R/${R_VERSION}/bin:${PATH}" +ENV LC_COLLATE=C +ENV LANG=en_GB.UTF-8 +ENV PKG_SYSREQS=true +ENV R_PKG_SYSREQS2=true +ENV ASAN_OPTIONS="detect_leaks=0" +ENV UBSAN_OPTIONS="print_stacktrace=1" +ENV RJAVA_JVM_STACK_WORKAROUND=0 +ENV RGL_USE_NULL=true +ENV R_DONT_USE_TK=true +ENV OMP_THREAD_LIMIT=2 +ENV R_DATATABLE_NUM_THREADS=2 +ENV _R_CHECK_TESTS_NLINES_="0" +ENV CHECK_ARGS="--extra-arch --no-stop-on-test-error" + +# Configure R +RUN echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' \ + >> /opt/R/${R_VERSION}/lib64/R/library/base/R/Rprofile && \ + if [ "$(uname -p)" = "x86_64" ]; then \ + echo "options(pkg.current_platform = 'x86_64-pc-linux-gnu-fedora-36-libc++')" \ + >> /opt/R/${R_VERSION}/lib64/R/library/base/R/Rprofile; \ + RVER="4.5"; \ + echo "options(repos = c(RHUB = 'https://raw.githubusercontent.com/r-hub/repos/main/fedora-36/${RVER}/libc++', getOption('repos')))" \ + >> /opt/R/${R_VERSION}/lib64/R/library/base/R/Rprofile; \ + echo 'options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"])))' \ + >> /opt/R/${R_VERSION}/lib64/R/library/base/R/Rprofile; \ + fi + +# Use user's package library +RUN Rscript -e 'dir.create(Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)' + +# Copy check script +COPY r-check /usr/local/bin + +# # Update the system config +RUN app="-fsanitize=address,undefined -fno-sanitize=float-divide-by-zero -fno-sanitize=alignment -fno-omit-frame-pointer -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -fsanitize=signed-integer-overflow"; \ + appxx="$app -frtti"; \ + makeconf="/opt/R/${R_VERSION}/lib64/R/etc/Makeconf"; \ + sed -i -E '/^CC ?=/ s/$/ '"$app"/ "${makeconf}" && \ + sed -i -E '/^CC[0-9][0-9] ?=/ s/$/ '"$app"/ "${makeconf}" && \ + sed -i -E '/^CXX ?=/ s/$/ '"$appxx"/ "${makeconf}" && \ + sed -i -E '/^CXX[0-9][0-9] ?=/ s/$/ '"$appxx"/ "${makeconf}" + +# # Set compiler options +RUN mkdir -p /root/.R && \ + echo 'CLANGLIB=-stdlib=libc++' >> /root/.R/Makevars && \ + echo 'CXX=$(CCACHE) clang++ $(CLANGLIB)' >> /root/.R/Makevars && \ + echo 'CC=$(CCACHE) clang' >> /root/.R/Makevars && \ + echo 'SHLIB_CXXLD=clang++ $(CLANGLIB)' >> /root/.R/Makevars && \ + echo 'CXXFLAGS=-Wall -O0 -pedantic' >> /root/.R/Makevars + +# # Install pak +RUN Rscript -e \ + 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/%s/%s/%s/%s", "devel", .Platform$pkgType, R.Version()$os, R.Version()$arch))' + +RUN dnf clean all -y + +# Check compiler +RUN Rscript -e "pak::pkg_install('pkgbuild')" && \ + Rscript -e "pkgbuild::check_build_tools(debug = TRUE)" diff --git a/containers/fedora36-clang-asan/r-check b/containers/fedora36-clang-asan/r-check new file mode 100755 index 00000000..2bb3a8dd --- /dev/null +++ b/containers/fedora36-clang-asan/r-check @@ -0,0 +1,41 @@ +#! /bin/bash +set -e + +checkdir=${1-/check} + +do_check () { + pkg=${1} + echo Checking "$pkg" + cd `dirname $pkg` + R -q -e "pak::pkg_install('deps::$pkg', dependencies = TRUE)" + R CMD check $CHECK_ARGS $pkg + packagename=$(basename $pkg | sed "s/_.*$//") + cd ${packagename}.Rcheck + fail=false + exfile="${packagename}-Ex.Rout" + pattern='UndefinedBehaviorSanitizer\|AddressSanitizer' + if [[ -f "${exfile}" ]] && grep -q ${pattern} ${exfile}; then + fail=true + echo ---------------------------------------------------------- + echo ${exfile} + echo ---------------------------------------------------------- + cat ${exfile} + echo ---------------------------------------------------------- + fi + testfiles=$(ls tests | grep ".Rout.fail$") + for f in $testfiles; do + if grep -q ${pattern} tests/$f; then + fail=true + echo ---------------------------------------------------------- + echo tests/${f} + echo ---------------------------------------------------------- + cat tests/${f} + echo ---------------------------------------------------------- + fi + done + if [[ "$fail" = "true" ]]; then exit 1; fi +} + +for pkg in `ls $checkdir/*.tar.gz`; do + do_check "$pkg" +done From 67734b09c327d709d74d6aa0f2650b522b121855 Mon Sep 17 00:00:00 2001 From: Mauricio 'Pacha' Vargas Sepulveda Date: Mon, 11 Nov 2024 17:23:13 -0500 Subject: [PATCH 2/6] clang-asan: upgrade to clang 19 --- containers/clang-asan/Dockerfile | 10 +- containers/fedora36-clang-asan/Dockerfile | 124 ---------------------- containers/fedora36-clang-asan/r-check | 41 ------- 3 files changed, 5 insertions(+), 170 deletions(-) delete mode 100644 containers/fedora36-clang-asan/Dockerfile delete mode 100755 containers/fedora36-clang-asan/r-check diff --git a/containers/clang-asan/Dockerfile b/containers/clang-asan/Dockerfile index f87ba8e0..24c82a3c 100644 --- a/containers/clang-asan/Dockerfile +++ b/containers/clang-asan/Dockerfile @@ -15,18 +15,18 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get clean # ------------------------------------------------------------------------------------ -# clang 18 +# clang 19 RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update -y && \ apt-get install -y gnupg && \ - echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" \ + echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" \ > /etc/apt/sources.list.d/llvm.list && \ - echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" \ + echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" \ >> /etc/apt/sources.list.d/llvm.list && \ curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \ apt-get update -y && \ - apt-get install -y clang-18 libc++abi-18-dev libc++-18-dev libomp-18-dev flang-18 && \ + apt-get install -y clang-19 libc++abi-19-dev libc++-19-dev libomp-19-dev flang-19 && \ apt-get clean # ------------------------------------------------------------------------------------ @@ -37,7 +37,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ > /etc/apt/sources.list.d/rhub.list && \ curl -L https://raw.githubusercontent.com/r-hub/repos-ppa/main/rhub.gpg.key | apt-key add - && \ apt-get update -y && \ - apt-get install protobuf-clang18 jags-clang18 imagemagick-clang18 poppler-clang18 + apt-get install protobuf-clang19 jags-clang19 imagemagick-clang19 poppler-clang19 # ------------------------------------------------------------------------------------ # Useful system packages, some are needed for R CMD check diff --git a/containers/fedora36-clang-asan/Dockerfile b/containers/fedora36-clang-asan/Dockerfile deleted file mode 100644 index f0c66172..00000000 --- a/containers/fedora36-clang-asan/Dockerfile +++ /dev/null @@ -1,124 +0,0 @@ -FROM fedora:36 AS builder - -# ------------------------------------------------------------------------------------ -# Install dependencies for building clang and R from source - -RUN dnf update -y && \ - dnf install -y gcc gcc-c++ make cmake python3 git dnf-plugins-core && \ - dnf config-manager --set-enabled fedora-modular && \ - dnf groupinstall "Development Tools" -y && \ - dnf install -y ninja-build which && \ - dnf clean all - -# ------------------------------------------------------------------------------------ -# Build and install clang 19 from source - -RUN cd /tmp && \ - git clone https://github.com/llvm/llvm-project.git && \ - cd llvm-project && \ - git checkout release/19.x && \ - mkdir -p build && \ - cd build && \ - cmake -G Ninja ../llvm \ - -DLLVM_ENABLE_PROJECTS="clang" \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr/local/llvm-19 && \ - ninja && \ - ninja install && \ - cd /tmp && \ - rm -rf llvm-project - -# ------------------------------------------------------------------------------------ -# Build R from source - -ENV R_VERSION="2024-11-08_r87310" -RUN dnf builddep -y R && \ - curl -O https://cran.r-project.org/src/base-prerelease/R-devel_${R_VERSION}.tar.gz && \ - tar -xzvf R-devel_${R_VERSION}.tar.gz && \ - cd R-devel && \ - ./configure \ - --prefix=/opt/R/${R_VERSION} \ - --enable-R-shlib \ - --enable-memory-profiling && \ - make -j$(nproc) && \ - make install && \ - cd /tmp && \ - rm -rf R-devel - -# ------------------------------------------------------------------------------------ -# Final stage: Create a minimal image with only the necessary components - -FROM fedora:36 - -# Copy Clang and R from the builder stage -COPY --from=builder /usr/local/llvm-19 /usr/local/llvm-19 -COPY --from=builder /opt/R /opt/R - -# Install runtime dependencies -RUN dnf update -y && \ - dnf install -y glibc-langpack-en protobuf ImageMagick poppler pkg-config \ - perl qpdf tidy libgfortran libicu which && \ - dnf clean all - -# Set environment variables -ENV R_VERSION="2024-11-08_r87310" -ENV PATH="/usr/local/llvm-19/bin:/opt/R/${R_VERSION}/bin:${PATH}" -ENV LC_COLLATE=C -ENV LANG=en_GB.UTF-8 -ENV PKG_SYSREQS=true -ENV R_PKG_SYSREQS2=true -ENV ASAN_OPTIONS="detect_leaks=0" -ENV UBSAN_OPTIONS="print_stacktrace=1" -ENV RJAVA_JVM_STACK_WORKAROUND=0 -ENV RGL_USE_NULL=true -ENV R_DONT_USE_TK=true -ENV OMP_THREAD_LIMIT=2 -ENV R_DATATABLE_NUM_THREADS=2 -ENV _R_CHECK_TESTS_NLINES_="0" -ENV CHECK_ARGS="--extra-arch --no-stop-on-test-error" - -# Configure R -RUN echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' \ - >> /opt/R/${R_VERSION}/lib64/R/library/base/R/Rprofile && \ - if [ "$(uname -p)" = "x86_64" ]; then \ - echo "options(pkg.current_platform = 'x86_64-pc-linux-gnu-fedora-36-libc++')" \ - >> /opt/R/${R_VERSION}/lib64/R/library/base/R/Rprofile; \ - RVER="4.5"; \ - echo "options(repos = c(RHUB = 'https://raw.githubusercontent.com/r-hub/repos/main/fedora-36/${RVER}/libc++', getOption('repos')))" \ - >> /opt/R/${R_VERSION}/lib64/R/library/base/R/Rprofile; \ - echo 'options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"])))' \ - >> /opt/R/${R_VERSION}/lib64/R/library/base/R/Rprofile; \ - fi - -# Use user's package library -RUN Rscript -e 'dir.create(Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)' - -# Copy check script -COPY r-check /usr/local/bin - -# # Update the system config -RUN app="-fsanitize=address,undefined -fno-sanitize=float-divide-by-zero -fno-sanitize=alignment -fno-omit-frame-pointer -fsanitize=pointer-overflow -fsanitize-trap=pointer-overflow -fsanitize=signed-integer-overflow"; \ - appxx="$app -frtti"; \ - makeconf="/opt/R/${R_VERSION}/lib64/R/etc/Makeconf"; \ - sed -i -E '/^CC ?=/ s/$/ '"$app"/ "${makeconf}" && \ - sed -i -E '/^CC[0-9][0-9] ?=/ s/$/ '"$app"/ "${makeconf}" && \ - sed -i -E '/^CXX ?=/ s/$/ '"$appxx"/ "${makeconf}" && \ - sed -i -E '/^CXX[0-9][0-9] ?=/ s/$/ '"$appxx"/ "${makeconf}" - -# # Set compiler options -RUN mkdir -p /root/.R && \ - echo 'CLANGLIB=-stdlib=libc++' >> /root/.R/Makevars && \ - echo 'CXX=$(CCACHE) clang++ $(CLANGLIB)' >> /root/.R/Makevars && \ - echo 'CC=$(CCACHE) clang' >> /root/.R/Makevars && \ - echo 'SHLIB_CXXLD=clang++ $(CLANGLIB)' >> /root/.R/Makevars && \ - echo 'CXXFLAGS=-Wall -O0 -pedantic' >> /root/.R/Makevars - -# # Install pak -RUN Rscript -e \ - 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/%s/%s/%s/%s", "devel", .Platform$pkgType, R.Version()$os, R.Version()$arch))' - -RUN dnf clean all -y - -# Check compiler -RUN Rscript -e "pak::pkg_install('pkgbuild')" && \ - Rscript -e "pkgbuild::check_build_tools(debug = TRUE)" diff --git a/containers/fedora36-clang-asan/r-check b/containers/fedora36-clang-asan/r-check deleted file mode 100755 index 2bb3a8dd..00000000 --- a/containers/fedora36-clang-asan/r-check +++ /dev/null @@ -1,41 +0,0 @@ -#! /bin/bash -set -e - -checkdir=${1-/check} - -do_check () { - pkg=${1} - echo Checking "$pkg" - cd `dirname $pkg` - R -q -e "pak::pkg_install('deps::$pkg', dependencies = TRUE)" - R CMD check $CHECK_ARGS $pkg - packagename=$(basename $pkg | sed "s/_.*$//") - cd ${packagename}.Rcheck - fail=false - exfile="${packagename}-Ex.Rout" - pattern='UndefinedBehaviorSanitizer\|AddressSanitizer' - if [[ -f "${exfile}" ]] && grep -q ${pattern} ${exfile}; then - fail=true - echo ---------------------------------------------------------- - echo ${exfile} - echo ---------------------------------------------------------- - cat ${exfile} - echo ---------------------------------------------------------- - fi - testfiles=$(ls tests | grep ".Rout.fail$") - for f in $testfiles; do - if grep -q ${pattern} tests/$f; then - fail=true - echo ---------------------------------------------------------- - echo tests/${f} - echo ---------------------------------------------------------- - cat tests/${f} - echo ---------------------------------------------------------- - fi - done - if [[ "$fail" = "true" ]]; then exit 1; fi -} - -for pkg in `ls $checkdir/*.tar.gz`; do - do_check "$pkg" -done From 37b13b67886a86545c34776e6bec6709aaa973af Mon Sep 17 00:00:00 2001 From: Mauricio 'Pacha' Vargas Sepulveda Date: Tue, 12 Nov 2024 23:32:03 -0500 Subject: [PATCH 3/6] gcc14 ubsan --- builder/Dockerfile.fedora-gcc14-ubsan | 89 ++++++++++++++++ containers/gcc14-ubsan/Dockerfile | 140 ++++++++++++++++++++++++++ containers/gcc14-ubsan/r-check | 18 ++++ 3 files changed, 247 insertions(+) create mode 100644 builder/Dockerfile.fedora-gcc14-ubsan create mode 100644 containers/gcc14-ubsan/Dockerfile create mode 100755 containers/gcc14-ubsan/r-check diff --git a/builder/Dockerfile.fedora-gcc14-ubsan b/builder/Dockerfile.fedora-gcc14-ubsan new file mode 100644 index 00000000..33f2cfd3 --- /dev/null +++ b/builder/Dockerfile.fedora-gcc14-ubsan @@ -0,0 +1,89 @@ + +FROM fedora:40 + +ENV OS_IDENTIFIER fedora-40 + +RUN dnf -y upgrade \ + && dnf -y install dnf-plugins-core \ + && dnf -y install \ + autoconf \ + automake \ + bzip2-devel \ + cairo-devel \ + gcc \ + g++ \ + gfortran \ + java-11-openjdk-devel \ + libICE-devel \ + libSM-devel \ + libX11-devel \ + libXmu-devel \ + libXt-devel \ + libcurl-devel \ + libicu-devel \ + libjpeg-devel \ + libpng-devel \ + libtiff-devel \ + libtool \ + make \ + ncurses-devel \ + pango-devel \ + pcre-devel \ + pcre2-devel \ + readline-devel \ + rpm-build \ + tcl-devel \ + tex \ + texinfo-tex \ + texlive-collection-latexrecommended \ + tk-devel \ + unzip \ + valgrind-devel \ + which \ + wget \ + xz-devel \ + zlib-devel \ + && dnf clean all + +RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch + +RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(cat /tmp/arch).rpm" && \ + dnf install -y "nfpm_$(cat /tmp/arch).rpm" && \ + rm "nfpm_$(cat /tmp/arch).rpm" + +RUN chmod 0777 /opt + +# Configure flags for RHEL 9 that don't use the defaults in build.sh +ENV CONFIGURE_OPTIONS="\ + --enable-R-shlib \ + --with-tcltk \ + --enable-memory-profiling \ + --with-x \ + --with-system-valgrind-headers \ + --with-tcl-config=/usr/lib64/tclConfig.sh \ + --with-tk-config=/usr/lib64/tkConfig.sh \ + --enable-prebuilt-html" + +# RHEL 9 doesn't have the inconsolata font, so override the defaults. +# This may be removed if RHEL ever adds the texlive-inconsolata package from Fedora. +# Or check `dnf provides '*/inconsolata.sty'` for a package that provides it. +# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Making-the-manuals +ENV R_RD4PDF="times,hyper" + +# Make sure that patching Java does not break R. +# R's default JAVA_HOME path includes the exact Java version on CentOS/RHEL, which +# requires users to run `R CMD javareconf` even on minor/patch upgrades. Use the +# major version symlink to avoid this. +# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Java-support +# https://solutions.posit.co/envs-pkgs/using-rjava/ +ENV JAVA_HOME=/usr/lib/jvm/jre-11-openjdk + +# R 3.x requires PCRE2 for Pango support on RHEL 9 +ENV INCLUDE_PCRE2_IN_R_3 yes + +COPY builder/config.fedora-gcc /config.site +COPY builder/config.fedora-gcc.aarch64 /config.site.aarch64 + +COPY builder/package.fedora-gcc /package.sh +COPY build.sh . +ENTRYPOINT ./build.sh diff --git a/containers/gcc14-ubsan/Dockerfile b/containers/gcc14-ubsan/Dockerfile new file mode 100644 index 00000000..5b2431e7 --- /dev/null +++ b/containers/gcc14-ubsan/Dockerfile @@ -0,0 +1,140 @@ + +FROM fedora:40 + +# ------------------------------------------------------------------------------------ +# Install pre-built R and requirements + +RUN dnf -y upgrade && \ + dnf -y install dnf-plugins-core && \ + dnf -y install curl && \ + curl -LO "https://github.com/r-hub/containers/releases/download/latest/R-rstudio-fedora-40-devel-gcc14-1-1.$(arch).rpm" && \ + yum install -y R-*.rpm && \ + rm R-*.rpm + +# Extra system packages that pak does not know about +RUN dnf install -y flexiblas +RUN dnf install -y https://rpms.r-pkg.org/fedora-38/jags-4.3.2-1.$(arch).rpm + +# ------------------------------------------------------------------------------------ +# Put R on PATH +# Auto-install system requirements + +ENV PATH="/opt/R/devel-gcc14/bin:${PATH}" +ENV PKG_SYSREQS=true +ENV R_PKG_SYSREQS2=true + +# ------------------------------------------------------------------------------------ +# Set CRAN repo, no P3M for Fedora + +RUN echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' \ + >> /opt/R/devel-gcc14/lib/R/library/base/R/Rprofile + +RUN if [ "$(arch)" = "x86_64" ]; then \ + . /etc/os-release; \ + RVER=$(R -s -e 'cat(paste(getRversion()[,1:2]))'); \ + echo "options(repos = c(RHUB = 'https://raw.githubusercontent.com/r-hub/repos/main/${ID}-${VERSION_ID}/${RVER}', getOption('repos')))" \ + >> /opt/R/devel-gcc14/lib/R/library/base/R/Rprofile; \ + echo 'options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"])))' \ + >> /opt/R/devel-gcc14/lib/R/library/base/R/Rprofile; \ + fi + +# ------------------------------------------------------------------------------------ +# Install pak + +RUN /opt/R/devel-gcc14/bin/R -q -e \ + 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/%s/%s/%s/%s", "devel", .Platform$pkgType, R.Version()$os, R.Version()$arch))' + +# ------------------------------------------------------------------------------------ +# Locale + +RUN dnf install -y glibc-langpack-en + +ENV LC_ALL en_GB.UTF-8 +ENV LANG en_GB.UTF-8 + +# ------------------------------------------------------------------------------------ +# Use user's package library for the rest + +RUN /opt/R/devel-gcc14/bin/R -q -e 'dir.create(Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)' + +# ------------------------------------------------------------------------------------ +# Copy check script + +COPY r-check /usr/local/bin + +# ------------------------------------------------------------------------------------ +# Useful system packages + +RUN dnf -y install pkg-config devscripts-checkbashisms qpdf git tidy + +# ------------------------------------------------------------------------------------ +# CRAN's config from https://www.stats.ox.ac.uk/pub/bdr/gcc14/README.txt +# +# > Installation checks with GCC 14.1, whose changelog is at +# > https://gcc.gnu.org/gcc-14/changes.html, and other details at +# > https://gcc.gnu.org/pipermail/gcc/2024-May/243921.html +# +# > Other details as https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-gcc + +ENV _R_CHECK_INSTALL_DEPENDS_ true +## the next is the default, but --as-cran has true +ENV _R_CHECK_SUGGESTS_ONLY_ false +ENV _R_CHECK_NO_RECOMMENDED_ true +ENV _R_CHECK_DOC_SIZES2_ true +ENV _R_CHECK_DEPRECATED_DEFUNCT_ true +ENV _R_CHECK_SCREEN_DEVICE_ warn +ENV _R_CHECK_REPLACING_IMPORTS_ true +ENV _R_CHECK_TOPLEVEL_FILES_ true +ENV _R_CHECK_DOT_FIRSTLIB_ true +ENV _R_CHECK_RD_LINE_WIDTHS_ true +ENV _R_CHECK_S3_METHODS_NOT_REGISTERED_ true +ENV _R_CHECK_OVERWRITE_REGISTERED_S3_METHODS_ true +ENV _R_CHECK_CODE_USAGE_WITH_ONLY_BASE_ATTACHED_ TRUE +ENV _R_CHECK_NATIVE_ROUTINE_REGISTRATION_ true +ENV _R_CHECK_FF_CALLS_ registration +ENV _R_CHECK_PRAGMAS_ true +ENV _R_CHECK_COMPILATION_FLAGS_ true +ENV _R_CHECK_R_DEPENDS_ true +ENV _R_CHECK_PACKAGES_USED_IN_TESTS_USE_SUBDIRS_ true +ENV _R_CHECK_PKG_SIZES_ false +ENV _R_CHECK_SHLIB_OPENMP_FLAGS_ true + +ENV _R_CHECK_LIMIT_CORES_ true +ENV _R_CHECK_LENGTH_1_CONDITION_ package:_R_CHECK_PACKAGE_NAME_,verbose +#ENV _R_CHECK_LENGTH_1_LOGIC2_="package:_R_CHECK_PACKAGE_NAME_,verbose" +ENV _R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_ true +ENV _R_CHECK_COMPILATION_FLAGS_KNOWN_="-Wno-deprecated-declarations -Wno-ignored-attributes -Wno-parentheses -Werror=format-security -Wp,-D_FORTIFY_SOURCE=3 -Werror=implicit-function-declaration" +ENV _R_CHECK_AUTOCONF_ true +ENV _R_CHECK_THINGS_IN_CHECK_DIR_ true +ENV _R_CHECK_THINGS_IN_TEMP_DIR_ true +ENV _R_CHECK_THINGS_IN_TEMP_DIR_EXCLUDE_="^ompi" +ENV _R_CHECK_BASHISMS_ true +ENV _R_CHECK_DEPENDS_ONLY_DATA_ true +ENV _R_CHECK_MATRIX_DATA_ TRUE +ENV _R_CHECK_RD_VALIDATE_RD2HTML_ true +ENV _R_CHECK_RD_MATH_RENDERING_ true + +# ------------------------------------------------------------------------------------ +# Check config, no need to check the PDF manual and vignettes here. +# We also avoid that bashism checks, as it needs external tools. + +ENV _R_CHECK_TESTS_NLINES_="0" +ENV CHECK_ARGS="--no-manual --no-build-vignettes" +ENV _R_CHECK_BASHISMS_=false + +# Support R CMD INSTALL --use-LTO ., similarly to CRAN at https://www.stats.ox.ac.uk/pub/bdr/LTO/README.txt +RUN echo -e '# Support --use-LTO\nLTO_OPT = -flto=10\nLTO_FC_OPT = -flto=10' >> /opt/R/devel-gcc14/lib/R/etc/Makeconf + +# ------------------------------------------------------------------------------------ +# UBSAN and ASAN configuration +# adapted from https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt + +RUN echo -e 'CC=gcc-14\nCXX="g++-14 -fsanitize=address,undefined,bounds-strict -fno-omit-frame-pointer"\nCFLAGS="-g -O2 -Wall -pedantic -mtune=native -fsanitize=address -Wp,-D_FORTIFY_SOURCE=3"\nFC=gfortran-14\nFFLAGS="-g -O2 -mtune=native"\nCXXFLAGS="-g -O2 -Wall -pedantic -mtune=native"\nMAIN_LDFLAGS="-fsanitize=address,undefined -pthread"' >> /opt/R/devel-gcc14/lib/R/etc/Makeconf + +RUN echo -e 'CC = gcc-14 -std=gnu99 -fsanitize=address,undefined -fno-omit-frame-pointer\nFC = gfortran-14 -fsanitize=address' >> ~/.R/Makevars + +ENV ASAN_OPTIONS='detect_leaks=0' +ENV UBSAN_OPTIONS='print_stacktrace=1' +ENV RJAVA_JVM_STACK_WORKAROUND=0 +ENV RGL_USE_NULL=true +ENV R_DONT_USE_TK=true diff --git a/containers/gcc14-ubsan/r-check b/containers/gcc14-ubsan/r-check new file mode 100755 index 00000000..898ce4e0 --- /dev/null +++ b/containers/gcc14-ubsan/r-check @@ -0,0 +1,18 @@ +#! /bin/bash +set -e + +checkdir=${1-/check} + +do_check () { + pkg=${1} + echo Checking "$pkg" + ( + cd `dirname $pkg` + R -q -e "pak::pkg_install('deps::$pkg', dependencies = TRUE)" + R CMD check $CHECK_ARGS $pkg + ) +} + +for pkg in `ls $checkdir/*.tar.gz`; do + do_check "$pkg" +done From fc94c863c505dcf55ae31b4871d820990306ff98 Mon Sep 17 00:00:00 2001 From: Mauricio 'Pacha' Vargas Sepulveda Date: Thu, 14 Nov 2024 11:14:30 -0500 Subject: [PATCH 4/6] enable ubsan --- containers/gcc14-ubsan/Dockerfile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/containers/gcc14-ubsan/Dockerfile b/containers/gcc14-ubsan/Dockerfile index 5b2431e7..f98cd822 100644 --- a/containers/gcc14-ubsan/Dockerfile +++ b/containers/gcc14-ubsan/Dockerfile @@ -1,4 +1,3 @@ - FROM fedora:40 # ------------------------------------------------------------------------------------ @@ -15,6 +14,11 @@ RUN dnf -y upgrade && \ RUN dnf install -y flexiblas RUN dnf install -y https://rpms.r-pkg.org/fedora-38/jags-4.3.2-1.$(arch).rpm +# ------------------------------------------------------------------------------------ +# Install development tools and sanitizers + +RUN dnf -y install libasan libubsan + # ------------------------------------------------------------------------------------ # Put R on PATH # Auto-install system requirements @@ -44,6 +48,12 @@ RUN if [ "$(arch)" = "x86_64" ]; then \ RUN /opt/R/devel-gcc14/bin/R -q -e \ 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/%s/%s/%s/%s", "devel", .Platform$pkgType, R.Version()$os, R.Version()$arch))' +# ------------------------------------------------------------------------------------ +# Install pkgbuild, rcmdcheck, and decor + +RUN /opt/R/devel-gcc14/bin/R -q -e \ + 'install.packages(c("pkgbuild", "rcmdcheck", "decor"), repos = "https://cran.rstudio.com")' + # ------------------------------------------------------------------------------------ # Locale @@ -129,10 +139,8 @@ RUN echo -e '# Support --use-LTO\nLTO_OPT = -flto=10\nLTO_FC_OPT = -flto=10' >> # UBSAN and ASAN configuration # adapted from https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt -RUN echo -e 'CC=gcc-14\nCXX="g++-14 -fsanitize=address,undefined,bounds-strict -fno-omit-frame-pointer"\nCFLAGS="-g -O2 -Wall -pedantic -mtune=native -fsanitize=address -Wp,-D_FORTIFY_SOURCE=3"\nFC=gfortran-14\nFFLAGS="-g -O2 -mtune=native"\nCXXFLAGS="-g -O2 -Wall -pedantic -mtune=native"\nMAIN_LDFLAGS="-fsanitize=address,undefined -pthread"' >> /opt/R/devel-gcc14/lib/R/etc/Makeconf - -RUN echo -e 'CC = gcc-14 -std=gnu99 -fsanitize=address,undefined -fno-omit-frame-pointer\nFC = gfortran-14 -fsanitize=address' >> ~/.R/Makevars - +RUN mkdir -p ~/.R/ && echo -e 'CC=gcc -std=gnu11 -fsanitize=address,undefined -fno-omit-frame-pointer\nFC=gfortran -fsanitize=address' >> ~/.R/Makevars +ENV LD_PRELOAD=/usr/lib64/libasan.so.8 ENV ASAN_OPTIONS='detect_leaks=0' ENV UBSAN_OPTIONS='print_stacktrace=1' ENV RJAVA_JVM_STACK_WORKAROUND=0 From 33a9d25e3f163c86e4c93bf7ef3368a1e2aeed87 Mon Sep 17 00:00:00 2001 From: Mauricio 'Pacha' Vargas Sepulveda Date: Thu, 14 Nov 2024 11:20:09 -0500 Subject: [PATCH 5/6] consistent deps installation --- builder/Dockerfile.fedora-gcc14-ubsan | 2 ++ containers/gcc14-ubsan/Dockerfile | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/builder/Dockerfile.fedora-gcc14-ubsan b/builder/Dockerfile.fedora-gcc14-ubsan index 33f2cfd3..1af42900 100644 --- a/builder/Dockerfile.fedora-gcc14-ubsan +++ b/builder/Dockerfile.fedora-gcc14-ubsan @@ -43,6 +43,8 @@ RUN dnf -y upgrade \ wget \ xz-devel \ zlib-devel \ + libasan \ + libubsan \ && dnf clean all RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch diff --git a/containers/gcc14-ubsan/Dockerfile b/containers/gcc14-ubsan/Dockerfile index f98cd822..5217bd53 100644 --- a/containers/gcc14-ubsan/Dockerfile +++ b/containers/gcc14-ubsan/Dockerfile @@ -14,11 +14,6 @@ RUN dnf -y upgrade && \ RUN dnf install -y flexiblas RUN dnf install -y https://rpms.r-pkg.org/fedora-38/jags-4.3.2-1.$(arch).rpm -# ------------------------------------------------------------------------------------ -# Install development tools and sanitizers - -RUN dnf -y install libasan libubsan - # ------------------------------------------------------------------------------------ # Put R on PATH # Auto-install system requirements From 9886289385ea99ca4729bdc3052a7f3664d1b118 Mon Sep 17 00:00:00 2001 From: Mauricio 'Pacha' Vargas Sepulveda Date: Fri, 15 Nov 2024 00:44:46 -0500 Subject: [PATCH 6/6] add libasan/ubsan directly to gcc14 image --- builder/Dockerfile.fedora-gcc14 | 2 + builder/Dockerfile.fedora-gcc14-ubsan | 91 ---------------- containers/gcc14-ubsan/Dockerfile | 143 -------------------------- containers/gcc14-ubsan/r-check | 18 ---- 4 files changed, 2 insertions(+), 252 deletions(-) delete mode 100644 builder/Dockerfile.fedora-gcc14-ubsan delete mode 100644 containers/gcc14-ubsan/Dockerfile delete mode 100755 containers/gcc14-ubsan/r-check diff --git a/builder/Dockerfile.fedora-gcc14 b/builder/Dockerfile.fedora-gcc14 index 33f2cfd3..1af42900 100644 --- a/builder/Dockerfile.fedora-gcc14 +++ b/builder/Dockerfile.fedora-gcc14 @@ -43,6 +43,8 @@ RUN dnf -y upgrade \ wget \ xz-devel \ zlib-devel \ + libasan \ + libubsan \ && dnf clean all RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch diff --git a/builder/Dockerfile.fedora-gcc14-ubsan b/builder/Dockerfile.fedora-gcc14-ubsan deleted file mode 100644 index 1af42900..00000000 --- a/builder/Dockerfile.fedora-gcc14-ubsan +++ /dev/null @@ -1,91 +0,0 @@ - -FROM fedora:40 - -ENV OS_IDENTIFIER fedora-40 - -RUN dnf -y upgrade \ - && dnf -y install dnf-plugins-core \ - && dnf -y install \ - autoconf \ - automake \ - bzip2-devel \ - cairo-devel \ - gcc \ - g++ \ - gfortran \ - java-11-openjdk-devel \ - libICE-devel \ - libSM-devel \ - libX11-devel \ - libXmu-devel \ - libXt-devel \ - libcurl-devel \ - libicu-devel \ - libjpeg-devel \ - libpng-devel \ - libtiff-devel \ - libtool \ - make \ - ncurses-devel \ - pango-devel \ - pcre-devel \ - pcre2-devel \ - readline-devel \ - rpm-build \ - tcl-devel \ - tex \ - texinfo-tex \ - texlive-collection-latexrecommended \ - tk-devel \ - unzip \ - valgrind-devel \ - which \ - wget \ - xz-devel \ - zlib-devel \ - libasan \ - libubsan \ - && dnf clean all - -RUN if [ "$(arch)" == "aarch64" ]; then echo arm64; else echo amd64; fi > /tmp/arch - -RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(cat /tmp/arch).rpm" && \ - dnf install -y "nfpm_$(cat /tmp/arch).rpm" && \ - rm "nfpm_$(cat /tmp/arch).rpm" - -RUN chmod 0777 /opt - -# Configure flags for RHEL 9 that don't use the defaults in build.sh -ENV CONFIGURE_OPTIONS="\ - --enable-R-shlib \ - --with-tcltk \ - --enable-memory-profiling \ - --with-x \ - --with-system-valgrind-headers \ - --with-tcl-config=/usr/lib64/tclConfig.sh \ - --with-tk-config=/usr/lib64/tkConfig.sh \ - --enable-prebuilt-html" - -# RHEL 9 doesn't have the inconsolata font, so override the defaults. -# This may be removed if RHEL ever adds the texlive-inconsolata package from Fedora. -# Or check `dnf provides '*/inconsolata.sty'` for a package that provides it. -# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Making-the-manuals -ENV R_RD4PDF="times,hyper" - -# Make sure that patching Java does not break R. -# R's default JAVA_HOME path includes the exact Java version on CentOS/RHEL, which -# requires users to run `R CMD javareconf` even on minor/patch upgrades. Use the -# major version symlink to avoid this. -# https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Java-support -# https://solutions.posit.co/envs-pkgs/using-rjava/ -ENV JAVA_HOME=/usr/lib/jvm/jre-11-openjdk - -# R 3.x requires PCRE2 for Pango support on RHEL 9 -ENV INCLUDE_PCRE2_IN_R_3 yes - -COPY builder/config.fedora-gcc /config.site -COPY builder/config.fedora-gcc.aarch64 /config.site.aarch64 - -COPY builder/package.fedora-gcc /package.sh -COPY build.sh . -ENTRYPOINT ./build.sh diff --git a/containers/gcc14-ubsan/Dockerfile b/containers/gcc14-ubsan/Dockerfile deleted file mode 100644 index 5217bd53..00000000 --- a/containers/gcc14-ubsan/Dockerfile +++ /dev/null @@ -1,143 +0,0 @@ -FROM fedora:40 - -# ------------------------------------------------------------------------------------ -# Install pre-built R and requirements - -RUN dnf -y upgrade && \ - dnf -y install dnf-plugins-core && \ - dnf -y install curl && \ - curl -LO "https://github.com/r-hub/containers/releases/download/latest/R-rstudio-fedora-40-devel-gcc14-1-1.$(arch).rpm" && \ - yum install -y R-*.rpm && \ - rm R-*.rpm - -# Extra system packages that pak does not know about -RUN dnf install -y flexiblas -RUN dnf install -y https://rpms.r-pkg.org/fedora-38/jags-4.3.2-1.$(arch).rpm - -# ------------------------------------------------------------------------------------ -# Put R on PATH -# Auto-install system requirements - -ENV PATH="/opt/R/devel-gcc14/bin:${PATH}" -ENV PKG_SYSREQS=true -ENV R_PKG_SYSREQS2=true - -# ------------------------------------------------------------------------------------ -# Set CRAN repo, no P3M for Fedora - -RUN echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' \ - >> /opt/R/devel-gcc14/lib/R/library/base/R/Rprofile - -RUN if [ "$(arch)" = "x86_64" ]; then \ - . /etc/os-release; \ - RVER=$(R -s -e 'cat(paste(getRversion()[,1:2]))'); \ - echo "options(repos = c(RHUB = 'https://raw.githubusercontent.com/r-hub/repos/main/${ID}-${VERSION_ID}/${RVER}', getOption('repos')))" \ - >> /opt/R/devel-gcc14/lib/R/library/base/R/Rprofile; \ - echo 'options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"])))' \ - >> /opt/R/devel-gcc14/lib/R/library/base/R/Rprofile; \ - fi - -# ------------------------------------------------------------------------------------ -# Install pak - -RUN /opt/R/devel-gcc14/bin/R -q -e \ - 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/%s/%s/%s/%s", "devel", .Platform$pkgType, R.Version()$os, R.Version()$arch))' - -# ------------------------------------------------------------------------------------ -# Install pkgbuild, rcmdcheck, and decor - -RUN /opt/R/devel-gcc14/bin/R -q -e \ - 'install.packages(c("pkgbuild", "rcmdcheck", "decor"), repos = "https://cran.rstudio.com")' - -# ------------------------------------------------------------------------------------ -# Locale - -RUN dnf install -y glibc-langpack-en - -ENV LC_ALL en_GB.UTF-8 -ENV LANG en_GB.UTF-8 - -# ------------------------------------------------------------------------------------ -# Use user's package library for the rest - -RUN /opt/R/devel-gcc14/bin/R -q -e 'dir.create(Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)' - -# ------------------------------------------------------------------------------------ -# Copy check script - -COPY r-check /usr/local/bin - -# ------------------------------------------------------------------------------------ -# Useful system packages - -RUN dnf -y install pkg-config devscripts-checkbashisms qpdf git tidy - -# ------------------------------------------------------------------------------------ -# CRAN's config from https://www.stats.ox.ac.uk/pub/bdr/gcc14/README.txt -# -# > Installation checks with GCC 14.1, whose changelog is at -# > https://gcc.gnu.org/gcc-14/changes.html, and other details at -# > https://gcc.gnu.org/pipermail/gcc/2024-May/243921.html -# -# > Other details as https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-gcc - -ENV _R_CHECK_INSTALL_DEPENDS_ true -## the next is the default, but --as-cran has true -ENV _R_CHECK_SUGGESTS_ONLY_ false -ENV _R_CHECK_NO_RECOMMENDED_ true -ENV _R_CHECK_DOC_SIZES2_ true -ENV _R_CHECK_DEPRECATED_DEFUNCT_ true -ENV _R_CHECK_SCREEN_DEVICE_ warn -ENV _R_CHECK_REPLACING_IMPORTS_ true -ENV _R_CHECK_TOPLEVEL_FILES_ true -ENV _R_CHECK_DOT_FIRSTLIB_ true -ENV _R_CHECK_RD_LINE_WIDTHS_ true -ENV _R_CHECK_S3_METHODS_NOT_REGISTERED_ true -ENV _R_CHECK_OVERWRITE_REGISTERED_S3_METHODS_ true -ENV _R_CHECK_CODE_USAGE_WITH_ONLY_BASE_ATTACHED_ TRUE -ENV _R_CHECK_NATIVE_ROUTINE_REGISTRATION_ true -ENV _R_CHECK_FF_CALLS_ registration -ENV _R_CHECK_PRAGMAS_ true -ENV _R_CHECK_COMPILATION_FLAGS_ true -ENV _R_CHECK_R_DEPENDS_ true -ENV _R_CHECK_PACKAGES_USED_IN_TESTS_USE_SUBDIRS_ true -ENV _R_CHECK_PKG_SIZES_ false -ENV _R_CHECK_SHLIB_OPENMP_FLAGS_ true - -ENV _R_CHECK_LIMIT_CORES_ true -ENV _R_CHECK_LENGTH_1_CONDITION_ package:_R_CHECK_PACKAGE_NAME_,verbose -#ENV _R_CHECK_LENGTH_1_LOGIC2_="package:_R_CHECK_PACKAGE_NAME_,verbose" -ENV _R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_ true -ENV _R_CHECK_COMPILATION_FLAGS_KNOWN_="-Wno-deprecated-declarations -Wno-ignored-attributes -Wno-parentheses -Werror=format-security -Wp,-D_FORTIFY_SOURCE=3 -Werror=implicit-function-declaration" -ENV _R_CHECK_AUTOCONF_ true -ENV _R_CHECK_THINGS_IN_CHECK_DIR_ true -ENV _R_CHECK_THINGS_IN_TEMP_DIR_ true -ENV _R_CHECK_THINGS_IN_TEMP_DIR_EXCLUDE_="^ompi" -ENV _R_CHECK_BASHISMS_ true -ENV _R_CHECK_DEPENDS_ONLY_DATA_ true -ENV _R_CHECK_MATRIX_DATA_ TRUE -ENV _R_CHECK_RD_VALIDATE_RD2HTML_ true -ENV _R_CHECK_RD_MATH_RENDERING_ true - -# ------------------------------------------------------------------------------------ -# Check config, no need to check the PDF manual and vignettes here. -# We also avoid that bashism checks, as it needs external tools. - -ENV _R_CHECK_TESTS_NLINES_="0" -ENV CHECK_ARGS="--no-manual --no-build-vignettes" -ENV _R_CHECK_BASHISMS_=false - -# Support R CMD INSTALL --use-LTO ., similarly to CRAN at https://www.stats.ox.ac.uk/pub/bdr/LTO/README.txt -RUN echo -e '# Support --use-LTO\nLTO_OPT = -flto=10\nLTO_FC_OPT = -flto=10' >> /opt/R/devel-gcc14/lib/R/etc/Makeconf - -# ------------------------------------------------------------------------------------ -# UBSAN and ASAN configuration -# adapted from https://www.stats.ox.ac.uk/pub/bdr/memtests/README.txt - -RUN mkdir -p ~/.R/ && echo -e 'CC=gcc -std=gnu11 -fsanitize=address,undefined -fno-omit-frame-pointer\nFC=gfortran -fsanitize=address' >> ~/.R/Makevars -ENV LD_PRELOAD=/usr/lib64/libasan.so.8 -ENV ASAN_OPTIONS='detect_leaks=0' -ENV UBSAN_OPTIONS='print_stacktrace=1' -ENV RJAVA_JVM_STACK_WORKAROUND=0 -ENV RGL_USE_NULL=true -ENV R_DONT_USE_TK=true diff --git a/containers/gcc14-ubsan/r-check b/containers/gcc14-ubsan/r-check deleted file mode 100755 index 898ce4e0..00000000 --- a/containers/gcc14-ubsan/r-check +++ /dev/null @@ -1,18 +0,0 @@ -#! /bin/bash -set -e - -checkdir=${1-/check} - -do_check () { - pkg=${1} - echo Checking "$pkg" - ( - cd `dirname $pkg` - R -q -e "pak::pkg_install('deps::$pkg', dependencies = TRUE)" - R CMD check $CHECK_ARGS $pkg - ) -} - -for pkg in `ls $checkdir/*.tar.gz`; do - do_check "$pkg" -done