mkosi: Move all mkosi configuration into mkosi/ subdirectory#36954
mkosi: Move all mkosi configuration into mkosi/ subdirectory#36954daandemeyer merged 4 commits intosystemd:mainfrom
Conversation
|
Fedora testing-farm: |
|
Linter is red. Also Ubuntu CI needs to be adjusted: |
* b17e5d64a1 Don't try to modify mkosi.repart config if mkosi conf is in subdir * e2b2ea3776 fmf: Use mkosi/mkosi.local.conf if the mkosi/ directory exists
Now that mkosi can automatically pick up its main configuration from a mkosi/ subdirectory if it exists and there is no configuration in the top level directory, let's make use of it to reduce the amount of clutter in the top level directory of the repository. This will also make it easier to install the mkosi configuration files as part of the testing packages later on.
Instead of always looking up two directories from the test/integration-tests/meson.build file, let's search in up to 4 parent directories from the given meson project source root. This allows us to just pass in meson.project_source_root() to integration-test-wrapper.py instead of having to pass in a fixed relative offset from the current meson file. It'll also allow us to install the integration tests and mkosi configuration in the future without breaking the standalone integrationt tests functionality;
|
@fbuihuu So this gets us a little futher again. It should now be possible to install_subdir() the integration-tests directory and the mkosi directory when |
Thank you!
May I ask which ones and why they can't be created in a directory specified in mkosi.conf such as
Initially the SUSE
|
They certainly can, this just requires some more work. Currently mkosi.key, mkosi.crt and mkosi.tools, mkosi.tools.manifest are created in a non configurable location. Also, even if these were configurable, you can't pass arbitrary mkosi command line options to meson. I figure we could ship a config dropin to automatically read more configuration from /etc/systemd/tests/mkosi so you could add configuration there.
So the thing is that even if we make the integration tests installable like this, mkosi almost completely isolates running the integration tests from the host on which the tests are running.
mkosi also takes care of this now so there's no need to encode dependencies required in the testsuite package. In fact it hurts us upstream because the systemd-testsuite is also installed inside the image, where we definitely don't want to pull in qemu and whatnot.
I doubt the size difference is big enough to make a noticeable difference. Please take a look at https://src.fedoraproject.org/rpms/systemd/blob/rawhide/f/plans/run-integration-tests.sh to see how we run the systemd integration tests against the official rpms built by the Fedora build infrastructure these days. Are you sure this can't work for your use case as well? |
It's 28M vs 95M. But yeah this doesn't really make a difference compare to the total size of the mkosi output files (> 5G).
I guess I don't really have the choice especially since it's been embraced by all other distros. |
I'm open to suggestions for improvements, the current setup definitely isn't perfect, for example I just realized that using the source rpm isn't exactly sufficient since patches aren't applied to the tarball. Maybe instead of explicitly requiring the systemd testsuite package to be "installed", we can just unpack it to a writable directory and run the tests from there. |
But I don't see why unpacking it would be better. Even if the files are installed in a read-only directory, they can still be used from a writable directory, it's just a matter of symlinking the relevant directories from the writable place, no? |
Sure but this is something we have to always keep in mind then when making changes. Also we'd have to specify some canonical location where those symlinks would point to. By just unpacking the systemd-tests rpm to some writable directory we'd avoid having to figure all of that out. Btw I need this myself now as well so doing some more work in #37046 |
Needed for systemd/systemd#36954 Gbp-Dch: ignore
…figs are in subdir Needed for systemd/systemd#36954 Gbp-Dch: ignore
systemd/systemd#36954 will move all the mkosi configuration in the systemd repository into a mkosi/ subdirectory. This means we have to put mkosi.local.conf in that subdirectory as well, so check if the mkosi/ directory exists and put mkosi.local.conf in there if it exists. The mkosi/ directory will conflict with our checkout of mkosi so we move that checkout one level up. Additionally, we can't use .. anymore as the package directory as that only works when mkosi.local.conf is in the top level directory of the repository so we use an absolute path instead.
Now that mkosi can automatically pick up its main configuration from
a mkosi/ subdirectory if it exists and there is no configuration in the
top level directory, let's make use of it to reduce the amount of clutter
in the top level directory of the repository.
This will also make it easier to install the mkosi configuration files as
part of the testing packages later on.