Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R doctest starts X11 on OSX #12172

Closed
vbraun opened this issue Dec 17, 2011 · 18 comments
Closed

R doctest starts X11 on OSX #12172

vbraun opened this issue Dec 17, 2011 · 18 comments

Comments

@vbraun
Copy link
Member

vbraun commented Dec 17, 2011

John Palmieri reports that, with the R package from #12057, this doctest is problematic (line 352):

    sage: s = r.eval('capabilities("png")') # Should be on Linux and Solaris

On his Mac OS X 10.6.8 box, doctesting this starts up the X server but does not display any actual graphics. This is new: it didn't do this in Sage 4.8.alpha3.

This does not happen on all OSX machines. The intented R configuration on OSX is without X11 support, and only Aqua capabilities.

It might be a bug or misconfiguration in the X installation that it opens up even though nobody is draw a window.

This can be avoided by unsetting DISPLAY in the R session, but then R does no longer report png output capabilities:

> Sys.unsetenv("DISPLAY") 
> capabilities("png")
  png 
FALSE 
> capabilities("aqua")
aqua 
TRUE 

Its unclear whether that would really be an issue in Sage.

Somebody with a Mac might want to trace where exactly R starts up the X server. The equivalent of strace on Linux seems to be http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/dtruss.1m.html

sage -sh
dtruss -f R

New spkg: http://sage.math.washington.edu/home/palmieri/SPKG/r-2.14.0.p2.spkg

CC: @kcrisman @jasongrout @jhpalmieri

Component: doctest coverage

Keywords: R r-project graphics OSX X11

Author: John Palmieri

Reviewer: Karl-Dieter Crisman

Merged: sage-5.0.beta2

Issue created by migration from https://trac.sagemath.org/ticket/12172

@jhpalmieri
Copy link
Member

comment:3

When I run "dtruss -f R", it exits immediately — it doesn't enter an interactive mode where I can give it commands.

Meanwhile, we could unconditionally disable X11 on Darwin in spkg-install. I can produce a new spkg if people think this is a reasonable solution.

@kcrisman
Copy link
Member

comment:4

Meanwhile, we could unconditionally disable X11 on Darwin in spkg-install. I can produce a new spkg if people think this is a reasonable solution.

Yes, we should only need Aqua on Darwin for R graphics. We'd need to test this on a few systems - in particular yours! - but I don't see why this should cause trouble.

@jhpalmieri
Copy link
Member

comment:5

New spkg up, and I've also posted the patch applied to the spkg (for review purposes).

@jhpalmieri
Copy link
Member

Author: John Palmieri

@jhpalmieri

This comment has been minimized.

@jasongrout
Copy link
Member

comment:7

Just to be clear; the R package can still pop up a window with graphics, right? It'd just be an "aqua" window, rather than an X window, right?

@jhpalmieri
Copy link
Member

comment:8

If you can tell me commands to pop open a window with graphics, I'll try it out on my OS X box with this new spkg. (It should work in theory, using "aqua" as you say.)

@jasongrout
Copy link
Member

comment:9

do sage -R, and then type demo(graphics). Hit return a bunch of times and a window should pop up with a bunch of graphics that cycle through it in the demo. Thanks.

@jhpalmieri
Copy link
Member

comment:10

Yup, it works (for me, anyway).

@jdemeyer
Copy link

comment:11

Please rebase to #12131...

@jhpalmieri
Copy link
Member

comment:12

Okay, rebased spkg is up, and I've also updated the patch.

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member

Attachment: trac_12172-r-spkg.patch.gz

for review only

@kcrisman
Copy link
Member

comment:13

The patch looks ok, modulo my usual having to look up shell syntax. (Trifle annoying that someone forgot to update the version number in the GPL listing, but I'm not going to mess with that since it wasn't done on the upgrade.)

The problem is that I can't test whether it fixes the problem, really. With Sage 4.8:

$./sage -t devel/sage/sage/interfaces/r.py 
sage -t  "devel/sage/sage/interfaces/r.py"                  
	 [9.7 s]
 
----------------------------------------------------------------------
All tests passed!
Total time for all tests: 9.7 seconds

Even though I have the offending file!

$ ls /usr/include/X11/
CallbackI.h	IntrinsicP.h	VarargsI.h	Xfuncproto.h	Xthreads.h
Composite.h	Object.h	Vendor.h	Xfuncs.h	Xtos.h
CompositeP.h	ObjectP.h	VendorP.h	Xlib.h		Xtrans
ConstrainP.h	PM		X.h		XlibConf.h	Xutil.h
Constraint.h	PassivGraI.h	X10.h		Xlibint.h	Xw32defs.h
ConvertI.h	RectObj.h	XF86keysym.h	Xlocale.h	Xwindows.h
Core.h		RectObjP.h	XKBlib.h	Xmd.h		Xwinsock.h
CoreP.h		ResConfigP.h	XWDFile.h	Xmu		ap_keysym.h
CreateI.h	ResourceI.h	Xalloca.h	Xos.h		bitmaps
DECkeysym.h	SM		Xarch.h		Xos_r.h		cursorfont.h
EventI.h	SelectionI.h	Xatom.h		Xosdefs.h	dri
HPkeysym.h	Shell.h		Xauth.h		Xpoll.h		extensions
HookObjI.h	ShellI.h	Xaw		XprintAppUtil	fonts
ICE		ShellP.h	Xcms.h		XprintUtil	keysym.h
ImUtil.h	StringDefs.h	Xcursor		Xproto.h	keysymdef.h
InitialI.h	Sunkeysym.h	Xdefs.h		Xprotostr.h	xpm.h
Intrinsic.h	ThreadsI.h	Xdmcp.h		Xregion.h
IntrinsicI.h	TranslateI.h	Xft		Xresource.h

So the best I can do is to say that it doesn't seem to break anything... Well, I'm going to see if I can break graphics by changing to this spkg. I'll report back momentarily.

@kcrisman
Copy link
Member

Reviewer: Karl-Dieter Crisman

@kcrisman
Copy link
Member

comment:14

Okay, graphics still work fine, as far as I can tell, in all places they should. We should have disabled this anyway, and I don't know why we didn't figure out that the logic for disabling on Darwin was incorrect. I'm going to give this positive review.

@jdemeyer
Copy link

Merged: sage-5.0.beta2

@fchapoton

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants