From ce9067697bfc8075c10d2d618e84dd22d4ef4351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 30 Nov 2020 11:09:37 +0100 Subject: [PATCH 1/2] meson: add missing "S" to SYSTEMD_CGROUPS_AGENT_PATH Other similar variables use the binary name underscorified and upppercased (with "_BINARY" appended in some cases to avoid ambiguity). Add "S" to follow the same pattern for systemd-cgroups-agent. Based on the discussion in #16715. --- meson.build | 4 ++-- src/core/cgroup.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index ab2404c3c4..73cff4a6f7 100644 --- a/meson.build +++ b/meson.build @@ -221,11 +221,11 @@ conf.set_quoted('USER_CONFIG_UNIT_DIR', join_paths(pkgsysc conf.set_quoted('USER_DATA_UNIT_DIR', userunitdir) conf.set_quoted('CERTIFICATE_ROOT', get_option('certificate-root')) conf.set_quoted('CATALOG_DATABASE', join_paths(catalogstatedir, 'database')) -conf.set_quoted('SYSTEMD_CGROUP_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent')) conf.set_quoted('SYSTEMD_BINARY_PATH', join_paths(rootlibexecdir, 'systemd')) +conf.set_quoted('SYSTEMD_CGROUPS_AGENT_PATH', join_paths(rootlibexecdir, 'systemd-cgroups-agent')) conf.set_quoted('SYSTEMD_FSCK_PATH', join_paths(rootlibexecdir, 'systemd-fsck')) -conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs')) conf.set_quoted('SYSTEMD_GROWFS_PATH', join_paths(rootlibexecdir, 'systemd-growfs')) +conf.set_quoted('SYSTEMD_MAKEFS_PATH', join_paths(rootlibexecdir, 'systemd-makefs')) conf.set_quoted('SYSTEMD_SHUTDOWN_BINARY_PATH', join_paths(rootlibexecdir, 'systemd-shutdown')) conf.set_quoted('SYSTEMCTL_BINARY_PATH', join_paths(rootbindir, 'systemctl')) conf.set_quoted('SYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH', join_paths(rootbindir, 'systemd-tty-ask-password-agent')) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 6b34363d9a..b9d84dcca9 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -3052,7 +3052,7 @@ int manager_setup_cgroup(Manager *m) { /* On the legacy hierarchy we only get notifications via cgroup agents. (Which isn't really reliable, * since it does not generate events when control groups with children run empty. */ - r = cg_install_release_agent(SYSTEMD_CGROUP_CONTROLLER, SYSTEMD_CGROUP_AGENT_PATH); + r = cg_install_release_agent(SYSTEMD_CGROUP_CONTROLLER, SYSTEMD_CGROUPS_AGENT_PATH); if (r < 0) log_warning_errno(r, "Failed to install release agent, ignoring: %m"); else if (r > 0) From 7e299ffe108fc0265553d30cf63febc6e6609087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 2 Dec 2020 13:49:24 +0100 Subject: [PATCH 2/2] meson: allow fuzzers to be built even if fuzz testing is disabled This makes commands like 'ninja -C build fuzz-journal-remote' or 'ninja -C build fuzzers' work, even if we have -Dfuzz-tests=false. Two advantages: correctness of the meson declarations is verified even if fuzzers are not built, and it easier to do a one-off build to check for regressions or such. Follow-up for 1763ef1d49cc1263b40f157060a61cdd6e91d3a4. --- meson.build | 55 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/meson.build b/meson.build index 73cff4a6f7..bf291027ea 100644 --- a/meson.build +++ b/meson.build @@ -3438,40 +3438,39 @@ endif fuzzer_exes = [] -if fuzz_tests or fuzzer_build - foreach tuple : fuzzers - sources = tuple[0] - link_with = tuple[1].length() > 0 ? tuple[1] : [libshared] - dependencies = tuple[2] - defs = tuple.length() >= 4 ? tuple[3] : [] - incs = tuple.length() >= 5 ? tuple[4] : includes - link_args = [] +foreach tuple : fuzzers + sources = tuple[0] + link_with = tuple[1].length() > 0 ? tuple[1] : [libshared] + dependencies = tuple[2] + defs = tuple.length() >= 4 ? tuple[3] : [] + incs = tuple.length() >= 5 ? tuple[4] : includes + link_args = [] - if want_ossfuzz + if want_ossfuzz + dependencies += fuzzing_engine + elif want_libfuzzer + if fuzzing_engine.found() dependencies += fuzzing_engine - elif want_libfuzzer - if fuzzing_engine.found() - dependencies += fuzzing_engine - else - link_args += ['-fsanitize=fuzzer'] - endif else - sources += 'src/fuzz/fuzz-main.c' + link_args += ['-fsanitize=fuzzer'] endif + else + sources += 'src/fuzz/fuzz-main.c' + endif - name = sources[0].split('/')[-1].split('.')[0] + name = sources[0].split('/')[-1].split('.')[0] - fuzzer_exes += executable( - name, - sources, - include_directories : [incs, include_directories('src/fuzz')], - link_with : link_with, - dependencies : dependencies, - c_args : defs, - link_args: link_args, - install : false) - endforeach -endif + fuzzer_exes += executable( + name, + sources, + include_directories : [incs, include_directories('src/fuzz')], + link_with : link_with, + dependencies : dependencies, + c_args : defs, + link_args: link_args, + install : false, + build_by_default : fuzz_tests or fuzzer_build) +endforeach run_target( 'fuzzers',