Merge lp:~compiz-team/compiz/compiz.fix_python_tests_failing_in_chroots into lp:compiz/0.9.8

Proposed by Sam Spilsbury
Status: Rejected
Rejected by: Sam Spilsbury
Proposed branch: lp:~compiz-team/compiz/compiz.fix_python_tests_failing_in_chroots
Merge into: lp:compiz/0.9.8
Diff against target: 111 lines (+50/-0) (has conflicts)
4 files modified
compizconfig/compizconfig-python/tests/compiz_config_test.py (+12/-0)
compizconfig/gsettings/gsettings_backend_shared/CMakeLists.txt (+24/-0)
compizconfig/libcompizconfig/config/config_test (+3/-0)
compizconfig/libcompizconfig/src/CMakeLists.txt (+11/-0)
Text conflict in compizconfig/compizconfig-python/tests/compiz_config_test.py
Text conflict in compizconfig/gsettings/gsettings_backend_shared/CMakeLists.txt
Conflict adding file compizconfig/libcompizconfig/config/config_test.  Moved existing file to compizconfig/libcompizconfig/config/config_test.moved.
Text conflict in compizconfig/libcompizconfig/src/CMakeLists.txt
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_python_tests_failing_in_chroots
Reviewer Review Type Date Requested Status
Sam Spilsbury Disapprove
Daniel van Vugt Needs Fixing
Łukasz Zemczak Pending
Francis Ginther Pending
Didier Roche-Tolomelli Pending
Review via email: mp+120764@code.launchpad.net

This proposal supersedes a proposal from 2012-08-01.

Description of the change

== Problem ==

Python tests fail non-determininstically in chroots

== Solution ==

  Fix some problems with python tests failing in chroots

  1) Don't allow duplicate symbols
  2) Set environment variables properly so that we always use the ini backend
  3) Always use the specified testing config file for compizconfig

== Test ==

Already covered by python tests

UNBLOCK

Resubmitting this to check if its still relevant.

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Works OK, but I'm a little concerned about dynamic linkage to locally built libraries in test cases:
add_library (gsettings_backend_shared SHARED

This means we're either relying on an LD_LIBRARY_PATH that is implicitly set (I don't see one) or the hardcoding of library paths (the source build directory) into our binaries.

How do we ensure tests find the right libgsettings_backend_shared.so at runtime?

review: Needs Information
Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

