Opened 11 months ago
Closed 11 months ago
#29471 closed defect (fixed)
Failing doctest in R interface due to missing lattice library
Reported by:  ghkliem  Owned by:  

Priority:  major  Milestone:  sage9.1 
Component:  packages: standard  Keywords:  R, spkgconfigure, lattice library 
Cc:  tmonteil, fbissey, isuruf, charpent, embray, dimpase  Merged in:  
Authors:  Jonathan Kliem  Reviewers:  Matthias Koeppe 
Report Upstream:  N/A  Work issues:  
Branch:  65a3101 (Commits, GitHub, GitLab)  Commit:  65a31019a4af6a39b89ad903b378fa19ea303edb 
Dependencies:  Stopgaps: 
Description (last modified by )
During automated testing with GitHub actions we get the following error on many debian and ubuntu distros:
sage t src/sage/interfaces/r.py ********************************************************************** File "src/sage/interfaces/r.py", line 1318, in sage.interfaces.r.R.plot Failed example: r.library("lattice") Exception raised: Traceback (most recent call last): File "/sage/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 681, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1123, in compile_and_execute exec(compiled, globs) File "<doctest sage.interfaces.r.R.plot[5]>", line 1, in <module> r.library("lattice") File "/sage/local/lib/python2.7/sitepackages/sage/interfaces/r.py", line 863, in library raise ImportError("R library {} not installed".format(library_name)) ImportError: R library lattice not installed
see e.g. https://github.com/mkoeppe/sage/runs/542655815.
We fix this by adding the package rcranlattice
to build/pkgs/r/distros/debian.txt
.
In general this is expected behavior. If you skip the recommended packages of R (on your system) then your R interface in sage will not have all features. The error message is meaningful and the user should know what to do about it.
Change History (10)
comment:1 Changed 11 months ago by
comment:2 Changed 11 months ago by
On Debian and Ubuntu rcranlattice is a recommended package for rbasecore https://packages.debian.org/buster/rrecommended (part of rrecommended).
If we require those packages in order to use the system R, we should do so at configure.
If we want this to be optional and still want to keep the doctest, I think we would need some flag like # optional  rrecommended
. I don't know if this is even possible.
comment:3 followup: ↓ 8 Changed 11 months ago by
For context, in the automatic tests defined by tox.ini
and build/bin/writedockerfile.sh
(which is what is run on GitHub Actions), packages are installed on Debian distributions using aptget install noinstallrecommends
.
If the lattice
package is important (I don't know as I don't use R), we can certainly add rcranlattice
to build/pkgs/r/distros/debian.txt
.
comment:4 Changed 11 months ago by
Thanks for clarifying. Then this is almost expected behavior. If you use a system R
which doesn't have all recommended packages than you will have limited functionality. I would add that line just to make the GitHub actions pass. This is a small package (only around 1 MB if you already install rbasecore, which we do).
comment:5 Changed 11 months ago by
 Branch set to public/29471
 Commit set to 6a4580546f25fa62f38b3490e2d0120975371379
 Status changed from new to needs_review
comment:6 Changed 11 months ago by
 Commit changed from 6a4580546f25fa62f38b3490e2d0120975371379 to 65a31019a4af6a39b89ad903b378fa19ea303edb
Branch pushed to git repo; I updated commit sha1. New commits:
65a3101  add rcranlattice for github workflows

comment:7 Changed 11 months ago by
This seems to work:
https://github.com/kliem/sagetest27122/actions/runs/72102779
comment:8 in reply to: ↑ 3 Changed 11 months ago by
 Description modified (diff)
comment:9 Changed 11 months ago by
 Reviewers set to Matthias Koeppe
 Status changed from needs_review to positive_review
LGTM
comment:10 Changed 11 months ago by
 Branch changed from public/29471 to 65a31019a4af6a39b89ad903b378fa19ea303edb
 Resolution set to fixed
 Status changed from positive_review to closed
That is very interesting, and could only have happened as we allows system R now in some circumstances. I would be willing to bet there are other standard libraries that not every system R has that we configured to build in "our" R  maybe this ticket should be to ensure that system R has all of them. (They are really very standard so it's not a big burden, and if someone really wants to use a system R without them, then they just get failing doctests.)
In any case, don't do this as
not tested
, though  we would still want to test that Sagethelibrary built from scratch passes its own doctests.