-
Notifications
You must be signed in to change notification settings - Fork 146
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
Fix get_python_install_dir issues #601
Conversation
This is the way catkin sets the install dir, see catkin/cmake/python.cmake
Hi @timonegk— sorry for the long delay, but thanks for taking a stab at this! I've been busy but would like to get back to trying to get this release out and am just taking a look at your work here. Regarding the business of conflicting variables, I think if we were able to re-implement less logic here this wouldn't matter as much. That is, if we simply vendored-in (and clearly marked, in order to keep it in sync) a copy of python.cmake, and called it from a wrapper that printed out whatever Regarding caching, yeah it can be left off for now. It's not important in the base case of catkin/cmake packages. Internally at Clearpath, we call the function each time we build a plain Python package (see https://github.com/mikepurvis/catkin_tools_python/blob/master/catkin_tools_python/job.py#L215), but if that becomes a concern for us, we can handle adding the caching or changing that logic. I think the litmus test for getting this in is probably to add a test that does the following:
This should be run 4x, once each for the workspace being Python 2 or Python 3 (catkin_tools itself is now always Python 3), and once each for the develspace and installspace, per this logic here: catkin_tools/catkin_tools/jobs/cmake.py Lines 169 to 175 in 74e9d2b
|
Thank you for the feedback. I added the tests that you proposed. Regarding the |
I do not really understand why the CI is failing. It seems to be related to ros/catkin#863 and therefore seems to be a problem of the CI itself. I also cannot reproduce the problem in a bionic container. If you don't know how to fix the issue, I would suggest to remove the install tests (since the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the issue with the install tests is that they're using the wrong Python— --install-layout=deb
isn't recognized by the upstream Python that Travis uses for its virtualenvs; it's something that Debian patches into the version of Python that it ships in its python packages. This is why we specify using the Debian python in the test configurations:
Lines 5 to 24 in 5fc3a5d
- dist: xenial | |
language: python | |
python: "3.5" | |
os: linux | |
env: PYTHON=/usr/bin/python3.5 CATKIN_VERSION=indigo-devel | |
- dist: bionic | |
language: python | |
python: "3.6" | |
os: linux | |
env: PYTHON=/usr/bin/python3.6 CATKIN_VERSION=indigo-devel | |
- dist: bionic | |
language: python | |
python: "3.7" | |
os: linux | |
env: PYTHON=/usr/bin/python3.7 CATKIN_VERSION=indigo-devel | |
- dist: bionic | |
language: python | |
python: "3.8" | |
os: linux | |
env: PYTHON=/usr/bin/python3.8 CATKIN_VERSION=indigo-devel |
Whereas your error is showing that it's using /home/travis/virtualenv/python3.5.6/bin/python3
instead.
Also, I'm noticing that there aren't actually any other tests that clone in external content— I thought there were, but they either never merged or have since been revised. I suggested this path though, so this approach is fine to merge for now, but eventually I may change this to just use a toy package contained within the repo, since the overall test harness already happens in a context which contains a build of catkin
, per https://github.com/catkin/catkin_tools/blob/master/.travis.yml#L36.
.travis.yml
Outdated
@@ -33,15 +33,18 @@ before_script: | |||
# Install catkin_tools test harness dependencies | |||
- ./.travis.before_script.bash | |||
- pip install empy sphinx_rtd_theme nose coverage flake8 mock --upgrade | |||
- python2 -m pip install --user catkin-pkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? Pretty sure we should always just call python
and let the PATH set by travis steer that to the right place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building catkin with python 2 requires the catkin_pkg package for python 2. This is not related to the python version for catkin_tools which is managed by travis
Are you sure that setting the |
Well, I just realized that the new |
This looks terrific. Really appreciate this contribution and your patience in iterating on it with me. |
Thank you, I'm happy to contribute! |
This pull request attempts to close #597 by shelling out to check
cmake -P
, as suggested in the issue. The executed script, however, does not depend on catkin and should therefore work fine for workspaces without catkin.While it might have been possible to replicate the behavior of cmake manually, I decided against it because this solution is easier to maintain and less error-prone, especially since the
find_program
cmake builtin would have been rather annoying to reimplement.I marked this pull request as a draft because
get_python_install_dir
is only used to writesetup.sh
once).In the second commit I fixed the install path for python3 on debian systems to reflect catkin's behavior.