Merge lp:~townsend/libertine/xmir-enable-rootless into lp:libertine

Proposed by Christopher Townsend
Status: Merged
Approved by: Larry Price
Approved revision: 394
Merged at revision: 394
Proposed branch: lp:~townsend/libertine/xmir-enable-rootless
Merge into: lp:libertine
Diff against target: 231 lines (+4/-79)
8 files modified
debian/control (+0/-1)
python/libertine/ChrootContainer.py (+0/-6)
python/libertine/Libertine.py (+1/-12)
python/libertine/LxcContainer.py (+0/-6)
python/libertine/LxdContainer.py (+0/-39)
python/libertine/launcher/config.py (+1/-4)
python/libertine/utils.py (+0/-9)
tools/libertine-xmir (+2/-2)
To merge this branch: bzr merge lp:~townsend/libertine/xmir-enable-rootless
Reviewer Review Type Date Requested Status
Larry Price Approve
Libertine CI Bot continuous-integration Approve
Review via email: mp+316588@code.launchpad.net

Commit message

Enable Xmir '-rootless' mode by default and remove using Matchbox for the window manager.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:394
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/373/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/715
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/586
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/586
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/586
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/586
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/725
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/706
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/706/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/706
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/706/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/706
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/706/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/706
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/706/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/373/rebuild

review: Approve (continuous-integration)
Revision history for this message
Larry Price (larryprice) wrote :

code looks good... i'll figure out a way to test it here shortly...

Revision history for this message
Larry Price (larryprice) wrote :

Tested it out, and things are starting to look really good! I checked things out like the filepicker from leafpad and everything in the GIMP. A couple of things:

* I get some very noticeable lag after initially clicking a libertine app from the dash, and then again when it's just about to actually display. Have you noticed this as well?
* As far as legacy, non-libertine apps goes, it's extremely hit or miss. A lot of them complain about not finding the X display server. I'm fairly certain this was the behavior before but I just wanted to check your feelings about it.

review: Needs Information
Revision history for this message
Larry Price (larryprice) wrote :

answers:

* lag is caused by mir 0.26, reportedly fixed in mir 0.26.1
* behavior is unchanged

