rstudio / r-builds

an opinionated environment for compiling R
GNU General Public License v3.0
100 stars 19 forks source link

Fix missing PCRE2 dependency in R 3.x builds for RHEL 9 #146

Closed glin closed 2 years ago

glin commented 2 years ago

In https://github.com/rstudio/r-builds/pull/133, I missed an update to the PCRE lib dependencies for RHEL 9. The R 3.5/3.6 builds require both PCRE1 and PCRE2, but only PCRE1 was a dependency, so the tests failed when installing the test package.

But unfortunately, the exit codes from the tests weren't being propagated correctly, so CI wasn't catching this earlier. (I only realized this while adding the R Docker images in https://github.com/rstudio/r-docker/pull/85, which I also forgot to add CI support for, oops)

$ R_VERSION=3.5.3 make test-r-rhel-9
...
rhel-9_1        | * installing *source* package 'testpkg' ...
rhel-9_1        | ** libs
rhel-9_1        | gcc -I"/opt/R/3.5.3/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2 -fcommon  -c add.c -o add.o
rhel-9_1        | gcc -I"/opt/R/3.5.3/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2 -fcommon  -c init.c -o init.o
rhel-9_1        | f95   -fpic  -g -O2 -fallow-argument-mismatch  -c square.f -o square.o
rhel-9_1        | g++ -std=gnu++11 -I"/opt/R/3.5.3/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2 -c subtract.cpp -o subtract.o
rhel-9_1        | g++ -std=gnu++11 -shared -L/opt/R/3.5.3/lib/R/lib -L/usr/local/lib -o testpkg.so add.o init.o square.o subtract.o -Wl,--export-dynamic -fopenmp -L/usr/local/lib -L/opt/R/3.5.3/lib/R/lib -lR -lpcre2-8 -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n -L/opt/R/3.5.3/lib/R/lib -lRlapack -L/opt/R/3.5.3/lib/R/lib -lRblas -fopenmp -lgfortran -lm -lquadmath -L/opt/R/3.5.3/lib/R/lib -lR
rhel-9_1        | /usr/bin/ld: cannot find -lpcre2-8
rhel-9_1        | collect2: error: ld returned 1 exit status
rhel-9_1        | make: *** [/opt/R/3.5.3/lib/R/share/make/shlib.mk:6: testpkg.so] Error 1
rhel-9_1        | ERROR: compilation failed for package 'testpkg'
rhel-9_1        | * removing '/tmp/RtmpiCj8f5/testpkg'
rhel-9_1        | Warning message:
rhel-9_1        | In install.packages(file.path(curr_dir, "testpkg"), repos = NULL,  :
rhel-9_1        |   installation of package '/r-builds/test/testpkg' had non-zero exit status
rhel-9_1        | Error in library(testpkg) : there is no package called 'testpkg'
rhel-9_1        | Calls: source -> withVisible -> eval -> eval -> library
rhel-9_1        | Execution halted
test_rhel-9_1 exited with code 1

$ echo $?
0

$ echo $? 2


- Fix the missing PCRE2 dependency for R 3.5/3.6 RHEL 9 builds