Closed mkoeppe closed 3 years ago
Again we have a problem with r
. As cygwin
is one of our supported platforms and r
is a standard package, this is a blocker.
(More problems with R are around the corner, for wheel builds of Sage - #31396.)
This justifies another round of discussion for the proposal to downgrade the r
and rpy2
to "optional" packages - after #29486, #29170, https://groups.google.com/g/sage-devel/c/IX3niEdmCEM/m/LovmF6gmIwAJ
In #29170, @novoselt pointed out that supporting R is important for SageMathCell; and @kiwifb mentioned that "Suddenly dropping R/rpy2 feels rough. However, we don't have usage data to know how rough it would be."
I think that we do need a bit of substantiation here given to make the case of keeping R supported as a standard package - and its cost of maintenance. Note that our R is also nontrivially patched and an update to the 4.x series is overdue, and nobody has stepped up to do this upgrade.
Maybe this is asking for a new type of package: standard on some platforms, optional on others.
I have been "using" the system's R for a while now ("using" mean that Sage doesn't build it, not that I actually use it for anything). Can we distribute binaries that will use a system R installation? (Maybe this is a bad question, because at least on OS X, can we distribute functioning binaries in the first place?)
rpy2 3.4.x has wheels for macOS - https://pypi.org/project/rpy2/#files
We should find out with what installation of R these wheels are supposed to work - hopefully R's official binary packages that are on CRAN - see https://mirror.las.iastate.edu/CRAN/
New commits:
b2d4ab8 | build/pkgs/{r,rpy2}: Downgrade to optional |
Replying to @jhpalmieri:
(Maybe this is a bad question, because at least on OS X, can we distribute functioning binaries in the first place?)
Binaries have been broken for a long time. I would be in favor of just following Dima's current practice of directing people to just use conda.
Author: Matthias Koeppe
I am fine with that. But at the very least most of the doctests in sage/interface/r.py
have to be marked optional. I haven't checked for import of rpy
at this stage.
sage/stats/r.py
relies on R being present. All doctests in there should be optional.
There are two doctests in sage/repl/ipython_tests.py
that run R.
Tests for _r_init_
in sage/structure/sage_object.pyx
, I note interfaces for other optional packages (octave, mathematica, polymake...) do not have tests.
That's all that I can see and think of right now.
Instead of adding an optional tag to all doctests in these files, perhaps we should go through #30778.
Yes, that would be the right way to go. In the spirit of splitting, r interface stuff should be splitted in its own package eventually. I guess it is now tagged "early candidate".
I have reduced #30778 to a more modest version that just handles "optional" tags as file directives instead of using "sage_setup: distribution" tags.
Branch pushed to git repo; I updated commit sha1. New commits:
8732076 | src/sage/repl/ipython_tests.py: Mark R interface tests # optional - rpy2 |
Branch pushed to git repo; I updated commit sha1. New commits:
dbdf084 | src/sage/structure/sage_object.pyx: Mark R interface test # optional - rpy2 |
Branch pushed to git repo; I updated commit sha1. New commits:
737b21c | src/sage/stats/r.py: Mark all 2 doctests in this file as # optional - rpy2 |
Branch pushed to git repo; I updated commit sha1. New commits:
4403924 | src/sage/interfaces/r.py: Mark all tests # optional - rpy2 |
Because #30778 appears to be controversial, for the present ticket I have just added the line by line optional tags. Ready for review.
Replying to @mkoeppe:
Because #30778 appears to be controversial, for the present ticket I have just added the line by line optional tags. Ready for review.
I feel your pain. Having to do that is kind of terrible. Further checking will have to be with the bots. Let's go with the positive review now.
Reviewer: François Bissey
Thank you!
Looks like there are a few more files with R tests (https://github.com/mkoeppe/sage/runs/1942659778):
Branch pushed to git repo; I updated commit sha1. New commits:
405ebb9 | More # optional - rpy2 |
Right, those were more difficult to spot since they rely on the fact that the R interface is automatically imported in sage/interfaces/all.py
. That run should have got all of them.
Thanks! I also just ran make ptestlong-nodoc
and there are no more errors.
If addition of standard packages requires a mention on sage-devel then IMHO removal should, too...
Also, doesn't pass the testsuite:
**********************************************************************
File "src/sage/repl/interpreter.py", line 242, in sage.repl.interpreter.SageShellOverride.system_raw
Failed example:
shell.system_raw('R --version')
Expected:
R version ...
Got:
/bin/sh: 1: R: not found
**********************************************************************
File "src/sage/repl/interpreter.py", line 244, in sage.repl.interpreter.SageShellOverride.system_raw
Failed example:
shell.user_ns['_exit_code']
Expected:
0
Got:
127
**********************************************************************
1 item had failures:
2 of 10 in sage.repl.interpreter.SageShellOverride.system_raw
[141 tests, 2 failures, 3.57 s]
**********************************************************************
File "src/sage/tests/cmdline.py", line 578, in sage.tests.cmdline.test_executable
Failed example:
out.find("R version ") >= 0
Expected:
True
Got:
False
**********************************************************************
File "src/sage/tests/cmdline.py", line 580, in sage.tests.cmdline.test_executable
Failed example:
err
Expected:
''
Got:
'/home/buildbot/slave/sage_git/build/src/bin/sage: line 627: exec: R: not found\n'
**********************************************************************
File "src/sage/tests/cmdline.py", line 582, in sage.tests.cmdline.test_executable
Failed example:
ret
Expected:
0
Got:
127
**********************************************************************
1 item had failures:
3 of 231 in sage.tests.cmdline.test_executable
[230 tests, 3 failures, 29.96 s]
----------------------------------------------------------------------
sage -t --long --random-seed=0 src/sage/repl/interpreter.py # 2 doctests failed
sage -t --long --random-seed=0 src/sage/tests/cmdline.py # 3 doctests failed
----------------------------------------------------------------------
Replying to @vbraun:
If addition of standard packages requires a mention on sage-devel then IMHO removal should, too...
I think this is a good point.
There's nothing to discuss; it's trivial to make the packages standard again if someone steps up and fixes the packages.
The purpose of asking for a sage-devel vote when making a package standard, to my understanding, is that the additional future maintenance burden (and bloat) coming from a standard package should receive more scrutiny than one developer's "positive review". None of this applies to the present situation.
You really don't think that people should be made aware that R is being downgraded?
There will be a line in the list of merged tickets for the beta version that merges the ticket. I don't think this has greater urgency.
Description changed:
---
+++
@@ -5,3 +5,8 @@
[r-3.6.3] /opt/sage-1e693c9ae51a53dad0fe099efc41439dc898f02f/var/tmp/sage/build/r-3.6.3/src/src/extra/blas/blas.f:2986:(.text+0x4352): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `xerbla_'
+Discussions: +- #29486 +- #29170 +- https://groups.google.com/g/sage-devel/c/IX3niEdmCEM/m/LovmF6gmIwAJ +- https://groups.google.com/g/sage-devel/c/alkG4veIsBk/m/432cxzpYAQAJ
I agree with the ticket, but I also think its common courtesy to give other developers a heads-up here.
Blocking 9.3, not 9.4
There will be a line in the list of merged tickets for the beta version that merges the ticket. I don't think this has greater urgency.
Yeah, that will definitely catch everyone's attention.
R is one of the oldest wheels of the car (not the current Python-style wheels, figurative wheels from days of yore). We all know that once it's not supported, it will be more than broken. At the very least, before this is merged there should be some kind of automated message when R is invoked via Sage (via the innumerable examples out in the wild now, including in various books about "how to use Sage") that says "here is a Sage website that will help you install an R that works with our interface, and here is what to do to get Sage to recognize it". For non-POSIX geeks, but for an ordinary user. And then these now-optional doctests should be tested.
In particular, this is another piece of mission creep from "viable competitor to M, M, M..." I do get the desire to decouple and ease upgrade processes for external software. But for such an important piece of software (not least because of the innumerable packages) there should at the very least be an easy on-ramp to nudging people to install it when needed, and then some kind of testing. Kind of like how OS X "reminds" one if you try to use git
and don't yet have command line tools.
Replying to @kcrisman:
In particular, this is another piece of mission creep from "viable competitor to M, M, M..." I do get the desire to decouple and ease upgrade processes for external software.
This ticket is about the very concrete problem that R does not build on one of our standard platforms, Cygwin, and we are not able to use the system R either.
Because failing standard packages block the entire build, we either need to fix it, or downgrade it from standard before the 9.3 release.
Replying to @kcrisman:
... when R is invoked via Sage (via the innumerable examples out in the wild now, including in various books about "how to use Sage")
Do you have any pointers to such examples?
Description changed:
---
+++
@@ -7,6 +7,8 @@
Discussions:
- #29486
+- #29441
- #29170
- https://groups.google.com/g/sage-devel/c/IX3niEdmCEM/m/LovmF6gmIwAJ
+- https://wiki.sagemath.org/ReleaseTours/sage-9.2#rpy2_and_R
- https://groups.google.com/g/sage-devel/c/alkG4veIsBk/m/432cxzpYAQAJ
IIRC correctly, R is not mentioned in http://sagebook.gforge.inria.fr/english.html
As a point of reference, I've twice been in workshops with R experts where both Sage and R were being taught to students. When I told the R people that since students have already installed Sage, they can use R through Sage. But this did not interest them as they wanted to have students install RStudio anyways.
Do we know about more than one person who uses R primarily through Sage?
That said, I haven't really kept up with this issue. What's the problem with R on cygwin? Maybe I can just fix it.
Replying to @embray:
What's the problem with R on cygwin?
It does not build; somehow BLAS-related. See ticket description.
More generally, we have been unable to use system BLAS and system R. #30163
When did the problem start? Did we upgrade R at some point?
I'm not against the current proposal to make R optional, though I'm inclined to agree with William's point about having a deprecation period first. I'll look into the build issue with R.
Alternatively, if the R version was upgraded, resulting in this problem, could we not just revert the upgrade until a later version / when this is able to be fixed?
Prompted by a build failure of
r
oncygwin-standard
in https://github.com/mkoeppe/sage/runs/1915093157we make it possible to disable R using a configure options so that one can get a working Sage installation in this way.
(The original build failure has hopefully resolved been resolved by #29537.)
Previous tickets and discussions:
29486
29441
29170
Depends on #29537 Depends on #30383
CC: @embray @dimpase @orlitzky @jhpalmieri @kiwifb @novoselt @EmmanuelCharpentier @videlec @kliem
Component: porting: Cygwin
Author: Matthias Koeppe
Branch/Commit:
f04c134
Reviewer: François Bissey, John Palmieri
Issue created by migration from https://trac.sagemath.org/ticket/31409