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

CFEP 04: proposed guidelines for X11-based software. #7

Open
wants to merge 2 commits into
base: master
from

Conversation

@pkgw
Copy link

pkgw commented Feb 27, 2017

Pursuant to the discussion in cairo-feedstock#23, here is a CFEP that proposes some guidelines for conda-forge packages that use, or can use, X11.

Here is the rendered Markdown file.

@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Feb 27, 2017

There were comments in the Cairo PR about X11 being a heavyweight dependency. For some reference, if I do a clean Miniconda3 installation on linux-64, install cairo, and then run conda clean -tipsy, the resulting tree is 191 MB. As mentioned in the CFEP, the X11 libraries would add ~15 MB to that.

@ocefpaf

This comment has been minimized.

Copy link
Member

ocefpaf commented Mar 5, 2017

I don't think that 15 MB is too much nowadays but in light of conda-forge/ncl-feedstock#7 (comment) do you still need X11? Or maybe we can rely on XQuartz being available in the Travis-CI image from now on?

@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Mar 5, 2017

Well, XQuartz might be on the Travis image, but if the final build outputs still link against the X11 libraries, users won't be able to run the software unless they've also got XQuartz installed because the libraries won't be available.

@ocefpaf

This comment has been minimized.

Copy link
Member

ocefpaf commented Mar 5, 2017

users won't be able to run the software unless they've also got XQuartz installed because the libraries won't be available.

I assumed that is XQuartz is in the image we should expect it to be available by default, but I don't know the first thing about OS X. If that is not true then shipping our own X11 is the only way to go.

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Mar 6, 2017

@jjhelmus, @mingwandroid, could you both please take a look at this and share your thoughts when you have a chance?

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Mar 6, 2017

Have you tried to build XQuartz, @pkgw? I know that basically modern versions of Mac OS don't ship with it. So it might be nice if we can supply our own.

@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Mar 6, 2017

No, I haven't tried. I don't know of any reason why conda-forge couldn't provide it, but it's not needed for the case of programs that need X11 to build but have non-X11 user interfaces (either CLI or Cocoa).

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Mar 13, 2017

I understand XQuartz is not needed to build them, but wouldn't it be needed to run them? Or do all X11 programs you have encountered have some alternative interface?

@jakirkham jakirkham mentioned this pull request Apr 11, 2017
@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Apr 11, 2017

@jakirkham Sorry for never responding to your questions from before ... although I have to say that I don't know the answers to them. I'm not an OSX user myself. I will see if I can gather info from some some of my colleagues.

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Apr 26, 2017

Thanks @pkgw. Did any of your colleagues try this out since? If so, it would be good to know what they found.

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Apr 26, 2017

For posterity, @jjhelmus, it might be good to include info about the tests you tried here with tk especially for people who were not present at the meeting today.

Also a follow up question, did you have XQuartz installed when you tried your tests? Guessing it would have been pretty obvious if it was using XQuartz. Just curious if you tested without it.

@jjhelmus

This comment has been minimized.

Copy link
Contributor

jjhelmus commented Apr 30, 2017

First let me begin that I'm excited about conda-forge being able to provide X11 on all three platforms. Installing XQuartz on macOS has always been a pain for me and having it available through conda would be amazing.

My main concern with including X11 as a required dependency in core packages, mainly tk is that it could potentially provide problems if package with and without these dependencies are mixed. For example a tk with a dependency on X11 in the same environment with a python which was build with a tk using the system X11 (for example from the defaults channel) or vice-versa may result in a broken Python _tkinter module. On macOS this issue may be more pronounce as I think tk and the _tkinter module are linked against the Cocoa and Carbon libraries and not X11. Testing the various combinations of these setups should be able to detect possible issues.

Another option would be to used conda features to provide two versions of tk, one linked against the system X11 libraries and one with conda provided X11 libraries. I don't know enough about how linkages are done to know if other downstream packages (i.e. python) would need to also be build with and without this feature.

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Sep 7, 2017

