summaryrefslogtreecommitdiff
path: root/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* portable, meson: allow statically linked buildRobert Scheck2023-05-151-2/+10
| | | | | | | | | | Build option "link-portabled-shared" to build a statically linked systemd-portabled by using -Dlink-portabled-shared=false on systems with full systemd stack except systemd-portabled, such as CentOS/RHEL 9.
* dirent: conditionalize dirent assert based on dirent64 existenceSam James2023-05-101-0/+2
| | | | | | | | | | >=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native" functions are already LFS-aware. Check for dirent64 in meson.build and only assert if it exists. Bug: https://bugs.gentoo.org/905900 Closes: https://github.com/systemd/systemd/pull/25809
* test: rework how udev-test is invokedZbigniew Jędrzejewski-Szmek2023-05-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the build, we would populate build/test/sys/ using sys-script.py, and then udev-test.p[ly] would create a tmpfs instance on build/test/tmpfs and copy the sys tree to build/test/tmpfs/sys. Also, we had udev-test.p[ly] which called test-udev. test-udev was marked as a manual test and installed, but neither udev-test.p[ly] or sys-script.py were. test-udev is renamed to udev-rule-runner, which reduces confusion and frees up the test-udev name. udev-test.py is renamed to test-udev.py. All three files are now installed. test-udev.py is modified to internally call sys-script.py to set up the sys tree. Copying and creating it from scratch should take the same amount of time. We avoid having a magic directory, everything is now done underneath a temporary directory. test-udev.py is now a normal installed test, and run-unit-tests.py will pick it up. When test-udev.py is invoked from meson, the path to udev-rule-runner is passed via envvar; when it is invoked via run-unit-tests.py or directly, it looks for udev-rule-runner in a relative path. The goal of this whole change is to let Debian drop the 'udev' test. It called sys-script.py and udev-test.pl from the source directory and had to recreate a bunch of the logic. Now test-udev.py will now be called via 'upstream'.
* test: drop udev-test.plZbigniew Jędrzejewski-Szmek2023-05-091-1/+0
|
* meson: fix indentationZbigniew Jędrzejewski-Szmek2023-05-091-5/+5
|
* meson: add check-includes test to the test suiteZbigniew Jędrzejewski-Szmek2023-05-091-4/+13
| | | | Let's just call it always. It is quite fast (meson says 0.12 s).
* meson: include .cc files in tags tooZbigniew Jędrzejewski-Szmek2023-05-091-1/+1
| | | | | We only have one, but it seems reasonable to not exclude it. Result tested with emacs.
* test/60-ukify: override stub location in testsZbigniew Jędrzejewski-Szmek2023-05-051-2/+5
| | | | Without this, build would fail if the stub is not available in /usr/lib/.
* test-kernel-install: test 60-ukify.install and 90-uki-copy.installZbigniew Jędrzejewski-Szmek2023-05-051-10/+15
| | | | | | We install a kernel with layout=uki and uki_generator=ukify, and test that a UKI gets installed in the expected place. The two plugins cooperate, so it's easiest to test them together.
* meson: allow building .standalone on demandZbigniew Jędrzejewski-Szmek2023-05-031-60/+65
| | | | | | | | | | | | | We can always build the standalone version whenever we build the normal version (the dependencies are the same). In most builds standalone binaries would be disabled. But it is occasionally useful to have them for testing, so move the conditional to install:, so the binaries can be build by giving the explicit target name. The default of 'build_by_default' for executable() is sadly true (since meson 0.38.0), so need to specify build_by_default: too. Also add systemd-shutdown.standalone to public_programs for additional testing.
* meson: avoid building executables that won't be installedZbigniew Jędrzejewski-Szmek2023-05-031-5/+9
| | | | | | | | | | | When executable() or custom_target() has install: that is conditional as is false (i.e. not install:true), it won't be built by default. (build_by_default: defaults to install:). But if that program is added to public_programs, it will be build by default because it is pulled in by the test, effectively defeating the disablement. While at it, make 'ukify' follow the same pattern as 'kernel-install'. They will be used later together.
* meson: Search for find programDaan De Meyer2023-05-011-0/+1
| | | | | find is required by a few of the unit tests so let's make sure its available when configuring the build.
* meson: Search for diff programDaan De Meyer2023-05-011-0/+1
| | | | | diff is required by a few of the unit tests so let's make sure its available when configuring the build.
* meson: move bpf hookup into main meson build fileLennart Poettering2023-04-241-0/+112
| | | | This way we can use it in systemd-userdbd later on, too.
* Merge pull request #26870 from fbuihuu/move-unit-tests-in-a-dedicated-subdirLuca Boccassi2023-03-271-6/+8
|\ | | | | Move unit tests in a dedicated subdir
| * meson: define testdata_dir globallyFranck Bui2023-03-241-1/+2
| |
| * test: install unit tests in a dedicated subdirectory below '$testsdir'Franck Bui2023-03-241-5/+6
| | | | | | | | | | | | | | | | | | | | | | /usr/lib/systemd/tests may contain more than the unit tests. For example on SUSE we also install the integration tests there. Putting the unit tests in a dedicated directory named 'unit-tests' makes the layout cleaner. Note that `run-unit-tests.py` has not been moved so we don't need to adjust (Fedora) packaging and users also don't need to descend into the subdirectory.
* | locale: split out xkbcommon related functions to xkbcommon-util.cYu Watanabe2023-03-251-13/+3
|/ | | | Then, use dlopen_many_sym_or_warn() with DLSYM_ARG() macro.
* meson: Share more C flagsJan Janssen2023-03-171-4/+4
|
* boot: Add support for -fstack-protectorJan Janssen2023-03-171-4/+11
|
* boot: Add RISCV32 and LoongArch supportJan Janssen2023-03-101-5/+8
| | | | | This is completely untested, but should work in theory, as it's just adding a couple defines according to the specs.
* boot: Bring back bootloader buildsJan Janssen2023-03-101-4/+23
| | | | | | | | | | | | This adds back sd-boot builds by using meson compile targets directly. We can do this now, because userspace binaries use the special dependency that allows us to easily separate flags, so that we don't pass anything to EFI builds that shouldn't be passed. Additionally, we pass a bunch of flags to hopefully disable/override any distro provided flags that should not be used for EFI binaries. Fixes: #12275
* tree-wide: Drop gnu-efiJan Janssen2023-03-101-15/+33
| | | | | | | This drops all mentions of gnu-efi and its manual build machinery. A future commit will bring bootloader builds back. A new bootloader meson option is now used to control whether to build sd-boot and its userspace tooling.
* meson: Introduce userspace depJan Janssen2023-03-101-149/+322
| | | | This will help in a later commit to separate userspace from EFI builds.
* missing: add fsmount() syscall fallback definitionLennart Poettering2023-03-091-0/+1
|
* meson.build: check udev rules using udevadm verifyDmitry V. Levin2023-03-081-0/+7
| | | | | | Although udev rules are already being checked by rule-syntax-check.py script, also check them using udevadm verify which performs more thorough checks.
* dissect: implement external helper plugin interface for /bin/mountLennart Poettering2023-03-061-0/+4
| | | | | | | | | | | With this change we'll install a symlink /sbin/mount.ddi → systemd-dissect. If invoked that way we'll do the equivalent of systemd-dissect --mount. This makes DDIs mountable directly via the "mount" command, by specifying the "-t ddi" pseudo file system type. Moreover you can now mount DDIs directly via /etc/fstab, by specifying "ddi" in the file system column (3rd column).
* Include <threads.h> if possible to get thread_local definitionCristian Rodríguez2023-03-061-0/+1
| | | | | | | | | | | | IN C23, thread_local is a reserved keyword and we shall therefore do nothing to redefine it. glibc has it defined for older standard version with the right conditions. v2 by Yu Watanabe: Move the definition to missing_threads.h like the way we define e.g. missing syscalls or missing definitions, and include it by the users. Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
* meson: show options about tests in the summaryYu Watanabe2023-03-031-0/+2
|
* meson: Copy files with git only in true git repositoryMichal Koutný2023-03-021-1/+1
| | | | | | | | | | | | | When mkosi is run from git-worktree(1), the .git is not a repository directory but a textfile pointing to the real git dir (e.g. /home/user/systemd/.git/worktrees/systemd-worktree). This git dir is not bind mounted into build environment and it fails with: > fatal: not a git repository: /home/user/systemd/.git/worktrees/systemd-worktree > test/meson.build:190:16: ERROR: Command `/usr/bin/env -u GIT_WORK_TREE /usr/bin/git --git-dir=/root/src/.git ls-files ':/test/dmidecode-dumps/*.bin'` failed with status 128. There is already a fallback to use shell globbing instead of ls-files, use it with git worktrees as well.
* Merge pull request #26528 from keszybz/valgrind-simplificationYu Watanabe2023-02-221-3/+0
|\ | | | | Drop the -Dvalgrind configuration option
| * meson: merge our two valgrind configuration conditions into oneZbigniew Jędrzejewski-Szmek2023-02-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the support for valgrind was under HAVE_VALGRIND_VALGRIND_H, i.e. we would enable if the valgrind headers were found. The operations then we be conditionalized on RUNNING_UNDER_VALGRIND. But in a few places we had code which was conditionalized on VALGRIND, i.e. the config option. I noticed because I compiled with -Dvalgrind=true on a machine that didn't have valgrind.h, and the build failed because RUNNING_UNDER_VALGRIND was not defined. My first idea was to add a check that the header is present if the option is set, but it seems better to just remove the option. The code to support valgrind is trivial, and if we're !RUNNING_UNDER_VALGRIND, it has negligible cost. And the case of running under valgrind is always some special testing/debugging mode, so we should just do those extra steps to make valgrind output cleaner. Removing the option makes things simpler and we don't have to think if something should be covered by the one or the other configuration bit. I had a vague recollection that in some places we used -Dvalgrind=true not for valgrind support, but to enable additional cleanup under other sanitizers. But that code would fail to build without the valgrind headers anyway, so I'm not sure if that was still used. If there are uses like that, we can extend the condition for cleanup_pools().
* | meson: Use dicts for fuzzer definitionsJan Janssen2023-02-211-13/+14
| |
* | meson: Add simple_fuzzers listJan Janssen2023-02-211-0/+5
| |
* | meson: Use dicts for test definitionsJan Janssen2023-02-211-43/+33
| | | | | | | | | | | | | | Although this slightly more verbose it makes it much easier to reason about. The code that produces the tests heavily benefits from this. Test lists are also now sorted by test name.
* | meson: Add simple_tests listJan Janssen2023-02-211-0/+5
|/ | | | | | A lot of tests can be defined by just their filename. Moving into their own list keeps things simpler, especially with the next commit. It also makes it easier to keep the lists sorted.
* vconsole: allow setting default keymap through build optionMike Yuan2023-02-151-0/+3
| | | | | | | Allow defining the default keymap to be used by vconsole-setup through a build option. A template vconsole.conf also gets populated by tmpfiles if it doesn't exist.
* meson: enable -Wzero-length-boundsZbigniew Jędrzejewski-Szmek2023-02-061-0/+1
| | | | | | This will warn if fake flexible arrays are re-introduced. I'm not using -Werror=… because we may still get warnings when compiling against old kernel headers. We can crank this up to error later.
* meson: enable -Warray-bounds and -fstrict-flex-arraysZbigniew Jędrzejewski-Szmek2023-02-061-0/+4
| | | | | | | | | | | | | | | | | -fstrict-flex-arrays means that the compiler doesn't have to assume that any trailing array is a flex array. I.e. unless the array is declared without a specified size, only indices in the declared range are valid. -Warray-bounds turns on the warnings about out-of-bounds array accesses. -Warray-bounds=2 does some more warnings, with higher false positive rate. But it doesn't seem to yield any false positives in our codebase, so enable it. clang supports -Warray-bounds, but not -Warray-bounds=2. gcc supports both. gcc-13 supports -fstrict-flex-arrays. See https://people.kernel.org/kees/bounded-flexible-arrays-in-c for a long discussion of use in the kernel.
* core: split system/user job timeouts and make them configurableZbigniew Jędrzejewski-Szmek2023-02-011-1/+4
| | | | | | | | | | | | | | | | Config options are -Ddefault-timeout-sec= and -Ddefault-user-timeout-sec=. Existing -Dupdate-helper-user-timeout= is renamed to -Dupdate-helper-user-timeout-sec= for consistency. All three options take an integer value in seconds. The renaming and type-change of the option is a small compat break, but it's just at compile time and result in a clear error message. I also doubt that anyone was actually using the option. This commit separates the user manager timeouts, but keeps them unchanged at 90 s. The timeout for the user manager is set to 4/3*user-timeout, which means that it is still 120 s. Fedora wants to experiment with lower timeouts, but doing this via a patch would be annoying and more work than necessary. Let's make this easy to configure.
* Merge pull request #26236 from medhefgo/meson-fixesZbigniew Jędrzejewski-Szmek2023-02-011-8/+3
|\ | | | | meson: Fixes
| * meson: Remove unused variablesJan Janssen2023-01-271-8/+3
| |
* | meson: fail build on implicit int warningsZbigniew Jędrzejewski-Szmek2023-02-011-0/+1
| |
* | ukify: don't install ukify man page if ukify is not enabledFrantisek Sumsal2023-01-311-14/+15
|/ | | | | | | Checking for gnu-efi is not enough, since ukify can be explicitly disabled. Resolves: #26274
* meson: bump numbers for v253-rc1Luca Boccassi2023-01-241-3/+3
|
* meson: Use python module for detectionJan Janssen2023-01-231-7/+3
|
* meson: Move bootctl sources defintion to its own fileJan Janssen2023-01-231-18/+2
| | | | The root meson.build file is already large enough.
* ukify: Downgrade required python version to 3.9Daan De Meyer2023-01-201-6/+6
|
* bootctl: unlink and cleanup functionsLudwig Nussel2023-01-191-0/+1
| | | | | | | | | | The unlink command removes an entry from the ESP including referenced files that are not referenced in other entries. That is useful eg to have multiple entries that use the same kernel with different options. The cleanup command removes all files that are not referenced by any entry.
* meson: ukify depends on GNU_EFILudwig Nussel2023-01-191-18/+18
| | | | | ukify is rather efi specific and the manpage is already conditional on HAVE_GNU_EFI so make the program also depend on HAVE_GNU_EFI