Code review comment for lp:~ted/ubuntu-app-launch/ld-library-path

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I tested this with my package in http://bazaar.launchpad.net/~jdstrand/+junk/test-click-env/files (on desktop):

$ sudo click install --user=$USER com.ubuntu.developer.jdstrand.click-env_0.1_all.click

Test with path unset:
$ initctl unset-env -g LD_LIBRARY_PATH
$ initctl list-env|grep LD_LIBRARY_PATH
$ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep LD_LIBRARY_PATH ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1
application stop/waiting
LD_LIBRARY_PATH=/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib
(good)

Test with path set:
$ initctl set-env -g LD_LIBRARY_PATH=/foo:/
$ initctl list-env|grep LD_LIBRARY_PATH
LD_LIBRARY_PATH=/foo:/
$ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep LD_LIBRARY_PATH ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1
application stop/waiting
LD_LIBRARY_PATH=/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib:/foo:/
(good)

Test with path set, but empty:
$ initctl set-env -g LD_LIBRARY_PATH=
$ initctl list-env|grep LD_LIBRARY_PATHLD_LIBRARY_PATH=
$ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep LD_LIBRARY_PATH ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1
application stop/waiting
LD_LIBRARY_PATH=/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib:

When LD_LIBRARY_PATH is set but empty, upstart-app-launch leaves a trailing ':'. I think we should treat empty the same as unset.

Note, the same thing affects QML2_IMPORT_PATH and PATH:
$ initctl set-env -g QML2_IMPORT_PATH=
$ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep QML2_IMPORT_PATH ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1
application stop/waiting
QML2_IMPORT_PATH=:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu
(notice ':' is prepended)

$ initctl set-env -g PATH=
$ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep '^PATH=' ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1
application stop/waiting
PATH=/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu/bin:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env:
(notice ':' is appended)

review: Needs Fixing

« Back to merge proposal