Seems like there are no issues with tk and X11 based on the testing in PR ( conda-forge/tk-feedstock#17 ). Is that correct?

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Sep 7, 2017

Are there any other blockers that we are aware of that would cause issues with making use of the X11 packages in the stack or was tk the only one?

cc @conda-forge/core

@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Sep 7, 2017

As far as I can recall, no concrete issues came up with having tk depend on the X11 stuff — just (reasonable) concerns about embedding it that low in the dependency stack, especially since defaults doesn't go that route.

I'm not aware of any problems that have cropped up for packages depending on the X11 packages, which is not to say that none have occurred. I also don't have a sense of how widely they're used — I get the impression they've crept in as dependencies for various packages here and there. Do we have any tools for analyzing the intra-package dependency graph of the whole project? (Or, in this relatively straightforward case, just grep would do, I expect.)

@mingwandroid

This comment has been minimized.

Copy link

mingwandroid commented Sep 7, 2017

Why would we want Python to depend upon X11 through TK depending on X11? Why for that matter would we want TK to depend on X11?

IMHO people who want X11 should use XQuartz or their system X11. I only think it a good idea to package this for Windows where there is no 'system' solution.

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Sep 7, 2017

I can't speak to Tk specifically. However I can speak to the general value of using conda packages instead of say the system. Not having explicit conda dependencies means spending a non-trivial amount of time explaining to people that they need to install these system dependencies. Also as users have newer and more varied Linux systems, inevitably our system packages and their system packages don't match up. Thus we spend an inordinate amount of time debugging issues related to this. For this reason alone, I'm eager to see X11 become an explicit dependency of packages that need it.

@mingwandroid

This comment has been minimized.

Copy link

mingwandroid commented Sep 7, 2017

Thus we spend an inordinate amount of time debugging issues related to this

Please show me some evidence of this. I have spent close to 0 time debugging issues related to this. The occasional comment of "please use dnf/apt-get/pacman to install your system X11" is all.

Where do you draw the line? Do you want to provide an entire Linux distribution, because that's the way providing X11 is going, and then there's binary compatibility with defaults. Please reconsider.

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Sep 7, 2017

Here are two examples of people getting confused by missing these dependencies.

1: conda-forge/qt-feedstock#54
2: conda-forge/vtk-feedstock#21

@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Sep 7, 2017

I initially prepared X11 packages because the main cluster that I did my work on was running RHEL5, which didn't support XInput2 and therefore couldn't use some of the graphical toolkits I wanted. Large clusters often have older libraries and you can't just sudo your way out of things.

@ocefpaf

This comment has been minimized.

Copy link
Member

ocefpaf commented Sep 7, 2017

@mingwandroid this is a complex issue that we need to discuss in a meeting*. I completely agree that making the core packages, like python, depend on X11, via tk, is troublesome and have some key consequences to the ecosystem. I do not want to go that route!

With that said I am not against packaging X11 stuff so some non-key packages, mostly scientific software that are at the end point of the ecosystem like ferret, ncl, and others, can use them and ship in a "headless" way. I am sure that @pkgw has a similar use in mind.

With that said I don't know the best course of action when it comes to tk. Having tk depend on X11 will force it at the bottom of the ecosystem and we face the issue @mingwandroid raises.

I am not sure if having a special x11-tk is a good idea as well. That could solve the end point packages I mentioned but than we would face trouble when installing those packages along side python, for example. Not sure if there is a "clean" solution to that.

* I added it to the discussion topics a few weeks ago but dropped b/c I would like for @pkgw to the present.

PS: issues conda-forge/qt-feedstock#54 and conda-forge/vtk-feedstock#21 are mostly due to disinformation and not the underlying packages or the use of yum. Please let's not diverge from the topic here.

@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Sep 7, 2017

@ocefpaf Sorry, real life / day job has prevented me from being very plugged in to things here. Is there a date/time for the next meeting?

@ocefpaf

This comment has been minimized.

Copy link
Member

ocefpaf commented Sep 7, 2017

@ocefpaf Sorry, real life / day job has prevented me from being very plugged in to things here.

Don't worry. Not your fault.

Is there a date/time for the next meeting?

No but as soon as we have I'll ping you and add this topic again.

@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Sep 7, 2017

@ocefpaf Yes, please give me an explicit heads-up on here or email. Thanks.

@kmuehlbauer kmuehlbauer mentioned this pull request Oct 25, 2017
@mbargull mbargull mentioned this pull request Jul 18, 2018
@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Aug 3, 2018

Would like us to revisit this proposal. We have seen increasingly consumers of our packages generally expect X11 packages to be installed as conda packages and are frequently surprised that we expect them to install these with a system package manager. It's not uncommon to see comments of workarounds in issues suggesting that users install the X11 conda packages to solve the problem. Similarly maintainers are increasingly comfortable using X11 conda packages (at least where Linux is concerned). A few examples are linked below.

xref: conda-forge/python-graphviz-feedstock#15
xref: conda-forge/graphviz-feedstock#18
xref: conda-forge/cairo-feedstock#32
xref: conda-forge/pyngl-feedstock#3
xref: conda-forge/opencv-feedstock#97

@msarahan

This comment has been minimized.

Copy link
Member

msarahan commented Aug 3, 2018

The best solution here would be to require some metapackage representing X11. It could be fulfilled either with conda packages or with system packages. Conda would need to learn to introspect the system a bit to understand which is the correct one.

Depending strictly on conda X11 packages or system-installed packages specifically is going to be painful either way.

@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Aug 3, 2018

Depending strictly on conda X11 packages or system-installed packages specifically is going to be painful either way.

This might depend on your definition of "painful". X11 is stagnant these days and the X.org libraries are the de facto standard implementations, so relying strictly on conda libraries to implement the X11 protocols just doesn't seem like a big deal to me, from the standpoint of software robustness. (Obviously I'm not an Anaconda support person, but I don't think I've ever seen a problem that was traced back to conda-forge's X11 packages?)

In terms of bloat, that's a different question (although one that I also tend to be sanguine about).

@msarahan

This comment has been minimized.

Copy link
Member

msarahan commented Aug 3, 2018

@mingwandroid's concern has always been about system compatibility that would be broken or sub-optimal with packaged X11. Most especially, he is concerned with hardware acceleration. I don't see that you're taking his concerns into account.

Using a non-hardware accelerated 3D rendering application is painful. Can you definitively prove that your X11 packages work with speed comparable to system packages? Across all packages in the ecosystem? Do you really even want to think about making that proof? Why not leave people with the option, so you can sidestep that proof and leave it up to the user to troubleshoot?

@pkgw

This comment has been minimized.

Copy link
Author

pkgw commented Aug 3, 2018

@msarahan That's a good point. I haven't investigated hardware accel.

@mingwandroid

This comment has been minimized.

Copy link

mingwandroid commented Aug 3, 2018

There's also an amount of "this is how it was done before and it's worked well" in the decision to not provide our own X11.

@jakirkham

This comment has been minimized.

Copy link
Member

jakirkham commented Aug 3, 2018

Do you know of a good benchmark or benchmarks for your hardware acceleration concerns, @mingwandroid?

@mingwandroid

This comment has been minimized.

Copy link

mingwandroid commented Aug 3, 2018

glxgears? Not really. I never had time to do any analysis of this.

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Aug 3, 2018

We've also included X11 in the emacs feedstock https://github.com/conda-forge/emacs-feedstock/blob/master/recipe/meta.yaml. It's really convenient that you can install emacs on a headless box, which you might not have root access to install the X11 stuff in. The problem is that when emacs is built with GUI mode enabled, it can't launch at all without the X11 libraries, even if you run it with -nw (conda-forge/emacs-feedstock#11). So I think the alternative would have to be to have a separate --without-x build and have conda somehow install that when libXaw etc. aren't found (what ever happened with the talks on conda tracking system packages?). I don't use Linux myself but I know others do use the package, and I haven't heard any complaints regarding the Xorg libraries.

@mingwandroid

This comment has been minimized.

Copy link

mingwandroid commented Aug 3, 2018

@asmeurer, this isn't about whether things should link to X11 or not, although we don't provide X11 on defaults we still provide packages that link to your system's X11. For headless scenarios you can still install system X11 libs on them in general and use e.g. xvfb-run when testing etc.

From our perspective this difference should be abstracted so the same recipe can use either CDT X11 packages at build time or conda-forge X11 packages at runtime.

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Aug 3, 2018

although we don't provide X11 on defaults we still provide packages that link to your system's X11.

The conda-forge policy doesn't have to match the defaults policy.

For headless scenarios you can still install system X11 libs on them in general

Not if you don't have sudo access. You could say that you could install them with conda, but then you might as well just depend on the conda packages. The user experience of "if you get error while loading shared libraries then install some package Z" is very bad.

The ideal scenario would be an x11 metapackage that installs nothing if the libx* libraries are installed system-wide and installs the xorg packages they aren't. Is something like this currently possible with conda? Last I heard it isn't but is in the works. Until it is my opinion is that conda-forge packages that depend on x libraries should depend on the respective conda-forge packages. The user experience tradeoff is on the one hand, some users will see an error and have to install a package (either via system or conda) to fix it, and on the other, ( as I understand it) there may be a degradation of performance from the conda-forge xorg packages being used instead of hardware accelerated system ones (is this a known issue for some package or a theoretical one?). IMO it's a better tradeoff to avoid the dylib error. Maybe as a stop-gap empty xorg packages could be put in a channel for people to install in case they want to use the system ones.

@mingwandroid

This comment has been minimized.

Copy link

mingwandroid commented Aug 3, 2018

The conda-forge policy doesn't have to match the defaults policy

Indeed. conda-forge are obviously free to decide what to do here.

The ideal scenario would be an x11 metapackage that installs nothing if the libx* libraries are installed system-wide and installs the xorg packages they aren't.

No, there's not really any way to do this at present.

is this a known issue for some package or a theoretical one?

It needs investigation, but I think the conda-forge X11 stack will not be accelerated. Someone needs to run lsof while running a graphically intensive X11 app with nvidia or amd drivers installed and see if they turn up or not.

@mingwandroid

This comment has been minimized.

Copy link

mingwandroid commented Aug 3, 2018

The ideal scenario would be an x11 metapackage that installs nothing if the libx* libraries are installed system-wide and installs the xorg packages they aren'

To build a something against an X11 stack such that it'll work on CentOS6 or above as well as with conda-forge libs you'd need to actually link to the CentOS6 CDT packages to prevent newer symbols getting used. Is that something worth considering?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.