GNOME Bugzilla – Bug 788207
GApplication: add env variable to override app ID
Last modified: 2018-05-24 19:48:29 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.
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.
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.
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.
I completely agree with Matthias: this seems like a hacky solution to a problem, and it’s only going to cause problems in future.
Review of attachment 360482 [details] [review]: Rejecting accordingly.
-- 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.