important environment variables are not inherited when using `--run`
Checklist
- [X] I agree to follow the Code of Conduct that this project adheres to.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.
flatpak-builder version
1.4.2
Flatpak version
1.14.6
How to reproduce
flatpak-builder --run app-build/ app.json env
Expected Behavior
environment variables such as WAYLAND_DISPLAY and XDG_SESSION_TYPE are not passed inside the sandbox, which makes most programs unable to run
Actual Behavior
files such as $XDG_RUNTIME_DIR/wayland-0 are still available inside the sandbox, but the environment is cleared, so apps don't know that wayland is actually available
Additional Information
https://docs.flatpak.org/en/latest/debugging.html:
You need to use the correct finish args
i have "--socket=wayland", in finish-args.
it works correctly if flatpak-builder --user --install && flatpak run. but flatpak-builder --run app fails because it doesn't have the needed variables
I think it's the best to just install the App and not use flatpak-builder --run. This feature is sadly broken. Portals sometimes don't work correct, but I don't knew that even Wayland was not working.
i read about it at https://docs.flatpak.org/en/latest/debugging.html
i want to use gdb, and --install doesn't install debug symbol files
It seems --run does not pass XDG_SESSION_TYPE variable. Passing it manually with --env fixed the issue and my app runs.