NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.62k stars 13.77k forks source link

cider: unable to start with --ozone-platform=wayland #204488

Open hexagonal-sun opened 1 year ago

hexagonal-sun commented 1 year ago

Describe the bug

When starting cider, if i use the option --ozone-platform=wayland to get native wayland rendering, I no longer see the main screen of Cider. I know that the program is running as I see notifications pop up. If I omit the option, cider starts up as expected. This used to work with v1.5.6 but I think the upgrade to v1.5.7 (in #196751) caused this regression.

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix shell "nixpkgs#cider"
  2. cider --ozone-platform=wayland
  3. No main window appears.

Expected behavior

The app should start with native wayland support.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Output when starting (note that I think the errors described here may be a red herring since they also appear when I omit the option):

[15:09:10.196] [info]  [AppEvents] App started
[15:09:10.421] [info]  [Plugin][Music Recommendations] Loading Complete
[15:09:10.421] [info]  [PluginHandler] Loaded plugins: [
  'chromecast.js',
  'discordrpc.js',
  'lastfm.js',
  'menubar.js',
  'mpris.js',
  'playbackNotifications.js',
  'raop.js',
  'thumbar.js',
  'webNowPlaying.js',
  'MusicRecommendationsPlugin'
]
[15:09:10.484] [info]  [AppEvents] App ready
[15:09:10.485] [info]  [Cider] Application is Ready. Creating Window.
[15:09:10.497] [info]  Setting up handlers for local files
[15:09:10.501] [info]  [Connect] Auth URL: https://connect.cidercollective.dev/callback/discord?app=cider&appPort=9000
[15:09:10.513] [info]  WebSocketServer started on port: 26369
[15:09:10.516] [info]  [Cider][Widevine] Status: {
  oimompecagnajdejgnnjijobebaeigek: {
    name: 'Widevine Content Decryption Module',
    status: 'new',
    version: '4.10.2449.0'
  }
}
[2:1204/150910.533175:ERROR:browser_main_loop.cc(269)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
[15:09:10.541] [info]  {
  auxAttributes: {
    amdSwitchable: false,
    canSupportThreadedTextureMailbox: false,
    glResetNotificationStrategy: 0,
    inProcessGpu: true,
    initializationTime: 0,
    isAsan: false,
    jpegDecodeAcceleratorSupported: false,
    optimus: false,
    passthroughCmdDecoder: false,
    sandboxed: false,
    softwareRendering: false,
    subpixelFontRendering: true,
    visibilityCallbackCallCount: 0
  },
  gpuDevice: [
    {
      active: false,
      cudaComputeCapabilityMajor: 0,
      deviceId: 0,
      gpuPreference: 0,
      vendorId: 0
    }
  ]
}
[15:09:10.542] [info]  From here can you check for real changes, the initial scan has been completed.
[15:09:10.542] [info]  Cider client port: 9000
[15:09:10.543] [info]  Cider remote port: 6942
[15:09:10.545] [info]  remote broadcasted
[143:1204/150910.554326:ERROR:gl_surface_egl.cc(479)] eglCreateWindowSurface failed with error EGL_BAD_NATIVE_WINDOW
[143:1204/150910.557936:ERROR:x11_software_bitmap_presenter.cc(142)] XGetWindowAttributes failed for window 1
[15:09:10.903] [info]  [Plugin][Music Recommendations] Ready
[15:09:11.769] [info]  [Plugin][Music Recommendations] Renderer Ready
[15:09:11.806] [info]  /home/matthew/.config/Cider/Plugins/gh_462093451
[15:09:11.846] [warn]  This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
[15:09:11.846] [error] Error: An object could not be cloned.
    at t.ipcRendererInternal.send (node:electron/js2c/sandbox_bundle:49:353)
    at EventEmitter.<anonymous> (node:electron/js2c/sandbox_bundle:45:357)
[15:09:11.847] [error] (node:2) UnhandledPromiseRejectionWarning: Error: An object could not be cloned.
    at t.ipcRendererInternal.send (node:electron/js2c/sandbox_bundle:49:353)
    at EventEmitter.<anonymous> (node:electron/js2c/sandbox_bundle:45:357)
(Use `cider --trace-warnings ...` to show where the warning was created)
[15:09:11.847] [error] (node:2) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

Notify maintainers

@cigrainger

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.0.9, NixOS, 23.05 (Stoat), 23.05.20221127.b45ec95`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.0`
 - channels(matthew): `"home-manager-21.05"`
 - nixpkgs: `/nix/store/4c3fpmp1dz2icgf152sps2y4bv3l69xh-by2a22ch57a07qwxmd7w9jx4glwgn5pz-source`
CobaltCause commented 1 year ago

Trying to navigate upstream's diff between 1.5.7 and 1.5.8 was unnecessarily difficult:

Currently nixpkgs (both 23.05 and unstable) has Cider 1.6.1 packaged, which looks to be using Electron 24. Downgrading to Electron 24 is actually one of the fixes for element-desktop (see https://github.com/NixOS/nixpkgs/issues/238416#issuecomment-1618662374), so I think this should be working now, and in my extremely brief testing on i915, it indeed works. I'd be tempted to close this as fixed because of that, but Cider 1.6.2 upgraded to Electron 25, which would likely reintroduce the problem, leading to this exact issue again.

I think the root cause of this is going to be the same as the root cause of:

As empirically discovered in https://github.com/NixOS/nixpkgs/issues/238416#issuecomment-1646373750, once Cider 1.6.2 lands in nixpkgs, your best bet is probably to run the program like this (replacing program with the actual name of the executable in $PATH):

env -u NIXOS_OZONE_WL program --use-gl=desktop

But also, this particular program seems to be packaged using appimage stuff which I have no knowledge of, so that may or may not further complicate things.

MangoIV commented 5 months ago

this can be closed, I think