> Works OK, but I'm a little concerned about dynamic linkage to locally built
> libraries in test cases:
> add_library (gsettings_backend_shared SHARED
>
> This means we're either relying on an LD_LIBRARY_PATH that is implicitly set
> (I don't see one) or the hardcoding of library paths (the source build
> directory) into our binaries.
>
> How do we ensure tests find the right libgsettings_backend_shared.so at
> runtime?

The library is installed in the right place.

46 + install (TARGETS gsettings_backend_shared
47 + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

That's not relevant. Tests don't use the install tree. They use the build tree.

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

> That's not relevant. Tests don't use the install tree. They use the build
> tree.

Oh ok.

In terms of the build tree, the right libraries are automatically pulled in at runtime, since libgsettings.so is linked to libgsettings_backend_shared.so (which resolves to the local version inside the build tree, and then is re-linked at install time).

Also from what I've read its not possible to change LD_LIBRARY_PATH at runtime anyways, you need to use a wrapper to do it, which isn't very valgrind friendly.

Revision history for this message
Francis Ginther (fginther) wrote : Posted in a previous version of this proposal

Review was claimed by accident, please ignore.

review: Abstain
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

OK, well it works for now. Just be aware that I think you're relying on an implicit -rpath (see: man ld) to find the shared library at test-time. That could change/break with different compilers in future.

It *might* be safe if ctest sets up LD_LIBRARY_PATH for you. I'm not sure if it does or if it's just working because of the hard-coded -rpath. But it works for now.

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote : Posted in a previous version of this proposal

No commit message specified.

Revision history for this message
Unity Merger (unity-merger) wrote : Posted in a previous version of this proposal
Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

^ packaging needs to be updated for this to work it seems.

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

Added didrocks to look at the packaging. Is it still didrocks or someone else?

Revision history for this message
Sam Spilsbury (smspillaz) wrote : Posted in a previous version of this proposal

subscribed sil2100, as he does the compiz packaging nowadays I think

Revision history for this message
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal

FYI, it's CMake setting the rpath that makes libgsettings_backend_shared.so findable at test time, within the build tree...
http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:set_target_properties

Revision history for this message
Unity Merger (unity-merger) wrote : Posted in a previous version of this proposal

Attempt to merge into lp:compiz failed due to conflicts:

text conflict in compizconfig/compizconfig-python/tests/compiz_config_test.py

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Lots of conflicts.

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

I don't think we'll be needing this now, as most of it has been merged into lp:compiz in the form of other branches.

review: Disapprove

Unmerged revisions

3295. By Sam Spilsbury

Be more pythonic

3294. By Sam Spilsbury

Fix some problems with python tests failing in chroots

1) Don't allow duplicate symbols
2) Set environment variables properly so that we always use the ini backend
3) Always use the specified testing config file for compizconfig

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'compizconfig/compizconfig-python/tests/compiz_config_test.py'
2--- compizconfig/compizconfig-python/tests/compiz_config_test.py 2012-08-09 18:30:54 +0000
3+++ compizconfig/compizconfig-python/tests/compiz_config_test.py 2012-08-22 13:19:51 +0000
4@@ -1,9 +1,18 @@
5 import os
6+
7+os.environ["G_SLICE"] = "always-malloc"
8+os.environ["COMPIZ_CONFIG_PROFILE"] = ""
9+os.environ["XDG_CONFIG_HOME"] = "compizconfig/libcompizconfig/config"
10+os.environ["COMPIZ_METADATA_PATH"] = "generated/"
11+os.environ["LIBCOMPIZCONFIG_BACKEND_PATH"] = "compizconfig/libcompizconfig/backend/"
12+os.environ["XDG_DATA_DIRS"] = "generated/"
13+
14 import sys
15 import subprocess
16
17 arch = subprocess.Popen (["uname", "-p"], stdout=subprocess.PIPE).communicate ()[0][:-1]
18
19+<<<<<<< TREE
20 os.environ["G_SLICE"] = "always-malloc"
21 os.environ["COMPIZ_METADATA_PATH"] = "generated/"
22 os.environ["COMPIZ_CONFIG_PROFILE"] = ""
23@@ -12,6 +21,9 @@
24 os.environ["XDG_DATA_DIRS"] = "generated/"
25
26 sys.path.insert (0, "compizconfig/compizconfig-python/build/lib.linux-%s-%s.%s/" % (arch, sys.version_info[0], sys.version_info[1]))
27+=======
28+sys.path.insert (0, "compizconfig/compizconfig-python/build/lib.linux-%s-%s.%s/" % (arch, sys.version_info[0], sys.version_info[1]))
29+>>>>>>> MERGE-SOURCE
30
31 import unittest
32 import compizconfig
33
34=== modified file 'compizconfig/gsettings/gsettings_backend_shared/CMakeLists.txt'
35--- compizconfig/gsettings/gsettings_backend_shared/CMakeLists.txt 2012-08-19 10:02:23 +0000
36+++ compizconfig/gsettings/gsettings_backend_shared/CMakeLists.txt 2012-08-22 13:19:51 +0000
37@@ -15,6 +15,7 @@
38 include_directories (${GSETTINGS_UTIL_LIB_INCLUDES})
39
40 link_directories (${GSETTINGS_UTIL_LIBRARY_DIRS}
41+<<<<<<< TREE
42 ${compiz_BINARY_DIR}/compizconfig/libcompizconfig
43 ${compiz_BINARY_DIR}/compizconfig/integration/gnome
44 ${CMAKE_BINARY_DIR}/compizconfig/integration/gnome/gconf
45@@ -76,5 +77,28 @@
46 set_target_properties (compizconfig_gsettings_backend PROPERTIES
47 LINK_INTERFACE_LIBRARIES ""
48 )
49+=======
50+ ${compiz_BINARY_DIR}/compizconfig/libcompizconfig)
51+
52+ add_library (gsettings_backend_shared SHARED
53+ ${CMAKE_CURRENT_SOURCE_DIR}/gsettings_constants.c
54+ ${CMAKE_CURRENT_SOURCE_DIR}/gsettings_util.c)
55+
56+
57+ target_link_libraries (gsettings_backend_shared
58+ ${GSETTINGS_UTIL_LIBRARIES}
59+ compizconfig)
60+>>>>>>> MERGE-SOURCE
61+
62+ install (TARGETS gsettings_backend_shared
63+ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
64+
65+ #
66+ # Tell CMake that targets using gsettings_backend_shared should NOT re-import the
67+ # libraries that gsettings_backend_shared depends on (contains).
68+ #
69+ set_target_properties (gsettings_backend_shared PROPERTIES
70+ LINK_INTERFACE_LIBRARIES ""
71+ )
72
73 endif (GSETTINGS_UTIL_FOUND)
74
75=== added file 'compizconfig/libcompizconfig/config/config_test'
76--- compizconfig/libcompizconfig/config/config_test 1970-01-01 00:00:00 +0000
77+++ compizconfig/libcompizconfig/config/config_test 2012-08-22 13:19:51 +0000
78@@ -0,0 +1,3 @@
79+[general]
80+backend = ini
81+plugin_list_autosort = true
82
83=== renamed file 'compizconfig/libcompizconfig/config/config_test' => 'compizconfig/libcompizconfig/config/config_test.moved'
84=== modified file 'compizconfig/libcompizconfig/src/CMakeLists.txt'
85--- compizconfig/libcompizconfig/src/CMakeLists.txt 2012-07-26 23:11:25 +0000
86+++ compizconfig/libcompizconfig/src/CMakeLists.txt 2012-08-22 13:19:51 +0000
87@@ -68,6 +68,7 @@
88 compizconfig ${LIBCOMPIZCONFIG_LIBRARIES} m
89 )
90
91+<<<<<<< TREE
92 #
93 # Tell CMake that targets using compizconfig should NOT re-import the
94 # libraries that compizconfig depends on (contains).
95@@ -76,6 +77,16 @@
96 LINK_INTERFACE_LIBRARIES ""
97 )
98
99+=======
100+#
101+# Tell CMake that targets using compizconfig should NOT re-import the
102+# libraries that compizconfig depends on (contains).
103+#
104+set_target_properties (compizconfig PROPERTIES
105+ LINK_INTERFACE_LIBRARIES ""
106+)
107+
108+>>>>>>> MERGE-SOURCE
109 set (COMPIZCONFIG_LIBS "")
110 foreach (_val ${LIBCOMPIZCONFIG_LDFLAGS})
111 set (COMPIZCONFIG_LIBS "${COMPIZCONFIG_LIBS}${_val} ")

Subscribers

People subscribed via source and target branches