Notes for upgrading R version
June 16, 2021 ยท View on GitHub
Files where to update the version:
mx.fastr/suite.py("GNUR" library)mx.fastr/mx_fastr.py(functionr_version)com.oracle.truffle.r.*/**/Makefile(variableR_VERSION)documentation/user/Compatibility.mdRVersionNumber(useR.Version(), also updateINTERNALS_UIDfromRinternals.h)com.oracle.truffle.r.native/gnur/patch/*(files likeVERSION,configure.ac, etc.)
Updating GNU-R sources patched by FastR (make sure you have up to date gnur and master branches):
R_VERSION=3.5.1
git checkout gnur
cd com.oracle.truffle.r.native/gnur/patch/src
for f in `find . -type f`; do cp ${GNUR_SOURCES}/src/$f $f; done
cd com.oracle.truffle.r.native/gnur/patch/tests/src
for f in `find . -type f`; do cp ${GNUR_SOURCES}/tests/$f $f; done
git commit -m "Upgrading to R-$R_VERSION"
git checkout master
git checkout -b "upgrade-r-$R_VERSION"
git merge gnur
now solve all the merge conflicts. Note that file gramRd.c contains generated
code and the automatic merge seems to do a very bad job at merging that,
so it is recommended to take a look at all the changes introduced in master
(will be few commits) and manually redo them.
There are native functions ported from GNU-R source to Java. With each upgrade we should review the ported code and port any relevant fixes and improvements.
- nmaths library (dunif, punif, ...), which is rewritten to Java in FastR
- changes in GNU-R's own tests, which are used in "gnurtests" package
Check files that were copied from GNU-R and adapted:
com.oracle.truffle.r.native/run/examples-footer.R->GNUR/share/R/examples-footer.R- files
*_overrides.Roverride functions from base packages, e.g.,tools_overrides.R com.oracle.truffle.r.native/run/fastr_tools/R->GNUR/src/scripts/R.sh.in
Regenerate the expected output for new GNU-R version:
rm ./com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/ExpectedTestOutput.test
mx rtestgen
Run Renjin tests on new GNU-R: ./libdownloads/R-3.6.1/Rscript ../r-apptests/renjin/driver.R
Tips:
- run
mx rbcheckand compare to output ofmx rbcheckin FastR with older R version - enable
NativeMirror#TRACE_MIRROR_ALLOCATION_SITESto debug issues ingramRd.c - run unit tests with
-Dfastr.test.trace.tests=trueto find out which test causes fatal error - run unit tests with
-DAddIgnoreForFailedTests=trueto make the newly failing tests ignored withIgnored.NewRVersionMigration, e.g.mx --J @'-DAddIgnoreForFailedTests=true' rutgen.