New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd: Make build options configurable #53222
Conversation
The binary closure for systemd is quite large in the default configuration. This patch provides a simple way to turn off build options that aren't needed by some users, removing the corresponding dependencies. It also makes it easy to turn on additional features that NixOS doesn't enable by default. Since doCheck was disabled, this commit also disables building tests by default. If the caller requests building tests, then doCheck will be turned on as well. The tests are probably still just as broken as they were before, but if someone wants to try them, they can build with features.tests=true. The build log from this version is identical to the build log from the previous version, with the following exceptions: - Store paths vary, of course. - Configure messages like "Dependency libselinux found: NO" are gone; the corresponding checks are explicitly disabled now. - Tests aren't built since we don't run them. - The build phase compiles files in different orders due to parallel build. - The install and fixup phases touch files in different orders, but they touch all the same files. Also, the same set of paths appear in each output before and after this patch. Their contents differ due to varying store paths so I haven't checked if there are more subtle differences, but based on the above results I suspect they're equivalent.
"-Dpkgconfigdatadir=$dev/share/pkgconfig" | ||
"-Dpkgconfiglibdir=$dev/lib/pkgconfig" | ||
"-Drootlibdir=$lib/lib" | ||
"-Drootprefix=$out" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using placeholder of nix2 this could be moved to mesonFlags
in order to avoid escaping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing! I don't know what that means though. Can you give an example or point me at the right documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Derivation attributes can now reference the outputs of the derivation using the placeholder builtin function. For example, the attribute
configureFlags = "--prefix=${placeholder "out"} --includedir=${placeholder "dev"}";
will cause the configureFlags environment variable to contain the actual store paths corresponding to the out and dev outputs.
@jameysharp any motivation to continue with this PR? From other PRs of yours I'm assuming this PR still has significant value to you. |
Yes! I've been meaning to get back to it. I think the comments about using |
I like this PR as well and wish it would get merged. |
Also, I'd vote for adding another build flavor for systemd in |
Sorry, seems I missed this PR. Has this been solved by #98998 (and the subsequent PRs)? |
I marked this as stale due to inactivity. → More info |
Let's close this. It has probably been addressed in other PRs in the meantime, and there was no reaction on #53222 (comment). |
Motivation for this change
The binary closure for systemd is quite large in the default configuration. This patch provides a simple way to turn off build options that aren't needed by some users, removing the corresponding dependencies. It also makes it easy to turn on additional features that NixOS doesn't enable by default.
Since
doCheck
was disabled, this commit also disables building tests by default. If the caller requests building tests, thendoCheck
will be turned on as well. The tests are probably still just as broken as they were before, but if someone wants to try them, they can build withfeatures.tests=true
.Things done
The build log from this version is identical to the build log from the previous version, with the following exceptions:
The
man
output's closure size is 8 bytes bigger (a less gzip'able store path in a man page somewhere, I guess?) but the other outputs have identical closure sizes.Also, the same set of paths appear in each output before and after this patch. Their contents differ due to varying store paths so I haven't checked if there are more subtle differences, but based on the above results I suspect they're equivalent.
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)