review: Approve

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 2017-01-31 20:14:44 +0000
3+++ debian/control 2017-02-07 16:44:13 +0000
4@@ -103,7 +103,6 @@
5 libqt5core5a,
6 libqt5gui5,
7 libqt5widgets5,
8- matchbox-window-manager,
9 xmir [amd64 armhf arm64 i386],
10 ${misc:Depends},
11 ${python3:Depends},
12
13=== modified file 'python/libertine/ChrootContainer.py'
14--- python/libertine/ChrootContainer.py 2017-01-24 18:00:57 +0000
15+++ python/libertine/ChrootContainer.py 2017-02-07 16:44:13 +0000
16@@ -49,7 +49,6 @@
17
18 def __init__(self, container_id, config):
19 super().__init__(container_id, 'chroot', config)
20- self._window_manager = None
21 # FIXME: Disabling seccomp is a temporary measure until we fully understand why we need
22 # it or figure out when we need it.
23 os.environ['PROOT_NO_SECCOMP'] = '1'
24@@ -226,15 +225,10 @@
25 proot_cmd = self._build_proot_command()
26
27 args = shlex.split(proot_cmd)
28- args.extend(self.setup_window_manager(enable_toolbars=True))
29- self._window_manager = psutil.Popen(args, env=environ)
30-
31- args = shlex.split(proot_cmd)
32 args.extend(app_exec_line)
33 return psutil.Popen(args, env=environ)
34
35 def finish_application(self, app):
36- utils.terminate_window_manager(self._window_manager)
37 app.wait()
38
39 def _run_ldconfig(self):
40
41=== modified file 'python/libertine/Libertine.py'
42--- python/libertine/Libertine.py 2017-02-07 15:17:30 +0000
43+++ python/libertine/Libertine.py 2017-02-07 16:44:13 +0000
44@@ -86,8 +86,7 @@
45 self.root_path = utils.get_libertine_container_rootfs_path(self.container_id)
46 self.locale = self._config.get_container_locale(container_id)
47 self.language = self._get_language_from_locale()
48- self.default_packages = ['matchbox-window-manager',
49- 'libnss-extrausers',
50+ self.default_packages = ['libnss-extrausers',
51 'humanity-icon-theme',
52 'maliit-inputcontext-gtk2',
53 'maliit-inputcontext-gtk3',
54@@ -122,16 +121,6 @@
55 utils.get_logger().error("%s" % e)
56 return False
57
58- def setup_window_manager(self, enable_toolbars=False):
59- if self._binary_exists('matchbox-window-manager'):
60- if enable_toolbars:
61- return ['matchbox-window-manager']
62-
63- return ['matchbox-window-manager', '-use_titlebar', 'no']
64- else:
65- return ['compiz']
66-
67-
68 def check_language_support(self):
69 if not self._binary_exists('check-language-support'):
70 self.install_package('language-selector-common', update_cache=False)
71
72=== modified file 'python/libertine/LxcContainer.py'
73--- python/libertine/LxcContainer.py 2017-02-06 16:01:22 +0000
74+++ python/libertine/LxcContainer.py 2017-02-07 16:44:13 +0000
75@@ -164,7 +164,6 @@
76 super().__init__(container_id, 'lxc', config)
77 self.container = lxc_container(container_id)
78 self.lxc_manager_interface = None
79- self.window_manager = None
80 self.host_info = HostInfo.HostInfo()
81 self._freeze_on_stop = config.get_freeze_on_stop(self.container_id)
82
83@@ -414,9 +413,6 @@
84 self.lxc_manager_interface.container_stopped(self.container_id)
85 return
86
87- self.window_manager = self.container.attach(lxc.attach_run_command,
88- self.setup_window_manager())
89-
90 app_launch_cmd = "sudo -E -u " + os.environ['USER'] + " env PATH=" + os.environ['PATH']
91 cmd = shlex.split(app_launch_cmd)
92 app = self.container.attach(lxc.attach_run_command,
93@@ -426,6 +422,4 @@
94 def finish_application(self, app):
95 os.waitpid(app.pid, 0)
96
97- utils.terminate_window_manager(psutil.Process(self.window_manager))
98-
99 self.stop_container()
100
101=== modified file 'python/libertine/LxdContainer.py'
102--- python/libertine/LxdContainer.py 2017-02-07 14:17:30 +0000
103+++ python/libertine/LxdContainer.py 2017-02-07 16:44:13 +0000
104@@ -295,7 +295,6 @@
105 super().__init__(name, 'lxd', config)
106 self._host_info = HostInfo.HostInfo()
107 self._container = None
108- self._matchbox_pid = None
109 self._manager = None
110 self._freeze_on_stop = config.get_freeze_on_stop(self.container_id)
111
112@@ -303,7 +302,6 @@
113 raise Exception("Failed to setup lxd.")
114
115 self._client = pylxd.Client()
116- self._window_manager = None
117
118 try:
119 if utils.set_session_dbus_env_var():
120@@ -476,30 +474,6 @@
121 self._freeze_on_stop = orig_freeze
122 return self.stop_container(wait=True)
123
124- def _get_matchbox_pids(self):
125- p = subprocess.Popen(self._lxc_args('pgrep matchbox'), stdout=subprocess.PIPE)
126- out, err = p.communicate()
127- return out.decode('utf-8').split('\n')
128-
129- # FIXME: Remove once window management logic has been moved to the host
130- def _start_window_manager(self, args):
131- args.extend(self.setup_window_manager())
132-
133- if 'matchbox-window-manager' in args:
134- pids = self._get_matchbox_pids()
135-
136- self._window_manager = psutil.Popen(args)
137-
138- time.sleep(.25) # Give matchbox a moment to start in the container
139- if self._window_manager.poll() is not None:
140- utils.get_logger().warning("Window manager terminated prematurely with exit code '{}'".format(
141- self._window_manager.returncode))
142- self._window_manager = None
143- elif 'matchbox-window-manager' in args:
144- after_pids = self._get_matchbox_pids()
145- if len(after_pids) > len(pids):
146- self._matchbox_pid = (set(after_pids) - set(pids)).pop()
147-
148 def start_application(self, app_exec_line, environ):
149 if not self._try_get_container():
150 utils.get_logger().error("Could not get container '{}'".format(self.container_id))
151@@ -513,23 +487,10 @@
152
153 args = self._lxc_args("sudo -E -u {} env PATH={}".format(environ['USER'], environ['PATH']), environ)
154
155- self._start_window_manager(args.copy())
156-
157 args.extend(app_exec_line)
158 return psutil.Popen(args)
159
160 def finish_application(self, app):
161- if self._window_manager is not None:
162- utils.terminate_window_manager(self._window_manager)
163- self._window_manager = None
164-
165- # This is a workaround for an issue on xenial where the process
166- # running the window manager is not killed with the application
167- if self._matchbox_pid is not None:
168- utils.get_logger().debug("Manually killing matchbox-window-manager")
169- self.run_in_container("kill -9 {}".format(self._matchbox_pid))
170- self._matchbox_pid = None
171-
172 app.wait()
173
174 self.stop_container()
175
176=== modified file 'python/libertine/launcher/config.py'
177--- python/libertine/launcher/config.py 2016-12-05 18:33:47 +0000
178+++ python/libertine/launcher/config.py 2017-02-07 16:44:13 +0000
179@@ -1,4 +1,4 @@
180-# Copyright 2016 Canonical Ltd.
181+# Copyright 2016-2017 Canonical Ltd.
182 #
183 # This program is free software: you can redistribute it and/or modify it
184 # under the terms of the GNU General Public License version 3, as published
185@@ -215,9 +215,6 @@
186 tasks = []
187 tasks.append(TaskConfig(TaskType.LAUNCH_SERVICE, ["pasted"]))
188
189- if self.container_id is None:
190- tasks.append(TaskConfig(TaskType.LAUNCH_SERVICE, ['matchbox-window-manager', '-use_titlebar', 'no']))
191-
192 return tasks
193
194 def _create_socket_bridges(self):
195
196=== modified file 'python/libertine/utils.py'
197--- python/libertine/utils.py 2017-02-06 09:37:41 +0000
198+++ python/libertine/utils.py 2017-02-07 16:44:13 +0000
199@@ -145,15 +145,6 @@
200 return os.path.join(get_libertine_runtime_dir(), 'pulse_socket')
201
202
203-def terminate_window_manager(window_manager):
204- for child in window_manager.children():
205- child.terminate()
206- child.wait()
207-
208- window_manager.terminate()
209- window_manager.wait()
210-
211-
212 def refresh_libertine_scope():
213 scopes_object_path = "/com/canonical/unity/scopes"
214 invalidate_signal = "com.canonical.unity.scopes.InvalidateResults"
215
216=== modified file 'tools/libertine-xmir'
217--- tools/libertine-xmir 2016-02-18 15:49:20 +0000
218+++ tools/libertine-xmir 2017-02-07 16:44:13 +0000
219@@ -1,5 +1,5 @@
220 #!/bin/sh
221-# Copyright (C) 2016 Canonical Ltd.
222+# Copyright (C) 2016-2017 Canonical Ltd.
223 # Author: Christopher Townsend <christopher.townsend@canonical.com>
224
225 # This program is free software: you can redistribute it and/or modify
226@@ -16,4 +16,4 @@
227
228
229 # Add and/or remove Xmir options here
230-exec Xmir -title @ $@
231+exec Xmir -rootless $@

Subscribers

People subscribed via source and target branches