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 788207 - GApplication: add env variable to override app ID
GApplication: add env variable to override app ID
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gapplication
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-09-26 19:21 UTC by Marco Trevisan (Treviño)
Modified: 2018-05-24 19:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GApplication: add env variable to override app ID (2.68 KB, patch)
2017-09-26 19:23 UTC, Marco Trevisan (Treviño)
rejected Details | Review

Description Marco Trevisan (Treviño) 2017-09-26 19:21:23 UTC
Sandboxed apps in snaps or flatpaks might want to have
different app IDs to allow the installation of multiple versions
of the same app, thus having an unique APP-id which is different
from the one that the publisher did.

So introducing:
 G_APPLICATION_FORCE_OVERRIDE_APP_ID

Which allows to force the app id overriding, no matter
if it has been allowed via flags or not.

Resources path should not be changed unless it's not previously
set.

Command line argument has precedence anyway in case is
set and allowed.
Comment 1 Marco Trevisan (Treviño) 2017-09-26 19:23:14 UTC
Created attachment 360482 [details] [review]
GApplication: add env variable to override app ID

Sandboxed apps like the ones in snap packages might want to have
different app IDs to allow the installation of multiple versions
of the same app, thus having an unique APP-id which is different
from the one that the publisher did.

So introducing:
 G_APPLICATION_FORCE_OVERRIDE_APP_ID

Which allows to force the app id overriding, no matter
if it has been allowed via flags or not.

Resources path should not be changed unless it's not previously
set.

Command line argument has precedence anyway in case is
set and allowed.
Comment 2 Marco Trevisan (Treviño) 2017-09-26 19:35:20 UTC
In this patch I'm using the variable to set the ID itself, an alternative would be to also to use this to bypass the G_APPLICATION_CAN_OVERRIDE_APP_ID check, and then using the command-line again, but I personally prefer this approach.

Anyway, I'm not entirely happy with this too, but not sure we can design another cleaner designed way to get this, but this was the best effort move.
Comment 3 Matthias Clasen 2017-09-26 20:02:55 UTC
I'm against this. We should not introduce more random environment variables. Even if they seem to be a convenient solution at first, they always cause problems in the end, by leaking along the process tree.
Comment 4 Philip Withnall 2017-09-27 09:22:39 UTC
I completely agree with Matthias: this seems like a hacky solution to a problem, and it’s only going to cause problems in future.
Comment 5 Philip Withnall 2017-10-02 14:22:25 UTC
Review of attachment 360482 [details] [review]:

Rejecting accordingly.
Comment 6 GNOME Infrastructure Team 2018-05-24 19:48:29 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1289.