Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand env vars passed to --env during run #1415

Open
TingPing opened this issue Feb 13, 2018 · 1 comment
Open

Expand env vars passed to --env during run #1415

TingPing opened this issue Feb 13, 2018 · 1 comment

Comments

@TingPing
Copy link
Member

TingPing commented Feb 13, 2018

Creating a wrapper script for something like this is a very common pattern: "export ATOM_HOME=\"$XDG_DATA_HOME\"" which can work acceptably for a single application but it becomes more of a problem setting something like: "export PYTHONUSERBASE=\"$XDG_DATA_HOME/python\"" which has to always be applied.

Ideally one could just set --env=PYTHONUSERBASE=$XDG_DATA_HOME/python so we can assure it is always correctly set for all commands. It would surely need to be limited to the few that flatpak sets itself but that would be fine.

matthiasclasen pushed a commit to matthiasclasen/flatpak that referenced this issue Jan 10, 2019
Support variable references in environemtn variables that
are set via --env, for example --env=PYTHONPATH=$XDG_DATA_HOME/python.
Only a fixed set of environment variables are currently expanded:

XDG_DATA_HOME
XDG_CONFIG_HOME
XDG_CACHE_HOME
PATH
HOME

The expansion happens during sandbox setup, ie. when flatpak run
is called. flatpak override will save the variable references
unexpanded.

Closes: flatpak#1415
matthiasclasen pushed a commit to matthiasclasen/flatpak that referenced this issue Jan 11, 2019
Support variable references in environemtn variables that
are set via --env, for example --env=PYTHONPATH=$XDG_DATA_HOME/python.
Only a fixed set of environment variables are currently expanded:

FLATPAK_ID
HOME
LD_LIBRARY_PATH
PATH
XDG_CACHE_HOME
XDG_CONFIG_HOME
XDG_DATA_HOME

The expansion happens during sandbox setup, ie. when flatpak run
is called. flatpak override will save the variable references
unexpanded.

Closes: flatpak#1415
matthiasclasen pushed a commit to matthiasclasen/flatpak that referenced this issue Jan 12, 2019
Support variable references in environemtn variables that
are set via --env, for example --env=PYTHONPATH=$XDG_DATA_HOME/python.
Only a fixed set of environment variables are currently expanded:

FLATPAK_ID
HOME
LD_LIBRARY_PATH
PATH
XDG_CACHE_HOME
XDG_CONFIG_HOME
XDG_DATA_HOME

The expansion happens during sandbox setup, ie. when flatpak run
is called. flatpak override will save the variable references
unexpanded.

Closes: flatpak#1415
@jmaibaum
Copy link

jmaibaum commented Jan 8, 2023

Hi, is this still being considered to be eventually implemented? The linked PR #2555 was closed almost 4 years ago without a very clear explanation why it was not merged.

Making sure an env var is being expanded to a path relative to XDG_CONFIG_HOME is easy if the app has only one launcher. But if there are 6 desktop files (for different related sub-applications, like with org.kicad.KiCad), creating wrapper scripts for all of them (and editing all the desktop files), becomes rather tedious, and error prone.

Being able to just pass --env=ODBCSYSINI=${XDG_CONFIG_HOME}/unixodbc via finish-args would have saved me multiple days of tinkering already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants