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

Xwayland-satellite broken on master #352725

Open
sodiboo opened this issue Oct 31, 2024 · 5 comments
Open

Xwayland-satellite broken on master #352725

sodiboo opened this issue Oct 31, 2024 · 5 comments
Labels
0.kind: bug Something is broken 0.kind: regression Something that worked before working no longer

Comments

@sodiboo
Copy link
Contributor

sodiboo commented Oct 31, 2024

Describe the bug

On latest nixpkgs master commit, xwayland-satellite is broken.

At time of writing, the latest commit to nixos-unstable is 807e915. If the steps below don't work in a few days from now, replace nixos-unstable in commands with 807e915. The latest commit to master as i'm writing is 769a6a5.

  • Working commit (current nixos-unstable): 807e915
  • Broken commit (current master): 769a6a5

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix run github:nixos/nixpkgs/nixos-unstable#xwayland-satellite -- :12
  2. Observe that it says Connected to Xwayland on :12
  3. nix run github:nixos/nixpkgs/master#xwayland-satellite -- :12
  4. Observe that Xwayland never initializes

Expected behavior

Xwayland should initialize and xwayland-satellite should connect to it within less than a second of startup. (from what i can observe, usually within less than 100ms)

Screenshots

Here is some terminal output showing several xwayland-satellite packages. The first two invocations are identical, as i have the xwayland-satellite-unstable package from my niri flake installed in my system. Those packages are used here to indicate that this isn't necessarily a problem with nixpkgs' package expression, it is inherently a problem with a dependency (likely Xwayland). They're built against nixos-unstable.

image

Additional context

This doesn't seem to be caused by us. I think it needs to be fixed upstream. I'm making this issue first, though, in case it is actually nixos-specific.

Notify maintainers

@if-loop69420 @getchoo are the other maintainers of the xwayland-satellite package

Metadata

  • system: "x86_64-linux"
  • host os: Linux 6.6.54, NixOS, 24.11 (Vicuna), 24.11.20241029.807e915
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.9
  • channels(root): "nixos"
  • channels(sodiboo): ""
  • nixpkgs: /nix/store/m68ikm8045fj7ys7qvgr608z9l70hh1k-source

Add a 👍 reaction to issues you find important.

@sodiboo sodiboo added 0.kind: bug Something is broken 0.kind: regression Something that worked before working no longer labels Oct 31, 2024
@sodiboo
Copy link
Contributor Author

sodiboo commented Oct 31, 2024

The PR updating xwayland was backported to nixos-24.05, and although that branch has no xwayland-satellite to break, my niri flake has a package that works on nixos-24.05 and when i try to check if the same regression applies there, i see no issue. This suggests the issue may not be caused by an xwayland update after all, since the backported PR (#352314) does not break an xwayland-satellite built against nixos-24.05

image

@sodiboo
Copy link
Contributor Author

sodiboo commented Oct 31, 2024

I'm currently bisecting nixpkgs to find the offending commit in case it's not that PR updating xwayland (which it seems not to be, given that it doesn't break on 24.05), This is taking a while, as Hydra doesn't cache every commit to nixpkgs, and i'm currently on the third iteration of a bisect script which has taken over am hour so far and doesn't seem to be anywhere near the end. Will update once this bisect yields a result, or if i fall asleep before that point, hopefully i'll have an update in the morning if it finished by then

@sodiboo
Copy link
Contributor Author

sodiboo commented Nov 1, 2024

Yeah uhh i'm still bisecting because i've tried several times and it just leads me to Entirely The Wrong Commit. so:..? if anyone else is seeing this, feel free to try to bisect it to find the actual cause, you might get there way sooner than me.

@sodiboo
Copy link
Contributor Author

sodiboo commented Nov 3, 2024

Yeah, so this is most definitely not an issue with Xwayland, but rather with upgrading mesa.

After writing my previous comment, i noticed that the reason my bisects were failing were always because rust-cbindgen was broken. So i wrote a script that checks xwayland-satellite after applying this patch, and that led me to 09de225, which i discovered nearly 30 hours ago now.

Here's the bisect script i used.
#!/usr/bin/env fish

git apply cbindgen.patch
nom build .#xwayland-satellite
git reset --hard

if test $status -ne 0
    exit 125 # skip
end

./result/bin/xwayland-satellite 2> log &

sleep 5

kill $last_pid

pkill -9 Xwayland


bat log | rg "Connected to Xwayland"

The reason the same backported changes didn't break nixos-24.05 is because that branch doesn't update mesa.

I also noticed that my system is on 24.2.4, which is equal to the old version (working xwayland-satellite) and lower than the new version (broken xwayland-satellite). See attached image:

image

As such, i figured "oh, is it just because the package is newer than my system? what if i build with mesa 24.2.5?".

Turns out, a lot of things depend on mesa, and my computer didn't like that rebuild very much. That rebuild exceeded 100 GB memory usage the first time i tried, and when i limited the amount of jobs to hopefully reduce memory usage, it did run for longer before locking up. In fact, it still hasn't locked up, but electron has been building for more than 24 hours. I think maybe this build isn't going to finish anytime soon, if ever, so i actually have absolutely no idea if upgrading mesa on my system would break it. Since i'm impatient, i'm just gonna stop waiting for it, and report my findings so far, without testing for a system with a matching mesa version.

That leaves me with the disappointing result: i'm not sure if this is just a "mesa version mismatch" thing, or the more interesting "this mesa version is actually bad".

@getchoo
Copy link
Member

getchoo commented Nov 8, 2024

See my other comment

I can't check if this is a Mesa issue since I have only have a NVIDIA card; I'm hesitant to say it is though, as there are no upstream bug reports of this to my knowledge

Turns out, a lot of things depend on mesa, and my computer didn't like that rebuild very much.

You may want to try system.replaceRuntimeDependencies

{ pkgs, inputs, ... }:
let
  nixpkgs-master = inputs.nixpkgs-master.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in
{
  system.replaceRuntimeDependencies = [
    { original = pkgs.mesa; replacement = nixpkgs-master.mesa; }
    { original = pkgs.i686Linux.mesa; replacement = nixpkgs-master.i686Linux.mesa; }
  ];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 0.kind: regression Something that worked before working no longer
Projects
None yet
Development

No branches or pull requests

2 participants