Closed evils closed 3 years ago
@colemickens on IRC had some inconclusive notes
That is basically what that package is doing.
On Fri, May 15, 2020, 5:46 PM evils notifications@github.com wrote:
@colemickens https://github.com/colemickens on IRC mentioned pkgs.firefox + the env var MOZ_USE_WAYLAND should be the only wayland specific stuff applied to firefox https://logs.nix.samueldr.com/nixos/2020-05-15#3463749
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NixOS/nixpkgs/issues/87895#issuecomment-629327737, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE365DX64QIHLTSHZZ74RTRRVPVPANCNFSM4NBVIYZQ .
@andir are you sure about that? i'm finding neither MOZ_ENABLE_WAYLAND
or MOZ_DBUS_REMOTE
in pkgs/application/networking/browsers/firefox
neither do i see it in the generated firefox.desktop
file or the wrapper that is $out/bin/firefox
https://github.com/NixOS/nixpkgs/blob/99efa7c85c8835127c1c65d69665f74f5aaf1a03/pkgs/applications/networking/browsers/firefox/wrapper.nix#L127-L129 Is equivalent to setting MOZ_ENABLE_WAYLAND and predates it. We still can't use the one you mentioned in the wrapper as the esr version we ship doesn't support that yet. Would love to know why @colemickens thinks the GDK backend selection is wrong and we should not do it. Last time I read the firefox source it was equivalent.
Source, a sort of nebulous knowledge from having attentively watched and dogfooded this space for 18+ months, and https://github.com/swaywm/sway/wiki/Running-programs-natively-under-wayland. (It's a bit of a meme almost that GDK_BACKEND
should not be manually set. It has more to do with what other apps are affected, and it does matter for the wrapper because firefox does launch other things)
From a quick look: (I want to look more later but I keep getting distracted)
GDK_BACKEND
should not be setMOZ_ENABLE_WAYLAND
should be setIMO people are better off not using firefox-wayland
and setting MOZ_ENABLE_WAYLAND
for their session. I was actually a bit taken aback to realize people are still having all of these issues. Simply using firefox
or latest.firefox-nightly-bin
and MOZ_ENABLE_WAYLAND=1
has been working well for me for sometime, with none of the sessions issues that seem to be reported with firefox-wayland
, or the same issues from users that report setting GDK_BACKEND
(both in and out of nixpkgs).
with a firefox session started like this:
nix-shell '<nixpkgs>' -p firefox --pure --command 'env MOZ_ENABLE_WAYLAND=1 firefox'
the following works from my usual environment
xdg-open https://nixos.org
with the same package started from my usual environment plus that variable, that fails
Source, a sort of nebulous knowledge from having attentively watched and dogfooded this space for 18+ months, and https://github.com/swaywm/sway/wiki/Running-programs-natively-under-wayland. (It's a bit of a meme almost that
GDK_BACKEND
should not be manually set. It has more to do with what other apps are affected, and it does matter for the wrapper because firefox does launch other things) Interesting how things change over time. I still remember that it was proposed to set that for the entire wayland session... I never had issues with it tho..From a quick look: (I want to look more later but I keep getting distracted)
* `GDK_BACKEND` should not be set * `MOZ_ENABLE_WAYLAND` should be set * we should look at if libglvnd is actually needed, and if so, if it's specific to the Wayland build
The wrapper has grown to some monster that it shouldn't be.. There is so much stuff in there that probably only a few people use and some features that aren't even working anymore.
IMO people are better off not using
firefox-wayland
and settingMOZ_ENABLE_WAYLAND
for their session. I was actually a bit taken aback to realize people are still having all of these issues.
Then we just have to flip the variable in the wrapper? I still believe we want a wayland compatible version so users do not have to think about adding that to their environment and can just pick that package instead.
Simply using
firefox
orlatest.firefox-nightly-bin
andMOZ_ENABLE_WAYLAND=1
has been working well for me for sometime, with none of the sessions issues that seem to be reported withfirefox-wayland
, or the same issues from users that report settingGDK_BACKEND
(both in and out of nixpkgs).
This was the first time I heard of that issue. I guess GH not pining maintainers (and users not really being able to tag packages) doesn't help with that either.
with the same package started from my usual environment plus that variable, that fails
What does fail mean in this case? I have no xdg-open on my machine and firefox doesn't have access to access anything but it's profile.
What does fail mean in this case?
it produces the popup shown in the original bug report comment at the top here
with a firefox session started like this:
nix-shell '<nixpkgs>' -p firefox --pure --command 'env MOZ_ENABLE_WAYLAND=1 firefox'
oh joy, no audio
with a firefox session started like this:
nix-shell '<nixpkgs>' -p firefox --pure --command 'env MOZ_ENABLE_WAYLAND=1 firefox'
by the fact i'm getting https://github.com/swaywm/wlroots/issues/1595 i'm fairly sure this resulted in an X11 firefox session
edit as to not pile on notifications:
nix-shell '<nixpkgs>' -p firefox-wayland --pure --command 'firefox'
yields
(firefox:3489): Gtk-WARNING **: 21:31:59.004: cannot open display: :1
@andir Yes, I do agree with everything you said. I think I was/am getting a bit lost on this one and what the exact cause of issue is.
@evils if you're ever confused, pkill Xwayland
is a good way to quickly check to see what exactly is running on X.
This bug is still an issue with firefox-wayland
on 20.03, even if I update the wrapper to set MOZ_ENABLE_WAYLAND=1
instead. Setting MOZ_DBUS_REMOTE=1
also does not change that.
I know this use to work, before updating to the latest stable (e.g. under 19.09 or 20.03pre), but I have not figured out what the underlying issue actually is.
And libglvnd
is needed to have GL support in Firefox (see your about:support
page for details).
I tried to triage the issues with pure nix-shell
environments as suggest, but all attempts failed so far, as I was not able to get firefox-wayland
to run in wayland mode at all from inside a pure shell.
i'm still getting this with firefox-wayland version 81 running on sway 1.5
I literally have never ever seen this message, even when using Nightly. I don't know how else to help.
On Thu, Sep 24, 2020, 12:05 evils notifications@github.com wrote:
i'm still getting this with firefox-wayland version 81 running on sway 1.5
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NixOS/nixpkgs/issues/87895#issuecomment-698531827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACP25F6XKTOOLTBVZVCUNTSHOJ73ANCNFSM4NBVIYZQ .
@colemickens: Maybe you could be so kind and post a minimal config you are using or at least show us what environment variables you use to get it working. It would also be important to know if you use firefox
or firefox-wayland
.
fwiw, in an attempt to recreate my issue, i made a minimal setup that doesn't have this issue
build with nix-build nixos --arg configuration ./configuration.nix -A vmWithBootLoader
in a local checkout of nixos-unstable
running xdg-open https://nixos.org
twice results in 2 open tabs in firefox
i haven't been able to log in when building the vm based on my actual config (password incorrect, even if i reuse the above user config verbatim)
The first comment in https://github.com/NixOS/nixpkgs/pull/84233 should include everything relevant to my firefox setup, though most of that is only required for the pipewire functionality.
I use pkgs.firefox
with MOZ_ENABLE_WAYLAND=1
and that's about it.
@evils you don't disable Xwayland, by chance, do you?
i don't think i'm disabling Xwayland,
i've got vlc
running, and other Xwayland stuff
maybe relevant, i've got firefox installed via nix-env
@evils: There are various ways nix-env
might cause you to run an outdated or modified version of Firefox, especially if you do not update your nix-env
with every channel/flake update.
On my end, after updating to 20.09, the issue is gone again, so as far as I am concerned this can be closed as fixed.
this issue is gone for me early october i tried installing firefox-wayland via systemPackages in configuration.nix but that didn't help since then i've switched from i think firefox-wayland 82.0.0 installed via nix-env to 83 installed via systemPackages from nixos-unstable (and had a long overdue reboot) and it now works for me as well i'm not immediately seeing an obvious change to the package to explain this though...
I was having a related issue, where links clicked in vscodium were causing the same issue. After some pain here was my solution in the end in case it helps anyone:
home.nix
(see home-manager)let
myFirefox = (firefox.overrideAttrs (_: { desktopItem =
makeDesktopItem {
name = "firefox";
exec = "env MOZ_ENABLE_WAYLAND=1 MOZ_DBUS_REMOTE=1 firefox %u";
icon = "firefox";
comment = "";
desktopName = "Firefox";
genericName = "Web Browser";
categories = "Network;WebBrowser;";
mimeType = lib.concatStringsSep ";" [
"text/html"
"text/xml"
"application/xhtml+xml"
"application/vnd.mozilla.xul+xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
"x-scheme-handler/ftp"
];
};
}));
in
{
home.packages = with pkgs; [
myFirefox
];
xdg.mimeApps.enable = true;
xdg.mimeApps.defaultApplications =
{
# Add other defaults here too
"text/html" = [ "firefox.desktop" ];
"text/xml" = [ "firefox.desktop" ];
"application/xhtml+xml" = [ "firefox.desktop" ];
"application/vnd.mozilla.xul+xml" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ];
"x-scheme-handler/ftp" = [ "firefox.desktop" ];
};
}
@Coda-Coda thanks so much for your suggested fix, I can confirm this fixed it for me.
Though this appears to use pkgs.firefox
instead of pkgs.firefox-wayland
as a base now?
Anyhow, I think this issue should be reopened, something's wrong about the firefox-wayland package. I had firefox-wayland installed via configuration.nix and could still observe the original issue as reported by @evils
There isn't. The only thing firefox-wayland
does is set MOZ_ENABLE_WAYLAND
(hence why it does not matter that the above solution uses pkgs.firefox
since it also sets that env var).
The relevant part is likely the MOZ_DBUS_REMOTE
. See: https://mastransky.wordpress.com/2020/03/16/wayland-x11-how-to-run-firefox-in-mixed-environment/
@JohannesRudolph I’m glad you found it useful. Yes my fix does use pkgs.firefox now, I’m not sure if firefox-wayland has any important changes that my solution misses out on but I just see @colemickens has said there is nothing else extra firefox-wayland does.
I agree that further discussion and perhaps re-opening the issue would help.
Perhaps firefox-wayland should use MOZ_DBUS_REMOTE
if it doesn’t already?
Describe the bug running
firefox
when firefox is already open failsTo Reproduce Steps to reproduce the behavior:
nix-env -iA nixpkgs.firefox-wayland
(in a wayland environment, in my case,sway
)firefox
orxdg-open https://nixos.org
Expected behavior firefox to open
Screenshots
Additional context this didn't help
i suspect firefox isn't listening on dbus
Notify maintainers @andir
Metadata
doesn't seem particularly relevant
``` - system: `"x86_64-linux"` - host os: `Linux 5.7.0-rc4, NixOS, 20.09.git.989228702ef (Nightingale)` - multi-user?: `yes` - sandbox: `yes` - version: `nix-env (Nix) 2.3.4` - channels(root): `""` - channels(evils): `"nixos-20.09pre225673.8ba41a1e149, nixos-stable-20.03.1866.a7c70f2e10b, nixos-unstable-small-20.09pre225882.e4d710b1c94, nixpkgs-20.09pre225882.e4d710b1c94"` - nixpkgs: `/home/evils/.nix-defexpr/channels/nixpkgs` ```Maintainer information: