reactorlabs / rir

GNU General Public License v2.0
62 stars 18 forks source link

Inconsistency between how bin/tests and bin/R run scripts #1259

Open fikovnik opened 8 months ago

fikovnik commented 8 months ago

Sometimes one gets an error while running bin/tests that cannot be reproduced manually by running the failing test using bin/R -f. The reason is that the testing harness in bin/tests and the R wrapper bin/R behave differently in how the load Ř.

The actual difference is that the code from EXTRA_LOAD_R is our own hook into the start of the R VM (implemented in library/base/R/Rprofile) which does load the file using sys.source. The sys.source function is different from source. Among other, it evals the file in base environment.

Using two different way is not great since each executes different R code which in turns affects the compile heuristics.

fikovnik commented 8 months ago

An easy(tm) fix could be to just use source or keep sys.source in the Rprofile, but do not create the temp files.