[gimp/wip/Jehan/ninja-test: 6/6] build: fix again the `xvfb-run` call to work on various distributions.




commit 67337fdc44636cbc4b3c46448d661bd906e51908
Author: Jehan <jehan girinstud io>
Date:   Sun Nov 14 20:55:19 2021 +0100

    build: fix again the `xvfb-run` call to work on various distributions.
    
    This tool seems like a mess with various implementations (maybe
    distributions patch it?). I'm trying to tweak the script so that it
    works at least on the Debian testing/bookworm CI and on my Fedora 33
    desktop (and hopefully on more, if not all distribs).

 build/meson/run_test_env.sh | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/build/meson/run_test_env.sh b/build/meson/run_test_env.sh
index 19a1529d5a..a3fda14f00 100644
--- a/build/meson/run_test_env.sh
+++ b/build/meson/run_test_env.sh
@@ -11,7 +11,28 @@ if [ -n "${UI_TEST}" ]; then
   # Also use dbus-run-session to make sure parallel tests aren't failing
   # as they simultaneously try to own the "org.gimp.GIMP.UI" D-Bus name
 
-  xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" \
+  # This is weird but basically on a Debian testing/bookworm, apparently
+  # the --auto-display (neither the short version -d) option does not
+  # exist and ends up in error:
+  # > xvfb-run: unrecognized option '--auto-display'
+  # There only --auto-servernum works fine.
+  #
+  # On a recent Fedora (33 in my case), the later exists but a few of
+  # the tests fail with some weirder:
+  # > /usr/bin/xvfb-run: line 186: kill: (53539) - No such process
+  # There using --auto-display instead (supposed to deprecate
+  # --auto-servernum) works instead, but only in its short form (-d).
+  # The long form --auto-display also results in the "unrecognized
+  # option" error even though the help output lists it.
+  # Yep it's a huge mess.
+  xvfb-run 2>&1|grep --quiet auto-display
+  HAS_AUTO_DISPLAY="$?"
+  if [ "$HAS_AUTO_DISPLAY" -eq 0 ]; then
+    OPT="-d"
+  else
+    OPT="--auto-servernum"
+  fi
+  xvfb-run $OPT --server-args="-screen 0 1280x1024x24" \
     dbus-run-session -- "$@"
 
 else
@@ -20,4 +41,3 @@ else
 
   "$@"
 fi
-


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]