]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: add install_tag to sd-boot, libsystemd and libudev
authorLuca Boccassi <bluca@debian.org>
Wed, 27 Apr 2022 09:54:14 +0000 (10:54 +0100)
committerLuca Boccassi <bluca@debian.org>
Wed, 27 Apr 2022 21:24:53 +0000 (22:24 +0100)
Allows to 'meson install --tags systemd-boot --no-rebuild' to install only the EFI
binaries, skipping the rest, for a very quick build:

$ ninja src/boot/efi/linuxx64.efi.stub
[21/21] Generating src/boot/efi/linuxx64.efi.stub with a custom command
$ ninja src/boot/efi/systemd-bootx64.efi
[10/10] Generating src/boot/efi/systemd-bootx64.efi with a custom command
$ DESTDIR=/tmp/foo meson install --tags systemd-boot --no-rebuild
Installing src/boot/efi/systemd-bootx64.efi to /tmp/foo/usr/lib/systemd/boot/efi

Requires Meson 0.60 to be used, prints a warning for unknown keyword
in earlier versions, but there's no failure

https://mesonbuild.com/Installing.html#installation-tags

.github/workflows/build_test.sh
.github/workflows/unit_tests.sh
meson.build
src/boot/efi/meson.build

index 0c77be2a1341aa028d3948b27db8c298dc5d5dd8..aa8fa97f4e5380c483f94fe074e36a2d80fc40b9 100755 (executable)
@@ -123,9 +123,13 @@ for args in "${ARGS[@]}"; do
     #   src/boot/efi/meson.build:52:16: ERROR: Fatal warnings enabled, aborting
     # when LINKER is set to lld so let's just not turn meson warnings into errors with lld
     # to make sure that the build systemd can pick up the correct efi-ld linker automatically.
-    if [[ "$LINKER" != lld ]]; then
-        additional_meson_args="--fatal-meson-warnings"
-    fi
+    # We use some features (like install_tag) that were introduced in 0.60, but that don't
+    # break running with older versions
+    # FIXME: re-enable once the minimum version is bumped to 0.60
+    #if [[ "$LINKER" != lld ]]; then
+    #    additional_meson_args="--fatal-meson-warnings"
+    #fi
+    additional_meson_args=""
     info "Checking build with $args"
     # shellcheck disable=SC2086
     if ! AR="$AR" \
index ca7309b141020fb99ee89a4c72fe71995175d0ad..f689f97e40861a7162f79350199607dd009a8e35 100755 (executable)
@@ -60,7 +60,11 @@ for phase in "${PHASES[@]}"; do
                 # The docs build is slow and is not affected by compiler/flags, so do it just once
                 MESON_ARGS+=(-Dman=true)
             fi
-            run_meson --fatal-meson-warnings -Dnobody-group=nogroup --werror -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true "${MESON_ARGS[@]}" build
+            # We use some features (like install_tag) that were introduced in 0.60, but that don't
+            # break running with older versions
+            # FIXME: re-enable once the minimum version is bumped to 0.60
+            # MESON_ARGS+=(--fatal-meson-warnings)
+            run_meson -Dnobody-group=nogroup --werror -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true "${MESON_ARGS[@]}" build
             ninja -C build -v
             meson test -C build --print-errorlogs
             ;;
@@ -79,7 +83,11 @@ for phase in "${PHASES[@]}"; do
                     MESON_ARGS+=(-Dskip-deps=true)
                 fi
             fi
-            run_meson --fatal-meson-warnings -Dnobody-group=nogroup --werror -Dtests=unsafe -Db_sanitize=address,undefined "${MESON_ARGS[@]}" build
+            # We use some features (like install_tag) that were introduced in 0.60, but that don't
+            # break running with older versions
+            # FIXME: re-enable once the minimum version is bumped to 0.60
+            # MESON_ARGS+=(--fatal-meson-warnings)
+            run_meson -Dnobody-group=nogroup --werror -Dtests=unsafe -Db_sanitize=address,undefined "${MESON_ARGS[@]}" build
             ninja -C build -v
 
             export ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
index fc98350d31f3317ad663502b565df6d71aedc8de..24568b550166cc8e28515276f6c864c05b98e243 100644 (file)
@@ -1906,6 +1906,7 @@ libsystemd = shared_library(
                         librt],
         link_depends : libsystemd_sym,
         install : true,
+        install_tag: 'libsystemd',
         install_dir : rootlibdir)
 
 install_libsystemd_static = static_library(
@@ -1919,6 +1920,7 @@ install_libsystemd_static = static_library(
         include_directories : libsystemd_includes,
         build_by_default : static_libsystemd != 'false',
         install : static_libsystemd != 'false',
+        install_tag: 'libsystemd',
         install_dir : rootlibdir,
         pic : static_libsystemd_pic,
         dependencies : [threads,
@@ -1946,6 +1948,7 @@ libudev = shared_library(
         dependencies : [threads],
         link_depends : libudev_sym,
         install : true,
+        install_tag: 'libudev',
         install_dir : rootlibdir)
 
 install_libudev_static = static_library(
@@ -1959,6 +1962,7 @@ install_libudev_static = static_library(
         include_directories : includes,
         build_by_default : static_libudev != 'false',
         install : static_libudev != 'false',
+        install_tag: 'libudev',
         install_dir : rootlibdir,
         link_depends : libudev_sym,
         dependencies : libshared_deps + [libmount],
index a17857e63e819e4141da2932ec50ffabd5ee6f1c..4316588998fd7da988f1371a9993d67520768051 100644 (file)
@@ -410,8 +410,8 @@ foreach file : fundamental_source_paths + common_sources + systemd_boot_sources
         endif
 endforeach
 
-foreach tuple : [['systemd-boot@0@.@1@', systemd_boot_objects, false],
-                 ['linux@0@.@1@.stub', stub_objects, true]]
+foreach tuple : [['systemd-boot@0@.@1@', systemd_boot_objects, false, 'systemd-boot'],
+                 ['linux@0@.@1@.stub', stub_objects, true, 'systemd-stub']]
         elf = custom_target(
                 tuple[0].format(efi_arch[0], 'elf'),
                 input : tuple[1],
@@ -425,6 +425,7 @@ foreach tuple : [['systemd-boot@0@.@1@', systemd_boot_objects, false],
                            '-lgnuefi',
                            '-lgcc'],
                 install : tuple[2],
+                install_tag: tuple[3],
                 install_dir : bootlibdir)
 
         custom_target(
@@ -446,5 +447,6 @@ foreach tuple : [['systemd-boot@0@.@1@', systemd_boot_objects, false],
                            efi_format,
                            '@INPUT@', '@OUTPUT@'],
                 install : true,
+                install_tag: tuple[3],
                 install_dir : bootlibdir)
 endforeach