ci/bare-metal: Consistently set library paths
authorDaniel Stone <daniels@collabora.com>
Fri, 11 Jun 2021 14:56:19 +0000 (15:56 +0100)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 15 Jun 2021 12:02:44 +0000 (14:02 +0200)
Everything needs them, so might as well set it up front.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11337>

.gitlab-ci/common/init.sh
.gitlab-ci/lava/lava.yml.jinja2

index ef8499c..c9938ed 100755 (executable)
@@ -24,10 +24,15 @@ for i in 1 2 3; do sntp -sS pool.ntp.org && break || sleep 2; done || true
 # Fix prefix confusion: the build installs to $CI_PROJECT_DIR, but we expect
 # it in /install
 ln -sf $CI_PROJECT_DIR/install /install
+export LD_LIBRARY_PATH=/install/lib
+export LIBGL_DRIVERS_PATH=/install/lib/dri
 
 # Store Mesa's disk cache under /tmp, rather than sending it out over NFS.
 export XDG_CACHE_HOME=/tmp
 
+# Make sure Python can find all our imports
+export PYTHONPATH=$(python3 -c "import sys;print(\":\".join(sys.path))")
+
 # Start a little daemon to capture the first devcoredump we encounter.  (They
 # expire after 5 minutes, so we poll for them).
 ./capture-devcoredump.sh &
@@ -39,8 +44,6 @@ export XDG_CACHE_HOME=/tmp
 if [ -n "$BM_START_XORG" ]; then
   echo "touch /xorg-started; sleep 100000" > /xorg-script
   env \
-    LD_LIBRARY_PATH=/install/lib/ \
-    LIBGL_DRIVERS_PATH=/install/lib/dri/ \
     xinit /bin/sh /xorg-script -- /usr/bin/Xorg -noreset -s 0 -dpms -logfile /Xorg.0.log &
 
   # Wait for xorg to be ready for connections.
index 6d8df73..66a82a8 100644 (file)
@@ -107,6 +107,7 @@ actions:
           - export XDG_CACHE_HOME=/tmp
 
           - export PYTHONPATH=$(python3 -c "import sys;print(\":\".join(sys.path))")
+          - export LD_LIBRARY_PATH=/install/lib/
           - export LIBGL_DRIVERS_PATH=/install/lib/dri
 
           # If we want Xorg to be running for the test, then we start it up before the
@@ -115,7 +116,7 @@ actions:
           # your client's return code
           - "if [ -n $LAVA_START_XORG ]; then
                echo 'touch /xorg-started; sleep 100000' > /xorg-script;
-               env LD_LIBRARY_PATH=/install/lib/ xinit /bin/sh /xorg-script -- /usr/bin/Xorg -noreset -s 0 -dpms -logfile /Xorg.0.log &
+               env xinit /bin/sh /xorg-script -- /usr/bin/Xorg -noreset -s 0 -dpms -logfile /Xorg.0.log &
                for i in 1 2 3 4 5; do
                  if [ -e /xorg-started ]; then
                    break;