Skip to content

systemd: introduce more options for a more minimal build #101886

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

Merged
merged 28 commits into from
Nov 1, 2020

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Oct 28, 2020

Motivation for this change

Paired with @andir on this. Apart from some cleanups, this adds some more flags to the systemd derivation, both cutting down the runtime and build closure size of systemdMinimal.

Sizes:

Before:
/nix/store/mckmzpwswm0zhq1i7xhbzn6jbhf9j2zk-systemd-minimal-246.6                 16.1M
After:
/nix/store/xgabn4cyxy68cg17m18f6zq93xin06x2-systemd-minimal-246.6         10.0M
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@andir
Copy link
Member

andir commented Oct 28, 2020

I rebased this on current staging so that the test sets eval

@andir andir force-pushed the systemd-more-optional branch from b9d20b6 to e4f5694 Compare October 28, 2020 09:04
@andir
Copy link
Member

andir commented Oct 28, 2020

Rebased once more as @flokli broke staging by merging #101780 which wasn't a complete change...

@flokli
Copy link
Contributor Author

flokli commented Oct 28, 2020

Yeah, I didn't intend to, and the feedback cycle/general story on staging isn't good.

flokli added 17 commits October 28, 2020 23:24
This is a no-op and makes things a bit smaller.
These are all unconditianally anyways.
This was only used to patch a circular output reference from lib to out
on aarch64, but was removed in b68bddf,

This commit forgot to remove perl, so remove it now.
upstreams TODO mentions iptables-dev (libiptc) is also used for nspawn,
but it seems like it only makes use of this via networkd anyways (or
does these days) - at least systemdMinimal compiles successfully without
iptables in the build closure.
This makes curl optional if both remote and importd are disabled, and
makes some assertions more robust by switching from curl.dev != null to
lib.getDev curl != null.
use lib.getDev to retrieve the dev output. Don't pass it to buildInputs
if we don't build with withCryptsetup set to true.
This will build systemd without some compression utils, useful for
systemdMinimal.
This is already configurable above.
… and default it to false for systemdMinimal
@flokli flokli force-pushed the systemd-more-optional branch from f8f036e to 6dbc23e Compare October 28, 2020 22:25
@flokli
Copy link
Contributor Author

flokli commented Oct 28, 2020

This was rebased once again to include #101843.

@ajs124 ajs124 mentioned this pull request Oct 31, 2020
10 tasks
, withNss ? true
, withPCRE2 ? true
, withPolkit ? true
, withRemote ? false # has always been disabled on NixOS, upstream version appears broken anyway
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 20.03, the systemd-journal-gatewayd feature was working fine and we have an option in the NixOS module to enable it. Note the systemd-journal-gatewayd is turned off when the REMOTE option is false.
So, i think we should enable it by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with enabling more features here, if we disable it in systemdMinimal and have tests ensuring its functionality :-)

@Ericson2314
Copy link
Member

I like the idea of this. CC @kloenk

@flokli flokli merged commit d64f4d0 into NixOS:staging Nov 1, 2020
@flokli flokli deleted the systemd-more-optional branch November 1, 2020 13:29
@flokli flokli mentioned this pull request Nov 1, 2020
10 tasks
@Ericson2314 Ericson2314 mentioned this pull request Nov 2, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants