Closed rc-zb closed 6 months ago
@rc-zb maybe do you need to follow https://github.com/flathub/com.vscodium.codium?tab=readme-ov-file#wayland-vs-x11 also run the permission-reset
command?
Confirming the same issue after upgrading from Fedora Kinoite 39 to 40 (and therefore to KDE 6.0), even after resetting permissions:
max@fedora /v/h/max> flatpak permission-reset com.vscodium.codium
max@fedora /v/h/max> flatpak run com.vscodium.codium
codium-wrapper: Setting up NPM packages
codium-wrapper: Setting up Cargo packages
codium-wrapper: Setting up Python packages
codium-wrapper: Setting up Ruby packages
[2 zypak-helper] Wait found events, but sd-event found none
Warning: 'ozone-platform' is not in the list of known options, but still passed to Electron/Chromium.
just bumps me back to my shell.
This is under Wayland, so I'm not sure the Wayland vs X11 FAQ (which gives instructions for running on X11) applies.
Confirming also that adding --ozone-platform=wayland --enable-wayland-ime
enables VSCodium to start without issue.
I'm having the same issue on Fedora 40 KDE spin (Wayland), even after trying to reset the permissions:
matteo@fedora:~$ flatpak permission-reset com.vscodium.codium
matteo@fedora:~$ flatpak run com.vscodium.codium
codium-wrapper: Setting up NPM packages
codium-wrapper: Setting up Cargo packages
codium-wrapper: Setting up Python packages
codium-wrapper: Setting up Ruby packages
Warning: 'ozone-platform' is not in the list of known options, but still passed to Electron/Chromium.
I confirm, too, that using the options --ozone-platform=wayland --enable-wayland-ime
the program start normally.
Hi @maxkapur and @matteopaolucci, maybe the update on your flatpak setup is not changed to the new defaults, can you run
flatpak override --user --nosocket=x11 --socket=wayland com.vscodium.codium
and then try to run
flatpak run com.vscodium.codium --verbose 2>&1 | grep -i wayland
Hello @noonsleeper,
On KDE Plasma 6 with Wayland, I have the same issue (crash on startup).
I ran both commands, one after the other. Unfortunately, the crash still persists.
There is no interesting output from what I can tell, using the second command. However, removing the grep
part produces this output:
codium-wrapper: Setting up NPM packages
codium-wrapper: Setting up Cargo packages
codium-wrapper: Setting up Python packages
codium-wrapper: Setting up Ruby packages
Warning: 'ozone-platform' is not in the list of known options, but still passed to Electron/Chromium.
[19 zypak-helper] Using spawn strategy test 1 as set by environment
[19:0502/114129.508763:ERROR:ozone_platform_x11.cc(240)] Missing X server or $DISPLAY
[19:0502/114129.508785:ERROR:env.cc(255)] The platform failed to initialize. Exiting.
That said, I'd like to mention that the app launched successfully using this command (both before and after running the flatpak override
command):
flatpak run com.vscodium.codium --ozone-platform=wayland
@RaduAvramescu, you are right about command output is not being redirected to stdout. (I fixed that) Your log says that something is forcing codium to start on X11 instead of Wayland then try to disable at all X11 (for reference https://github.com/noonsleeper/ide-flatpak-wrapper/blob/3c0635635e4d056a6d18d79c10f66db67de98a93/editor.sh#L10 this is the function that handle the selection between wayland or X11
flatpak override --user --socket=wayland --nosocket=x11 --nosocket=fallback-x11 com.vscodium.codium \
&& flatpak run com.vscodium.codium --verbose
Also you can check if the environment variables are spawning inside of the container
flatpak run --command=bash com.vscodium.codium
then
echo "${XDG_SESSION_TYPE}"
echo "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}"
@noonsleeper No go either, I still have the same errors even with those commands.
To be clear, the output of echo $XDG_SESSION_TYPE
is:
wayland
And the output of echo $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY
:
/run/user/1000/wayland-0
I assume these are as they should be.
@noonsleeper Sorry, what I posted above was in response to what you wrote prior to your edit.
In the container, here are the values:
echo $XDG_SESSION_TYPE
: wayland
echo $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY
: /run/user/1000//run/flatpak/wayland-0
I will test if replacing --ozone-platform-hint=auto
(that is the recommendation for electron apps) with --ozone-platform=wayland
I'll hope doesn't break things on another DE.
@RaduAvramescu thanks for debugging and logs.
@noonsleeper Perhaps --ozone-platform-hint=auto
isn't being passed? When running with the --ozone-platform=wayland
argument, I get this output:
Option 'ozone-platform' is defined more than once. Using value 'wayland'.
But, when I run flatpak run com.vscodium.codium --ozone-platform-hint=auto
, I do not get a warning like the output above... So, it looks to me like when it in fact does the Wayland checks in https://github.com/noonsleeper/ide-flatpak-wrapper/blob/3c0635635e4d056a6d18d79c10f66db67de98a93/editor.sh#L10 it may hit the else
statement.
Perhaps the reason why --ozone-platform=wayland
as an argument works is because it's overriding the one set in the code (I'm assuming the argument from the terminal has higher priority). If you instead do what you said above, it may lead to the same issue...
This is just a theory and I have no idea if I'm even close to right, feel free to correct me if I'm wrong of course.
As an update, manually running flatpak run com.vscodium.codium --ozone-platform-hint=auto --enable-wayland-ime --enable-features=WaylandWindowDecorations
(which, from what I could tell, would be close-ish to the normal arguments), produces the same errors.
I'm assuming that despite doing this, the internal code is somehow setting --ozone-platform=x11
which is overriding the arguments I used above.
After digging a little bit into it, I think my suspicions were correct.
After running flatpak run com.vscodium.codium --verbose
the application refuses to start, as has happened so far.
Right after that, running coredumpctl info
produces, among other output, this line:
Command Line: $'/app/share/codium/codium --extensions-dir --ozone-platform=x11 --verbose /home/Radu/.var/app/com.vscodium.codium/data/codium/extensions'
It looks like --verbose
was successfully passed, but indeed --ozone-platform=x11
is present, which leads me to believe that the else
statement from https://github.com/noonsleeper/ide-flatpak-wrapper/blob/3c0635635e4d056a6d18d79c10f66db67de98a93/editor.sh#L10 was run instead of the Wayland one.
PS: Apologies for the comment spam, I thought it made more sense to do it this way rather than continuing to edit a single comment, as I discovered things after each comment and I'm not sure if a single big comment would be easier to read.
So basically, the test fails because $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY
doesn't exists.
From your debug: echo $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY: /run/user/1000//run/flatpak/wayland-0
XDG_RUNTIME_DIR
: /run/user/1000
$WAYLAND_DISPLAY
: /run/flatpak/wayland-0
Seems like a conflict...
From https://gaultier.github.io/blog/wayland_from_scratch.html, I found those steps to open the socket to wayland which can be replicated to detect it:
@noonsleeper What do you think?
@daiyam Yeah, that seems to be the case. For the record, here is additional information, from Hyprland (installed alongside KDE Plasma), where it works by default, but I just wanted to grab the values for comparison's sake:
echo $XDG_RUNTIME_DIR
output: /run/user/1000
echo $WAYLAND_DISPLAY
output: wayland-1
echo $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY
output: /run/user/1000/wayland-1
So, basically, it appears that the difference between KDE Plasma and Hyprland lies in the $WAYLAND_DISPLAY
environment variable.
If $WAYLAND_DISPLAY is set, attempt to connect to $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY
Otherwise, attempt to connect to $XDG_RUNTIME_DIR/wayland-0
Otherwise, fail
@daiyam Thanks for the link and the rational! I will add $XDG_RUNTIME_DIR/wayland-0 to the loop of checks =)
@RaduAvramescu, @matteopaolucci, @maxkapur, @rc-zb Can check this build?
flatpak install --user https://dl.flathub.org/build-repo/101976/com.vscodium.codium.flatpakref
It's only available for 24hs
Since I have confirmation that 2 KDE users that #331 fix the problem, I will merge this ASAP.
Thanks for the fix @noonsleeper!
Sorry, I couldn't help test because I don't have a KDE install anymore (though it's temporary).
Bug
As the title shows.
Reproduction
flatpak --user install com.vscodium.codium
flatpak --user run com.vscodium.codium --verbose
, or without--verbose
, or from the link in Application Dashboard.It fails.
Now with
--ozone-platform=wayland --enable-wayland-ime
instead, the program runs correctly.Log
During step 3:
Version
System Information