Merge lp:~mzanetti/unity/phablet-better-cmake into lp:unity/phablet

Proposed by Michael Zanetti
Status: Merged
Approved by: Michał Sawicz
Approved revision: no longer in the source branch.
Merged at revision: 564
Proposed branch: lp:~mzanetti/unity/phablet-better-cmake
Merge into: lp:unity/phablet
Diff against target: 42 lines (+1/-11)
4 files modified
debian/control (+0/-1)
debian/qml-phone-shell-autopilot.install (+1/-1)
tests/CMakeLists.txt (+0/-1)
tests/autopilot/CMakeLists.txt (+0/-8)
To merge this branch: bzr merge lp:~mzanetti/unity/phablet-better-cmake
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Approve
Michi Henning (community) Needs Fixing
Review via email: mp+155451@code.launchpad.net

Commit message

use a static python install path for autopilot tests

Description of the change

make determining python install path in cmake a bit more robust and verbose

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

We need to make sure what's the recommended approach here. We did merge s/python2.7/python/ for debian/control, what all the other projects did, but if this MP is the right solution (I'm inclined to think so - will python == python2 even after python3 becomes default?), we need to apply it across the board.

review: Needs Information
Revision history for this message
Michael Zanetti (mzanetti) wrote :

I think this should be ok now...

build-dep is "python" and the call is to "python" too. All references to "python2.7" should be gone and that should also be future-proof for python 3.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

The fallback - in case the path could not be determined with the python call - indeed needs to be updated for a specific python version.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

I will try and gather some more information, I'm still afraid we'll end up with a broken setup when python becomes python3 by default, if any of autopilot or the tests will not be python3 ready.

Revision history for this message
Michi Henning (michihenning) wrote :

The absolute path produced by this prevents make install from working.

See https://bugs.launchpad.net/unity/+bug/1164825

review: Needs Fixing
Revision history for this message
Michael Terry (mterry) wrote :

Regarding python/python3, last I checked, Ubuntu has no plans to make python point at python3. "python" == "python2"

Revision history for this message
Michał Sawicz (saviq) wrote :

Could we add a enable_localinstall (default OFF) option and install under CMAKE_INSTALL_PREFIX when it's enabled?

review: Needs Information
Revision history for this message
Michi Henning (michihenning) wrote :

I don't think we need such an option. This is enough:

if (NOT DEFINED CMAKE_INSTALL_PREFIX)
    set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "" FORCE)
endif()

The idea is that I can test the install target locally by running "make install". This makes it easy to check that everything that should be installed is actually installed, and installed in the correct location.

At any rate, we can't have an absolute path in any of the install targets because that defeats the purpose of CMAKE_INSTALL_PREFIX.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

Hey.. I've been thinking about this....

- It seems in case python would be upgraded to 3 there always is the need of manual intervention in some way or the other.
- most likely the tests (and autopilot itself) won't work with python3 anyways. That means having a dynamic install path that would not solve that problem but just causes weirdness => installing always to 2.7 would immediately show the version mismatch.
- those calls to python in cmake etc introduce the problematic dependencies
- As Michi pointed out, it also breaks CMAKE_INSTALL_PATH

=> My conclusion is to remove all the crap and just install it to the python2.7 dir in the .install file.

How does that sound?

Revision history for this message
Michi Henning (michihenning) wrote :

> => My conclusion is to remove all the crap and just install it to the
> python2.7 dir in the .install file.
>
> How does that sound?

As long as we have a specific dependency on python2.7, I don't see a problem with that.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> > => My conclusion is to remove all the crap and just install it to the
> > python2.7 dir in the .install file.
> >
> > How does that sound?
>
> As long as we have a specific dependency on python2.7, I don't see a problem
> with that.

We don't need the build dependency any more... Before it was just there because cmake was executing that python call.

For running the tests, there is an implicit dependency to python through autopilot itself.

Revision history for this message
Michał Sawicz (saviq) :
review: Approve
Revision history for this message
Michał Sawicz (saviq) wrote :

We should have a proper FindPython module that would determine that path for us while taking CMAKE_INSTALL_PREFIX into account...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-04-05 09:22:26 +0000
3+++ debian/control 2013-04-09 09:46:21 +0000
4@@ -22,7 +22,6 @@
5 libhud-client1-dev,
6 libdee-qt5-dev (>= 3.0),
7 demo-assets,
8- python,
9 Standards-Version: 3.9.3
10 Vcs-Bzr: lp:unity/phablet
11
12
13=== modified file 'debian/qml-phone-shell-autopilot.install'
14--- debian/qml-phone-shell-autopilot.install 2013-02-26 15:02:07 +0000
15+++ debian/qml-phone-shell-autopilot.install 2013-04-09 09:46:21 +0000
16@@ -1,1 +1,1 @@
17-usr/lib/python*/dist-packages/qml_phone_shell/*
18+tests/autopilot/qml_phone_shell/* usr/lib/python2.7/dist-packages/qml_phone_shell/
19
20=== modified file 'tests/CMakeLists.txt'
21--- tests/CMakeLists.txt 2013-04-04 20:22:30 +0000
22+++ tests/CMakeLists.txt 2013-04-09 09:46:21 +0000
23@@ -68,6 +68,5 @@
24
25 add_custom_target(alltests)
26
27-add_subdirectory(autopilot)
28 add_subdirectory(unittests)
29 add_subdirectory(qmluitests)
30
31=== removed file 'tests/autopilot/CMakeLists.txt'
32--- tests/autopilot/CMakeLists.txt 2013-03-27 11:12:48 +0000
33+++ tests/autopilot/CMakeLists.txt 1970-01-01 00:00:00 +0000
34@@ -1,8 +0,0 @@
35-set(AUTOPILOT_DIR qml_phone_shell)
36-
37-execute_process(COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
38- OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
39-
40-install(DIRECTORY ${AUTOPILOT_DIR}
41- DESTINATION ${PYTHON_PACKAGE_DIR}
42- )

Subscribers

People subscribed via source and target branches