]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Run more commands as root
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 20 Jan 2025 12:57:02 +0000 (13:57 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 27 Jan 2025 18:04:50 +0000 (19:04 +0100)
zypper has some new rather questionable userspace level permission
checking that blows ups completely when operating as root on an
cache directory owned by a non-root user, so let's build the tools
tree and set up meson as root to avoid the issue.

(https://github.com/openSUSE/libzypp/issues/603)

Also drop a leftover debug message from coverage.yml while we're at
it.

(cherry picked from commit cb13d6b44f7952fdfd1fbab99293403a107c75c0)

.github/workflows/coverage.yml
.github/workflows/mkosi.yml

index 2bb9be7d7ad91d1206e17dc151aca3b91dbe642a..c98ec27385eb63511c16db9bfb539c45592f08ac 100644 (file)
@@ -74,21 +74,25 @@ jobs:
         run: mkosi summary
 
       - name: Build tools tree
-        run: mkosi -f sandbox true
-
-      - name: PATH
-        run: echo "$PATH"
+        run: sudo --preserve-env mkosi -f sandbox true
 
       - name: Configure meson
-        run: mkosi sandbox meson setup --buildtype=debugoptimized -Dintegration-tests=true build
+        run: |
+          sudo --preserve-env --preserve-env=PATH \
+            mkosi sandbox \
+            meson setup \
+            --buildtype=debugoptimized \
+            -Dintegration-tests=true \
+            build
 
       - name: Build image
         run: sudo --preserve-env mkosi sandbox meson compile -C build mkosi
 
       - name: Initial coverage report
         run: |
-          mkdir -p build/test/coverage
-          mkosi sandbox \
+          sudo --preserve-env mkdir -p build/test/coverage
+          sudo --preserve-env \
+            mkosi sandbox \
             lcov \
             --directory build/mkosi.builddir/arch~rolling~x86-64 \
             --capture \
@@ -132,7 +136,7 @@ jobs:
               lcov_args+=(--add-tracefile "${file}")
           done < <(find build/test/coverage -name "TEST-*.coverage-info")
 
-          mkosi sandbox lcov --ignore-errors inconsistent,inconsistent "${lcov_args[@]}" --output-file build/test/coverage/everything.coverage-info
+          sudo --preserve-env mkosi sandbox lcov --ignore-errors inconsistent,inconsistent "${lcov_args[@]}" --output-file build/test/coverage/everything.coverage-info
 
       - name: List coverage report
         run: mkosi sandbox lcov --ignore-errors inconsistent,inconsistent --list build/test/coverage/everything.coverage-info
index 3a90bd66802867adba0864de2a4404531b0b4ce2..47a43c689f80ce33322f4c01fa9b91d27504b0e6 100644 (file)
@@ -188,10 +188,16 @@ jobs:
         run: mkosi summary
 
       - name: Build tools tree
-        run: mkosi -f sandbox true
+        run: sudo --preserve-env mkosi -f sandbox true
 
       - name: Configure meson
-        run: mkosi sandbox meson setup --buildtype=debugoptimized -Dintegration-tests=true build
+        run: |
+          sudo --preserve-env --preserve-env=PATH \
+            mkosi sandbox \
+            meson setup \
+            --buildtype=debugoptimized \
+            -Dintegration-tests=true \
+            build
 
       - name: Build image
         run: sudo --preserve-env mkosi sandbox meson compile -C build mkosi