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
=== modified file 'debian/control'
--- debian/control 2017-01-31 20:14:44 +0000
+++ debian/control 2017-02-07 16:44:13 +0000
@@ -103,7 +103,6 @@
103 libqt5core5a,103 libqt5core5a,
104 libqt5gui5,104 libqt5gui5,
105 libqt5widgets5,105 libqt5widgets5,
106 matchbox-window-manager,
107 xmir [amd64 armhf arm64 i386],106 xmir [amd64 armhf arm64 i386],
108 ${misc:Depends},107 ${misc:Depends},
109 ${python3:Depends},108 ${python3:Depends},
110109
=== modified file 'python/libertine/ChrootContainer.py'
--- python/libertine/ChrootContainer.py 2017-01-24 18:00:57 +0000
+++ python/libertine/ChrootContainer.py 2017-02-07 16:44:13 +0000
@@ -49,7 +49,6 @@
4949
50 def __init__(self, container_id, config):50 def __init__(self, container_id, config):
51 super().__init__(container_id, 'chroot', config)51 super().__init__(container_id, 'chroot', config)
52 self._window_manager = None
53 # FIXME: Disabling seccomp is a temporary measure until we fully understand why we need52 # FIXME: Disabling seccomp is a temporary measure until we fully understand why we need
54 # it or figure out when we need it.53 # it or figure out when we need it.
55 os.environ['PROOT_NO_SECCOMP'] = '1'54 os.environ['PROOT_NO_SECCOMP'] = '1'
@@ -226,15 +225,10 @@
226 proot_cmd = self._build_proot_command()225 proot_cmd = self._build_proot_command()
227226
228 args = shlex.split(proot_cmd)227 args = shlex.split(proot_cmd)
229 args.extend(self.setup_window_manager(enable_toolbars=True))
230 self._window_manager = psutil.Popen(args, env=environ)
231
232 args = shlex.split(proot_cmd)
233 args.extend(app_exec_line)228 args.extend(app_exec_line)
234 return psutil.Popen(args, env=environ)229 return psutil.Popen(args, env=environ)
235230
236 def finish_application(self, app):231 def finish_application(self, app):
237 utils.terminate_window_manager(self._window_manager)
238 app.wait()232 app.wait()
239233
240 def _run_ldconfig(self):234 def _run_ldconfig(self):
241235
=== modified file 'python/libertine/Libertine.py'
--- python/libertine/Libertine.py 2017-02-07 15:17:30 +0000
+++ python/libertine/Libertine.py 2017-02-07 16:44:13 +0000
@@ -86,8 +86,7 @@
86 self.root_path = utils.get_libertine_container_rootfs_path(self.container_id)86 self.root_path = utils.get_libertine_container_rootfs_path(self.container_id)
87 self.locale = self._config.get_container_locale(container_id)87 self.locale = self._config.get_container_locale(container_id)
88 self.language = self._get_language_from_locale()88 self.language = self._get_language_from_locale()
89 self.default_packages = ['matchbox-window-manager',89 self.default_packages = ['libnss-extrausers',
90 'libnss-extrausers',
91 'humanity-icon-theme',90 'humanity-icon-theme',
92 'maliit-inputcontext-gtk2',91 'maliit-inputcontext-gtk2',
93 'maliit-inputcontext-gtk3',92 'maliit-inputcontext-gtk3',
@@ -122,16 +121,6 @@
122 utils.get_logger().error("%s" % e)121 utils.get_logger().error("%s" % e)
123 return False122 return False
124123
125 def setup_window_manager(self, enable_toolbars=False):
126 if self._binary_exists('matchbox-window-manager'):
127 if enable_toolbars:
128 return ['matchbox-window-manager']
129
130 return ['matchbox-window-manager', '-use_titlebar', 'no']
131 else:
132 return ['compiz']
133
134
135 def check_language_support(self):124 def check_language_support(self):
136 if not self._binary_exists('check-language-support'):125 if not self._binary_exists('check-language-support'):
137 self.install_package('language-selector-common', update_cache=False)126 self.install_package('language-selector-common', update_cache=False)
138127
=== modified file 'python/libertine/LxcContainer.py'
--- python/libertine/LxcContainer.py 2017-02-06 16:01:22 +0000
+++ python/libertine/LxcContainer.py 2017-02-07 16:44:13 +0000
@@ -164,7 +164,6 @@
164 super().__init__(container_id, 'lxc', config)164 super().__init__(container_id, 'lxc', config)
165 self.container = lxc_container(container_id)165 self.container = lxc_container(container_id)
166 self.lxc_manager_interface = None166 self.lxc_manager_interface = None
167 self.window_manager = None
168 self.host_info = HostInfo.HostInfo()167 self.host_info = HostInfo.HostInfo()
169 self._freeze_on_stop = config.get_freeze_on_stop(self.container_id)168 self._freeze_on_stop = config.get_freeze_on_stop(self.container_id)
170169
@@ -414,9 +413,6 @@
414 self.lxc_manager_interface.container_stopped(self.container_id)413 self.lxc_manager_interface.container_stopped(self.container_id)
415 return414 return
416415
417 self.window_manager = self.container.attach(lxc.attach_run_command,
418 self.setup_window_manager())
419
420 app_launch_cmd = "sudo -E -u " + os.environ['USER'] + " env PATH=" + os.environ['PATH']416 app_launch_cmd = "sudo -E -u " + os.environ['USER'] + " env PATH=" + os.environ['PATH']
421 cmd = shlex.split(app_launch_cmd)417 cmd = shlex.split(app_launch_cmd)
422 app = self.container.attach(lxc.attach_run_command,418 app = self.container.attach(lxc.attach_run_command,
@@ -426,6 +422,4 @@
426 def finish_application(self, app):422 def finish_application(self, app):
427 os.waitpid(app.pid, 0)423 os.waitpid(app.pid, 0)
428424
429 utils.terminate_window_manager(psutil.Process(self.window_manager))
430
431 self.stop_container()425 self.stop_container()
432426
=== modified file 'python/libertine/LxdContainer.py'
--- python/libertine/LxdContainer.py 2017-02-07 14:17:30 +0000
+++ python/libertine/LxdContainer.py 2017-02-07 16:44:13 +0000
@@ -295,7 +295,6 @@
295 super().__init__(name, 'lxd', config)295 super().__init__(name, 'lxd', config)
296 self._host_info = HostInfo.HostInfo()296 self._host_info = HostInfo.HostInfo()
297 self._container = None297 self._container = None
298 self._matchbox_pid = None
299 self._manager = None298 self._manager = None
300 self._freeze_on_stop = config.get_freeze_on_stop(self.container_id)299 self._freeze_on_stop = config.get_freeze_on_stop(self.container_id)
301300
@@ -303,7 +302,6 @@
303 raise Exception("Failed to setup lxd.")302 raise Exception("Failed to setup lxd.")
304303
305 self._client = pylxd.Client()304 self._client = pylxd.Client()
306 self._window_manager = None
307305
308 try:306 try:
309 if utils.set_session_dbus_env_var():307 if utils.set_session_dbus_env_var():
@@ -476,30 +474,6 @@
476 self._freeze_on_stop = orig_freeze474 self._freeze_on_stop = orig_freeze
477 return self.stop_container(wait=True)475 return self.stop_container(wait=True)
478 476
479 def _get_matchbox_pids(self):
480 p = subprocess.Popen(self._lxc_args('pgrep matchbox'), stdout=subprocess.PIPE)
481 out, err = p.communicate()
482 return out.decode('utf-8').split('\n')
483
484 # FIXME: Remove once window management logic has been moved to the host
485 def _start_window_manager(self, args):
486 args.extend(self.setup_window_manager())
487
488 if 'matchbox-window-manager' in args:
489 pids = self._get_matchbox_pids()
490
491 self._window_manager = psutil.Popen(args)
492
493 time.sleep(.25) # Give matchbox a moment to start in the container
494 if self._window_manager.poll() is not None:
495 utils.get_logger().warning("Window manager terminated prematurely with exit code '{}'".format(
496 self._window_manager.returncode))
497 self._window_manager = None
498 elif 'matchbox-window-manager' in args:
499 after_pids = self._get_matchbox_pids()
500 if len(after_pids) > len(pids):
501 self._matchbox_pid = (set(after_pids) - set(pids)).pop()
502
503 def start_application(self, app_exec_line, environ):477 def start_application(self, app_exec_line, environ):
504 if not self._try_get_container():478 if not self._try_get_container():
505 utils.get_logger().error("Could not get container '{}'".format(self.container_id))479 utils.get_logger().error("Could not get container '{}'".format(self.container_id))
@@ -513,23 +487,10 @@
513487
514 args = self._lxc_args("sudo -E -u {} env PATH={}".format(environ['USER'], environ['PATH']), environ)488 args = self._lxc_args("sudo -E -u {} env PATH={}".format(environ['USER'], environ['PATH']), environ)
515489
516 self._start_window_manager(args.copy())
517
518 args.extend(app_exec_line)490 args.extend(app_exec_line)
519 return psutil.Popen(args)491 return psutil.Popen(args)
520492
521 def finish_application(self, app):493 def finish_application(self, app):
522 if self._window_manager is not None:
523 utils.terminate_window_manager(self._window_manager)
524 self._window_manager = None
525
526 # This is a workaround for an issue on xenial where the process
527 # running the window manager is not killed with the application
528 if self._matchbox_pid is not None:
529 utils.get_logger().debug("Manually killing matchbox-window-manager")
530 self.run_in_container("kill -9 {}".format(self._matchbox_pid))
531 self._matchbox_pid = None
532
533 app.wait()494 app.wait()
534495
535 self.stop_container()496 self.stop_container()
536497
=== modified file 'python/libertine/launcher/config.py'
--- python/libertine/launcher/config.py 2016-12-05 18:33:47 +0000
+++ python/libertine/launcher/config.py 2017-02-07 16:44:13 +0000
@@ -1,4 +1,4 @@
1# Copyright 2016 Canonical Ltd.1# Copyright 2016-2017 Canonical Ltd.
2#2#
3# This program is free software: you can redistribute it and/or modify it3# This program is free software: you can redistribute it and/or modify it
4# under the terms of the GNU General Public License version 3, as published4# under the terms of the GNU General Public License version 3, as published
@@ -215,9 +215,6 @@
215 tasks = []215 tasks = []
216 tasks.append(TaskConfig(TaskType.LAUNCH_SERVICE, ["pasted"]))216 tasks.append(TaskConfig(TaskType.LAUNCH_SERVICE, ["pasted"]))
217217
218 if self.container_id is None:
219 tasks.append(TaskConfig(TaskType.LAUNCH_SERVICE, ['matchbox-window-manager', '-use_titlebar', 'no']))
220
221 return tasks218 return tasks
222219
223 def _create_socket_bridges(self):220 def _create_socket_bridges(self):
224221
=== modified file 'python/libertine/utils.py'
--- python/libertine/utils.py 2017-02-06 09:37:41 +0000
+++ python/libertine/utils.py 2017-02-07 16:44:13 +0000
@@ -145,15 +145,6 @@
145 return os.path.join(get_libertine_runtime_dir(), 'pulse_socket')145 return os.path.join(get_libertine_runtime_dir(), 'pulse_socket')
146146
147147
148def terminate_window_manager(window_manager):
149 for child in window_manager.children():
150 child.terminate()
151 child.wait()
152
153 window_manager.terminate()
154 window_manager.wait()
155
156
157def refresh_libertine_scope():148def refresh_libertine_scope():
158 scopes_object_path = "/com/canonical/unity/scopes"149 scopes_object_path = "/com/canonical/unity/scopes"
159 invalidate_signal = "com.canonical.unity.scopes.InvalidateResults"150 invalidate_signal = "com.canonical.unity.scopes.InvalidateResults"
160151
=== modified file 'tools/libertine-xmir'
--- tools/libertine-xmir 2016-02-18 15:49:20 +0000
+++ tools/libertine-xmir 2017-02-07 16:44:13 +0000
@@ -1,5 +1,5 @@
1#!/bin/sh1#!/bin/sh
2# Copyright (C) 2016 Canonical Ltd.2# Copyright (C) 2016-2017 Canonical Ltd.
3# Author: Christopher Townsend <christopher.townsend@canonical.com>3# Author: Christopher Townsend <christopher.townsend@canonical.com>
44
5# This program is free software: you can redistribute it and/or modify5# This program is free software: you can redistribute it and/or modify
@@ -16,4 +16,4 @@
1616
1717
18# Add and/or remove Xmir options here18# Add and/or remove Xmir options here
19exec Xmir -title @ $@19exec Xmir -rootless $@

Subscribers

People subscribed via source and target branches