-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Build failing after installing dependencies via conda #2707
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
Comments
@molpopgen I'm not 100% sure, but it seems that after creating the whole conda env RTD is trying to install your own project into a virtualenv by doing I need to download the docker image in my computer (will take some time) to test this better. I think that is the reason, in fact this commit (molpopgen/fwdpy@468af4d) that has that setting in Please, check that and confirm. |
Turning pip_install to false only results in some of the documentation being built. The manual is generated from the .rst files but not from any of the "autodoc" stuff, which requires loading the module, which in turn requires compiling it. In other words, the build you link to is also a failure, even though it passes all of RTD's checks. If I were doing this on my machine (not using Docker), I would do the following:
My understanding is that I need to install the package in order to be able to load it. However, I cannot do this on the Docker container--there are many issues re: conda environs, permissions, etc., that I cannot sort out. |
Any thoughts on this? I'm struggling to find an example of a project hosted on RTD that:
I am aware of one packages satisfying number 2. In speaking with the dev, he gave up on having RTD build the package and instead provides mock documentation. Is there a test package that you have used to illustrate that this is indeed possible? |
@molpopgen I noticed that you do not have continuous integration for your project. I have encountered similar problems to this one in the past and my advice is that you try to setup up Travis CI, so you can decouple installation problems from documentation problems. For instance, I tried to install your library locally and failed:
This suggests there is some problem with the |
@Juanlu001 Not sure where you're getting this, but Travis CI is indeed set up for fwdpy, and works. See the .travis file: https://github.com/molpopgen/fwdpy/blob/master/.travis.yml The installations are known to work, both from source and from bioconda. There is a dev branch with an even more streamlined build setup via conda, too, that gets rid of the need for some setup.py flags. |
My fault, I assume everybody is using these colourful shields :)
Let's go on the conversation elsewhere: molpopgen/fwdpy#6 |
What if you drop the Python version specification from your |
Is there a reason why that would that matter? The problem is with conda.
You install a dependency, try to compile an extension module using it, and
it's headers can't be found. This cannot be mocked out, as no module
exists for making docs until the build succeeds. It seems like this should
be independent of the python version.
I've requested a link to a working example, but none has been provided.
On Mon, Apr 3, 2017, 4:29 PM jakirkham ***@***.***> wrote:
What if you drop the Python version specification from your
readthedocs.yml file, @molpopgen <https://github.com/molpopgen>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2707 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGHnH7z6dudK1grrDnSNPBZZFkKgXcSEks5rsYAfgaJpZM4MXDZ9>
.
--
Kevin Thornton
Associate Professor
Ecology and Evolutionary Biology
UC Irvine
http://www.molpopgen.org
http://github.com/ThorntonLab
http://guthub.com/molpopgen
|
I tried it on another similar project, and again I get failures: https://readthedocs.org/projects/fwdpy11/builds/5243308/ The main code is here: https://github.com/molpopgen/fwdpy11/tree/rtd The failure is not being able to find a GSL header installed by conda. I am reasonably certain that the conda support is broken as far as things that need to be compiled against external dependencies are concerned. It does not do what conda is meant to, which is get rid of the need for dealing with paths, etc. Again, another request for one of the devs to provide a working example... |
Perhaps not. Just thought it was something that could be easily handled by the
|
Is there an example you can point to for any project hosted on RTD that does this? Your example refers to a Python package, but what about my case, which is a C library (GSL in this case)? Again, to be clear: in order for docs to be build, the extension module must be compiled. Compiling it requires external C/C++ libraries in addition to Python packages. We are not talking about using headers installed by other Python packages. The usual use case here would be to call |
Isn't this precisely why conda is used in the first place? The fact that this is not working would seem to be strong evidence that the way conda is used by RTD is somehow flawed--perhaps installed somewhere funny and then not documented? |
Yes, sorry, should have included this in that comment. This isn't merged yet, but PR ( pyFFTW/pyFFTW#161 ) works with Cython and a C library (FFTW). Just recently composed it, so should be able to answer questions. We handled the paths in PR ( pyFFTW/pyFFTW#162 ).
The |
OK, so that seems to fix the compilation part. I still need to deal with the next failure, which has to do with running doxygen to build a manual for the C++ API. I'm getting the following error: doxygen: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory Presumably, the runtime path is not set correctly. I can try skipping this, for now. |
OK, so it seems like many problems have been resolved. However, after installing the module, the actual building of the manual fails to find it. There are several modules, and an exception is raised for each (see below). Does this mean I somehow need to get PYTHONPATH adjusted?
|
We ran into something similar. Not sure if it is the same thing you are encountering or not. It turns out when RTD installs the package it doesn't do a development mode install. Instead it just installs the package in To fix it, we had to comment one line in the Sphinx |
I made the following change to my conf.py, and am still getting import errors: if (os.environ.get('READTHEDOCS')==True) is False:
sys.path.insert(0, os.path.abspath('..'))
else:
import site
p=site.getsitepackages()[0]
sys.path.insert(0,p) I even tried doing nothing if READTHEDOCS is True, and get the same problem. The specific error comes when importing the main module. The init.py tries to import some of the compiled modules and cannot find them. |
All environment variables are strings. So instead of |
Got the error "site has no attribute getsitepackages" when using virtualenv on RTD, possible workaround at kivy/python-for-android#610 (comment) |
@molpopgen some things regarding the build process has changed since this issue was reported and I see the last build was like a year ago. Can you try again to re-build your docs and let us know if the problem is still there? |
@humitos, I no longer update this project, but I do work on a similar one replacing it. RTD worked fine for that project for a while, but is suddenly plagued by problems again. These issues came on w/o warning, and then suddenly seem to have gone away. My current project is this. I won't know if the build successes are luck or not until I make further changes. |
@molpopgen thanks for your reply. I think that no one else is having this issue and you are not working on this project anymore so I will close this issue here --but feel free to reopen it if anyone else consider approapiate. Also, please keep us updated regarding your current project and the builds by openning new issues. I'd appreciate that :) |
Here is an example of a failed build: https://readthedocs.org/projects/fwdpy11/builds/6928074/ Nothing has changed about the RTD setup, and the only difference from the successful build of the same branch 3 weeks ago is a minor PR which passes on Travis (as well as on several of my own systems): https://travis-ci.org/molpopgen/fwdpy11/builds/356684112 No idea why pthread is failing. |
Maybe some memory limit? I will test this project on my local instance tomorrow. |
If so, then there's no indication of that in the latest build failure: https://readthedocs.org/projects/fwdpy11/builds/6928074/. If you do test the project, the dev branch is the relevant one. |
I no longer use doxygen. The frustration here is that the failures are random, suggesting that limits are hit on some build nodes but not others maybe? For this latest build, there's even less code to compile than the last successful build, and the point of failure seems to have been on one of the lighter files, too. Is it possible to actually see detailed build logs? |
I see this error in the log,
Could it be that the reason of the failure? So, maybe the version of https://stackoverflow.com/questions/31965413/compile-c14-code-with-g/31965806#31965806
|
@humitos of what I understand the builds sometimes success and others not. And I was trying to build the docs on my local instance and got a memory limit error. |
No. That is an intentional part of the build system. There are tests performed to determine if C++14 is available. The test is based on a method provided by pybind11, upon which this project is based. If this error were the show-stopper, the build log would have ended there. This repo is known to build correctly in conda systems, both on Travis and in the real word. The C++14 detection also works on non-Travis systems that have up-to-date compilers. Any build failures are specific to RTD, and seemingly a bit random... |
@stsewd Did it die at the same point as my last RTD build? |
The failures seen in my latest build attempt of the dev branch end with this as the error:
Is that compatible with a memory limit error? It really seems like an environment issue, and one that I cannot control. I'm installing the dependencies via conda as I always do, using methods which work for Travis, bioconda, etc. |
@molpopgen I tested your dev branch with memory limit increase, it fails on the same step now :/
|
@stsewd Thanks. I strongly believe that there's something going amiss with setting up the RTD environments. I just manually triggered a new build of the dev branch,which has had no new commits to it. The build passed: https://readthedocs.org/projects/fwdpy11/builds/6932137/ |
@stsewd -- my mistake! I triggered a build of "latest", not "dev" yesterday. |
@stsewd I managed to get the dev branch working. The trick was to remove gcc from the list of conda dependencies. This removal results in using whatever built-in compiler happens to be there. Not using the conda gcc may or may not be ok in general. I'm unable to figure out what packages the RTD build environment is using, but if it is GCC >= 5, then there's the risk of link-failure when compiling a project on the build system and linking it against a C++ dependency installed via conda. I'm going to attempt to install both gcc and libgcc via conda and see what happens... |
@stsewd Installing gcc + libgcc from conda also fails. It should probably be documented NOT to use the conda gcc. |
It's 5.4.0. I pasted in my previous comment: #2707 (comment) If you want to check any version of any package used to build the docs, you can pull the docker image used to build the docs:
Then run bash on this image:
and use
Agreed. I'd say that we need more information (other projects with the same problem, understand exactly what's happening --I'm a little lost, etc), and mention these things possible problems in that note. Let me know if that helps. |
@humitos -- Thanks. So, having GCC 5.4 in the env is a feature or a bug, depending on the goals. The feature is that you can use all of c++11 and most/all of C++14. That's great. The bug side is that RTD intends to support building docs for packages needing compilation, and that dependencies can be pulled in via conda. The current conda compiler is GCC 4.8.5. That gives you C++11, but not C++14. (That works for me, at least for now, but it is unlikely to work for everyone.) The reason why this matters is that you cannot link C++ code compiled with GCC5 to a C++ library compiled with GCC4, due to an ABI incompatibility introduced to accommodate the new C++11 standard. (Note that it is possible to have a dual-ABI GCC5, though.) |
@humitos -- Related to this docker stuff, is there a specific set of commands one should use to attempt to build a package using the exact method that RTD uses? A different project of mine is failing to build, and I cannot reproduce the error on any of my machines, nor can I find a "for dummies recipe" for building via Docker. I see there's a |
@humitos I managed to build the dev branch of my other project in the Docker image. Even though I probably didn't use the exact same commands, I reproduced the build failure there and pushed a fix for it that seems to work ok in general. However, after the fix, there are still missing symbols errors when attempting to build the manual. These are in a C++ dependency installed via conda, which happens to be another of my projects. This dependency gets installed via the bioconda channel, where it is build with GCC 4.8.5. This error is exactly what I am referring to above, and are classic symptoms of ABI issues:
|
@molpopgen nice that you found the problem and thanks for explained it to us. If what you are saying here is the solution:
I think it would be great to open a specific issue to track this solution and I also invite you to propose a PR in the https://github.com/rtfd/readthedocs-docker-images repository, but also, we have to think "how the user will change that value from his documentation code" and make a PR for this repository with that feature. |
@humitos I'll see what I can do. I have zero experience with Docker/containers in general, though, so it may be rough going. |
I'm not sure how is the correct way to solve this, but having a PR that "more or less" draws the idea is a good starting point. We will probably need to make a design decision with the rest of the core team also. I think the most complicated point is how the user decide what version to use and how RTD source code communicates that decision to the docker container. |
Do you mean an issue ticket rather than a PR? I literally wouldn't know where to start a PR, given that I know zero about the RTD code repo, Docker, etc. I can, however, raise this as an issue. |
Details
Expected Result
The project is a Cython extension module that depends on C++11 libraries. The relevant dependent libraries are installed via conda (docs/environment.yml) in the repo. In order for Sphinx to work, the module must be built or installed, at which point the docs should be built.
Actual Result
The header file from one of the dependencies installed via conda cannot be found (see build log). I've not taken the time to replicate this behavior via the docker image, but it seems like I'm doing something wrong. The gcc for the docker image is is g++5, which is more than good enough.
The problem seems to be that after installing the conda packages, attempting to install my project is done in an environment where the conda installs do not exist. I've not been able to find explicit docs on how to use dependent C/C++ libraries in a build beyond including them in the environment.yml file.
The text was updated successfully, but these errors were encountered: