From 40f9597859616a590342cb96f1859bc195d17ec9 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 8 Feb 2025 18:04:00 +0100 Subject: [PATCH 1/4] zoom-us: add simple test This test starts zoom with an Xvfb X server and verifies that the "Zoom Workplace" window is created. zoom is started with `prlimit` to avoid problems like https://github.com/NixOS/nixpkgs/issues/371488 . Note: During my experiments, it turned out that if certain libraries are missing (I don't recall which ones), then zoom still opens its Workplace window, then immediatelly closes it again. To reduce the likelihood of the test passing in that scenario, another "sleep 20" is included. --- pkgs/by-name/zo/zoom-us/package.nix | 2 ++ pkgs/by-name/zo/zoom-us/test.nix | 44 +++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 pkgs/by-name/zo/zoom-us/test.nix diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 7cc46715e99c..96419e7ad8b9 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -40,6 +40,7 @@ pulseaudioSupport ? true, libpulseaudio, pulseaudio, + callPackage, }: let @@ -220,6 +221,7 @@ stdenv.mkDerivation { dontPatchELF = true; passthru.updateScript = ./update.sh; + passthru.tests.startwindow = callPackage ./test.nix { }; meta = with lib; { homepage = "https://zoom.us/"; diff --git a/pkgs/by-name/zo/zoom-us/test.nix b/pkgs/by-name/zo/zoom-us/test.nix new file mode 100644 index 000000000000..98ededc27563 --- /dev/null +++ b/pkgs/by-name/zo/zoom-us/test.nix @@ -0,0 +1,44 @@ +{ + lib, + xvfb-run, + zoom-us, + runCommand, + writeShellApplication, + xorg, +}: + +let + testScript = writeShellApplication { + name = "zoom-us-test-script"; + runtimeInputs = [ + xorg.xwininfo + zoom-us + ]; + text = '' + function is_zoom_window_present { + echo + xwininfo -root -tree \ + | sed 's/.*0x[0-9a-f]* \"\([^\"]*\)\".*/\1/; t; d' \ + | tee window-names + grep -q "Zoom Workplace" window-names + } + # don't let zoom eat all RAM, like it did + # https://github.com/NixOS/nixpkgs/issues/371488 + prlimit --{as,data}=$((4*2**30)):$((4*2**30)) zoom-us & + for _ in {0..900} ; do + if is_zoom_window_present ; then + break + fi + sleep 1 + done + # if libraries are missing, the window still appears, + # but disappears again immediatelly; check for that too: + sleep 20 + is_zoom_window_present + ''; + }; +in +runCommand "zoom-us-test" { buildInputs = [ xvfb-run ]; } '' + HOME=$PWD xvfb-run ${lib.getExe testScript} + touch ${placeholder "out"} +'' From 7b30dbddcc6ebe592a8895d365c305b2d0b0daa3 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:23:54 +0100 Subject: [PATCH 2/4] zoom-us: provide pipewire program to fix error message Without `pipewire` being in PATH, zoom complains > sh: pipewire: not found --- pkgs/by-name/zo/zoom-us/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 96419e7ad8b9..24308f72809e 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -123,6 +123,7 @@ let coreutils glib.dev pciutils + pipewire procps util-linux ] From 3f58227a38fa6f3931ef82541572123dc49958f6 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 8 Feb 2025 17:22:54 +0100 Subject: [PATCH 3/4] zoom-us (x86-64): don't touch the core `zoom` binary Without the commit at hand, zoom-us stops working and instead simply maxes out RAM when updated from version 6.2.11.5069 to version 6.3.0.5527 . https://github.com/NixOS/nixpkgs/issues/371488 Some experimenting yielded these observations regarding newer (problematic) zoom-us versions on NixOS: * They still work if started via flatpak (which creates a virtual FHS-compatible environment) * They still work if started with `buildFHSEnv` with all libraries provided in `multiPkgs`. * They still work if the unmodified zoom binary is started by manually invoking the `ld-linux` elf interpreter. However, this again requires that libraries are available via `LD_PRELOAD_PATH`. It seems very much that the `patchelf --set-interpreter` call on the `zoom` binary breaks something inside the binary. The commit at hand removes `zoom` from the list of binaries that are to be patched. To ensure that program can still be executed, the `makeWrapper` call (which is already there to wrap `zoom`) is extended such that is explicitely uses the elf interpreter. Unfortunatelly, when zoom tries to find its data files (e.g. ring tones), it determines its data directory by looking at `/proc/self/exe`. If we start zoom by calling the elf interpreter, `/proc/self/exe` acutally points to that interpreter. The only solution is to copy the interpreter into the zoom data directory (a symlink isn't enough here). --- pkgs/by-name/zo/zoom-us/package.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 24308f72809e..33841a2b01f4 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -181,7 +181,7 @@ stdenv.mkDerivation { substituteInPlace $out/share/applications/Zoom.desktop \ --replace-fail "Exec=/usr/bin/zoom" "Exec=$out/bin/zoom" - for i in aomhost zopen zoom ZoomLauncher ZoomWebviewHost; do + for i in aomhost zopen ZoomLauncher ZoomWebviewHost; do if [ -f $out/opt/zoom/$i ]; then patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/opt/zoom/$i fi @@ -189,8 +189,14 @@ stdenv.mkDerivation { # ZoomLauncher sets LD_LIBRARY_PATH before execing zoom # IPC breaks if the executable name does not end in 'zoom' + # zoom binary does not like being touched by patchelf + # => we call it indirectly via the dynamic linker + # zoom binary inspects /proc/self/exe to find its data files + # => we must place a copy (not symlink) of the linker in zoom's data dir mv $out/opt/zoom/zoom $out/opt/zoom/.zoom - makeWrapper $out/opt/zoom/.zoom $out/opt/zoom/zoom \ + cp "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/opt/zoom/ld.so + makeWrapper $out/opt/zoom/ld.so $out/opt/zoom/zoom \ + --add-flags $out/opt/zoom/.zoom \ --prefix LD_LIBRARY_PATH ":" ${libs} rm $out/bin/zoom From 4357610c85ccd36a3b7f0450e7332e70104d21a8 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 24 Jan 2025 00:10:42 +0000 Subject: [PATCH 4/4] zoom-us: 6.2.11.5069 -> 6.3.6.6315 --- pkgs/by-name/zo/zoom-us/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 33841a2b01f4..828afbbbd62b 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -51,23 +51,23 @@ let # and often with different versions. We write them on three lines # like this (rather than using {}) so that the updater script can # find where to edit them. - versions.aarch64-darwin = "6.3.1.45300"; - versions.x86_64-darwin = "6.3.1.45300"; - versions.x86_64-linux = "6.2.11.5069"; + versions.aarch64-darwin = "6.3.6.47101"; + versions.x86_64-darwin = "6.3.6.47101"; + versions.x86_64-linux = "6.3.6.6315"; srcs = { aarch64-darwin = fetchurl { url = "https://zoom.us/client/${versions.aarch64-darwin}/zoomusInstallerFull.pkg?archType=arm64"; name = "zoomusInstallerFull.pkg"; - hash = "sha256-WPhqYof/XR6TDkuA4NK2a30ksdhN7NBfs4KCQwqKJ0g="; + hash = "sha256-tqDf3Z5RRf4aRvtINWdM3oppZXbDdtihhPBHu4QxzDM="; }; x86_64-darwin = fetchurl { url = "https://zoom.us/client/${versions.x86_64-darwin}/zoomusInstallerFull.pkg"; - hash = "sha256-BywBvJCcNXARHTkO/UJbOFRjuiXRkmFWmSuZsW9t1pk="; + hash = "sha256-BZkBx5eZ3c3p9JIz+ChyJrGM12HwyNToSuS86f9QnF0="; }; x86_64-linux = fetchurl { url = "https://zoom.us/client/${versions.x86_64-linux}/zoom_x86_64.pkg.tar.xz"; - hash = "sha256-k8T/lmfgAFxW1nwEyh61lagrlHP5geT2tA7e5j61+qw="; + hash = "sha256-QJR8SsMtyYBvd5G+mEjEEISkJJukCYeHErKrgs1uDQc="; }; };