After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731705 - gio/tests/desktop-app-info assumes /bin/true
gio/tests/desktop-app-info assumes /bin/true
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
2.40.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-06-16 06:43 UTC by Daniel Macks
Modified: 2017-11-03 20:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't hardcode /bin/true (1.18 KB, patch)
2014-06-16 07:04 UTC, Daniel Macks
committed Details | Review

Description Daniel Macks 2014-06-16 06:43:28 UTC
6e0bbd8 (from Bug #711557) is a new/similar instance of previously-resolved Bug #698655 and/or Bug #651219 . On OS X, glib-2.40.0 fails self-test:

**
GLib-GIO:ERROR:desktop-app-info.c:535:assert_strings_equivalent: assertion failed (g_strv_length (expected_words) == g_strv_length (result_words)): (2 == 1)
ok 6 /desktop-app-info/actions
PASS: desktop-app-info 6 /desktop-app-info/actions
# Unable to find expected string 'epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb.desktop' in result 'eog.desktop'
../../tap-test: line 5: 60776 Abort trap: 6           $1 -k --tap
# GLib-GIO:ERROR:desktop-app-info.c:535:assert_strings_equivalent: assertion failed (g_strv_length (expected_words) == g_strv_length (result_words)): (2 == 1)
ERROR: desktop-app-info - missing test plan
ERROR: desktop-app-info - exited with status 134 (terminated by signal 6?)

The .desktop that it fails to find has:

Exec=/bin/true

but darwin has /usr/bin/true not /bin/true so g_desktop_app_info_load_from_keyfile skips.
Comment 1 Daniel Macks 2014-06-16 07:04:08 UTC
Created attachment 278513 [details] [review]
Don't hardcode /bin/true

Previously:

PASS: desktop-app-info 1 /desktop-app-info/delete
PASS: desktop-app-info 2 /desktop-app-info/default
PASS: desktop-app-info 3 /desktop-app-info/fallback
PASS: desktop-app-info 4 /desktop-app-info/lastused
PASS: desktop-app-info 5 /desktop-app-info/extra-getters
PASS: desktop-app-info 6 /desktop-app-info/actions
ERROR: desktop-app-info - missing test plan
ERROR: desktop-app-info - exited with status 134 (terminated by signal 6?)

Now: 
PASS: desktop-app-info 1 /desktop-app-info/delete
PASS: desktop-app-info 2 /desktop-app-info/default
PASS: desktop-app-info 3 /desktop-app-info/fallback
PASS: desktop-app-info 4 /desktop-app-info/lastused
PASS: desktop-app-info 5 /desktop-app-info/extra-getters
PASS: desktop-app-info 6 /desktop-app-info/actions
PASS: desktop-app-info 7 /desktop-app-info/search
Comment 2 Philip Withnall 2017-11-03 20:08:12 UTC
Review of attachment 278513 [details] [review]:

Yup, that looks good to me. The standard allows programs to be specified by full path or by program name only (to be looked up in $PATH): https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html.

Thanks for the patch, and sorry for the delay in reviewing it.