Merge lp://staging/~ted/ubuntu-app-launch/ld-library-path into lp://staging/ubuntu-app-launch/14.04

Proposed by Ted Gould
Status: Merged
Approved by: Charles Kerr
Approved revision: 149
Merged at revision: 148
Proposed branch: lp://staging/~ted/ubuntu-app-launch/ld-library-path
Merge into: lp://staging/ubuntu-app-launch/14.04
Diff against target: 218 lines (+80/-0)
8 files modified
exec-line-exec.c (+22/-0)
tests/exec-test-archcolon.sh (+5/-0)
tests/exec-test-colon.sh (+5/-0)
tests/exec-test-full.sh (+5/-0)
tests/exec-test-noarch.sh (+5/-0)
tests/exec-test-noinit.sh (+5/-0)
tests/exec-test-nullstr.sh (+18/-0)
tests/exec-test.sh.in (+15/-0)
To merge this branch: bzr merge lp://staging/~ted/ubuntu-app-launch/ld-library-path
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
Jamie Strandboge Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+217832@code.staging.launchpad.net

Commit message

Set LD_LIBRARY_PATH to include the application directory

Description of the change

Setting the LD_LIBARAY_PATH to include the application directory including the architecture specific one if that's appropriate.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
147. By Ted Gould

Gotta change the .in file too

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
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
Revision history for this message
Ted Gould (ted) wrote :

On Thu, 2014-05-01 at 13:54 +0000, Jamie Strandboge wrote:

> 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:

Makes sense. Fixed in r148. Test in r149.

148. By Ted Gould

Detect empty strings in environment variables

149. By Ted Gould

Test to ensure we handle null strings

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jamie Strandboge (jdstrand) :
review: Approve
Revision history for this message
Charles Kerr (charlesk) wrote :

Approving by proxy for Jamie since he's not in the indicator-applet-devel group.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches