"Unable to find keyfile for application": clicks installed in current session don't create UAL cache, and UAL does not look for .desktop files in click pkgdir
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
click (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
ubuntu-app-launch (Ubuntu) |
Invalid
|
High
|
Unassigned |
Bug Description
For testing/autopkgtest I want/need to run click apps and their tests in a schroot or container, as the turnaround with real phones and the emulator is way too large. But in a container, ubuntu-app-launch fails with
$ ubuntu-app-launch `ubuntu-app-triplet com.ubuntu.
** (process:766): WARNING **: Unable to find keyfile for application 'com.ubuntu.
init: application-legacy (com.ubuntu.
In strace I see that it looks for the .desktop file in the following locations:
/home/
/home/
/usr/
/usr/
but not in the click dir:
$ click pkgdir com.ubuntu.
/opt/click.
The workaround is to create the symlink manually, then it works:
$ ln -s `click pkgdir com.ubuntu.
$ ubuntu-app-launch `ubuntu-app-triplet com.ubuntu.
But that's certainly not something that autopkgtest should do.
Reproducer:
1. Create a suitable container: recommends click ubuntu-sdk-libs ubuntu- app-launch{ ,-tools} dbus-x11 xvfb bzr ca-certificates wget
sudo lxc-create -n click -t ubuntu -- -r utopic
sudo lxc-start -n click
# log in as ubuntu/ubuntu, then run
sudo apt-get install -y --no-install-
sudo poweroff
2. Start ephemeral container (so that you can run this test multiple times):
sudo lxc-start-ephemeral -o click
# log in as ubuntu/ubuntu
3. Get the current calculator .click package. I just built it myself, and as it's difficult to get the official ones, I put it on people: people. canonical. com/~pitti/ tmp/com. ubuntu. calculator_ 1.3.283_ all.click
wget http://
4. Start X server /dev/null
Xvfb :5 -screen 0 1024x768x24 >/dev/null 2>&1 &
export DISPLAY=:5
export XAUTHORITY=
5. Start upstart session: DIR=/tmp/ r upstart/ sessions/ $!.session BUS_ADDRESS= `/sbin/ initctl get-env DBUS_SESSION_ BUS_ADDRESS`
mkdir /tmp/r
export XDG_RUNTIME_
# some tests fail with German locale
export LANG=en_US.UTF-8
/sbin/init --user &
sleep 1
. /tmp/r/
export UPSTART_SESSION
export DBUS_SESSION_
6. Install click package: parser calculator_ *.click
# avoid tripping over AppArmor restrictions in container in click hook
sudo rm /sbin/apparmor_
sudo click install --all-users com.ubuntu.
7. Try to launch click app: calculator`
ubuntu-app-launch `ubuntu-app-triplet com.ubuntu.
This reproduces the error.
If I install the click package *before* launching upstart's user session, it *does* work. I. e. run step 6 before step 5, then upstart-app-launch (or something else) creates
lrwxrwxrwx 1 ubuntu ubuntu 102 Jun 23 13:44 .cache/ ubuntu- app-launch/ desktop/ com.ubuntu. calculator_ calculator_ 1.3.283. desktop -> /opt/click. ubuntu. com/.click/ users/@ all/com. ubuntu. calculator/ com.ubuntu. calculator_ calculator. desktop
So it seems this only affects click apps which get installed in an already running session.