From e1a5818d487c7d021fe9f53f323970d4a8f29f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Fri, 23 May 2025 02:30:08 +0000 Subject: [PATCH 1/2] nixosTests.turbovnc-headless-server: Remove expected-failing test. It doesn't fail as expected anymore because `LIBGL_DRIVERS_PATH` was removed in Mesa 24.2, and apparently there's no replacement for it: https://github.com/NixOS/nixpkgs/issues/328923 Given that it was removed, and https://www.phoronix.com/news/Mesa-24.2-Modern-Interfaces and https://www.supergoodcode.com/long-road-to-DRIL/ saying that removes the problem it originally caused (also for us), this test is probably superfluous because the thing it guards against is gone. --- nixos/tests/turbovnc-headless-server.nix | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/nixos/tests/turbovnc-headless-server.nix b/nixos/tests/turbovnc-headless-server.nix index f51968e29b29..6b3ade7179ff 100644 --- a/nixos/tests/turbovnc-headless-server.nix +++ b/nixos/tests/turbovnc-headless-server.nix @@ -120,24 +120,6 @@ import ./make-test-python.nix ( ) - # Checks that we detect glxgears failing when - # `LIBGL_DRIVERS_PATH=/nonexistent` is set - # (in which case software rendering should not work). - def test_glxgears_failing_with_bad_driver_path(): - machine.execute( - # Note trailing & for backgrounding. - "(env DISPLAY=:0 LIBGL_DRIVERS_PATH=/nonexistent glxgears -info | tee /tmp/glxgears-should-fail.stdout) 3>&1 1>&2 2>&3 | tee /tmp/glxgears-should-fail.stderr >&2 &" - ) - machine.wait_until_succeeds("test -f /tmp/glxgears-should-fail.stderr") - wait_until_terminated_or_succeeds( - termination_check_shell_command="pidof glxgears", - success_check_shell_command="grep 'MESA-LOADER: failed to open swrast' /tmp/glxgears-should-fail.stderr", - get_detail_message_fn=lambda: "Contents of /tmp/glxgears-should-fail.stderr:\n" - + machine.succeed("cat /tmp/glxgears-should-fail.stderr"), - ) - machine.wait_until_fails("pidof glxgears") - - # Starts glxgears, backgrounding it. Waits until it prints the `GL_RENDERER`. # Does not quit glxgears. def test_glxgears_prints_renderer(): @@ -158,9 +140,6 @@ import ./make-test-python.nix ( start_xvnc() wait_until_xvnc_glx_ready() - with subtest("Ensure bad driver path makes glxgears fail"): - test_glxgears_failing_with_bad_driver_path() - with subtest("Run 3D application (glxgears)"): test_glxgears_prints_renderer() @@ -170,8 +149,6 @@ import ./make-test-python.nix ( # Copy files down. machine.copy_from_vm("/tmp/glxgears.png") machine.copy_from_vm("/tmp/glxgears.stdout") - machine.copy_from_vm("/tmp/glxgears-should-fail.stdout") - machine.copy_from_vm("/tmp/glxgears-should-fail.stderr") machine.copy_from_vm("/tmp/Xvnc.stdout") machine.copy_from_vm("/tmp/Xvnc.stderr") ''; From c9a74e546d61d464726a3ae29c843a31d8a4c81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Thu, 22 May 2025 12:19:01 +0000 Subject: [PATCH 2/2] turbovnc: 3.1.4 -> 3.2 * `-DTVNC_*` flags are no longer necessary, as the comment explains. * `-DTJPEG_JAR` and `-DTJPEG_JNILIBRARY` were already removed in turbovnc 3.0beta1, commit https://github.com/TurboVNC/turbovnc/commit/4d9a87732fdf26a772deeab4095856bb0e1dbe92 and replaced by `-DTJPEG_LIBRARY` and `-DTJPEG_INCLUDE_DIR`, but turbovnc detects libjpeg-turbo correctly automatically, with output: -- Performing Test TURBOJPEG_WORKS -- Performing Test TURBOJPEG_WORKS - Failed -- Could not link with official TurboJPEG library /var/empty/libjpeg-turbo/lib64/libturbojpeg.a. Checking whether the operating system supplies it ... -- Performing Test SYSTEM_TURBOJPEG_WORKS -- Performing Test SYSTEM_TURBOJPEG_WORKS - Success --- pkgs/tools/admin/turbovnc/default.nix | 36 +++++++++++++++++++-------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/admin/turbovnc/default.nix b/pkgs/tools/admin/turbovnc/default.nix index 6fa866e6bd11..331b71dc25d5 100644 --- a/pkgs/tools/admin/turbovnc/default.nix +++ b/pkgs/tools/admin/turbovnc/default.nix @@ -27,20 +27,24 @@ xkeyboard_config, xorg, xterm, - zlib, }: stdenv.mkDerivation (finalAttrs: { pname = "turbovnc"; - version = "3.1.4"; + version = "3.2"; src = fetchFromGitHub { owner = "TurboVNC"; repo = "turbovnc"; rev = finalAttrs.version; - hash = "sha256-Qt9yGyGWKFBppO91D+hUfmN7CMg0I66rAXyRoCYUOEA="; + hash = "sha256-CMJdUG4Dd7pbtr/KXq0hV+zR5i+L/y610O+SWJTR/zQ="; }; + # Notes: + # * SSH support does not require `openssh` on PATH, because turbovnc + # uses a built-in SSH client ("JSch fork"), as commented on e.g.: + # https://github.com/TurboVNC/turbovnc/releases/tag/3.2beta1 + # # TODO: # * Build outputs that are unclear: # * `-- FONT_ENCODINGS_DIRECTORY = /var/empty/share/X11/fonts/encodings` @@ -48,7 +52,6 @@ stdenv.mkDerivation (finalAttrs: { # do with their `fontDirectories`? # * `XORG_REGISTRY_PATH = /var/empty/lib64/xorg` # * The thing about xorg `protocol.txt` - # * Does SSH support require `openssh` on PATH? # * Add `enableClient ? true` flag that disables the client GUI # so that the server can be built without openjdk dependency. # * Perhaps allow to build the client on non-Linux platforms. @@ -72,7 +75,6 @@ stdenv.mkDerivation (finalAttrs: { openssl pam perl - zlib ] ++ (with xorg; [ libfontenc # for -DTVNC_SYSTEMX11=1 @@ -83,6 +85,7 @@ stdenv.mkDerivation (finalAttrs: { libXext libXfont2 # for -DTVNC_SYSTEMX11=1 libxkbfile # for -DTVNC_SYSTEMX11=1 + libxshmfence libXi mesa-gl-headers # for -DTVNC_SYSTEMX11=1 pixman # for -DTVNC_SYSTEMX11=1 @@ -103,14 +106,27 @@ stdenv.mkDerivation (finalAttrs: { # -dridir /nix/store/...-mesa-20.1.10-drivers/lib/dri/ "-DXORG_DRI_DRIVER_PATH=${libGL.driverLink}/lib/dri" # The build system doesn't find these files automatically. - "-DTJPEG_JAR=${libjpeg_turbo.out}/share/java/turbojpeg.jar" - "-DTJPEG_JNILIBRARY=${libjpeg_turbo.out}/lib/libturbojpeg.so" "-DXKB_BASE_DIRECTORY=${xkeyboard_config}/share/X11/xkb" "-DXKB_BIN_DIRECTORY=${xkbcomp}/bin" # use system libs - "-DTVNC_SYSTEMLIBS=1" - "-DTVNC_SYSTEMX11=1" - "-DTVNC_DLOPENSSL=0" + # TurboVNC >= 3.1.4 no longer needs overrides to use system libraries + # instead of bundling them, see + # https://github.com/TurboVNC/turbovnc/releases/tag/3.2beta1: + # > The TVNC_SYSTEMLIBS and TVNC_SYSTEMX11 CMake variables have been removed, + # > and the build system now behaves as if those variables are always on. + # > A new CMake variable (TVNC_ZLIBNG) can be used on x86 platforms + # > to disable the in-tree SIMD-accelerated zlib-ng implementation + # > and build against the system-supplied zlib implementation. + # + # We'd like to build against nixpkgs's `zlib-ng`, but if we pass + # `-DTVNC_ZLIBNG=0`, the above logic seems to imply that it looks + # for normal zlib as well, and the `./configure` output prints + # -- zlib-ng disabled (TVNC_ZLIBNG = 0) + # -- Found ZLIB: /nix/store/srby6wmvg7dp454pwb6qvaxdiri38sc1-zlib-1.3.1/lib/libz.so (found version "1.3.1") + # so that seems to use normal `zlib`, even though it's not declared + # as a dependency here (probably it's part of `stdenv`). + # So for now, we use TruboVNC's in-tree `zlib-ng`. + # "-DTVNC_ZLIBNG=0" # not given currently as explained above ]; postInstall = ''