Skip to content
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: introduce more options for a more minimal build #101886

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.
@andir
Copy link
Member

@andir 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 Oct 28, 2020
@andir
Copy link
Member

@andir 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 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 Oct 28, 2020
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 Oct 28, 2020
@flokli
Copy link
Contributor Author

@flokli 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

@nlewo nlewo Oct 31, 2020

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

@flokli flokli Oct 31, 2020

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

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Oct 31, 2020

I like the idea of this. CC @Kloenk

arianvp
arianvp approved these changes Nov 1, 2020
@flokli flokli merged commit d64f4d0 into NixOS:staging Nov 1, 2020
19 of 20 checks passed
19 of 20 checks passed
@github-actions[bot]
tests
Details
@github-actions[bot]
action
Details
@ofborg[bot]
systemd, systemd.passthru.tests, systemdMinimal, systemdMinimal.passthru.tests on x86_64-darwin
Details
@ofborg[bot]
Evaluation Performance Report Evaluator Performance Report
Details
@github-actions[bot]
Wait for ofborg
Details
@ofborg[bot]
grahamcofborg-eval ^.^!
Details
@ofborg[bot]
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
@ofborg[bot]
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
@ofborg[bot]
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6dbc23e"; rev="6dbc23e75ddcf3f462f6a8b30f1ceea0a06c1403"; } ./pkgs/t
Details
@ofborg[bot]
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
@ofborg[bot]
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6dbc23e"; rev="6dbc23e75ddcf3f462f6a8b30f1ceea0a06c1403"; } ./nixos/
Details
@ofborg[bot]
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6dbc23e"; rev="6dbc23e75ddcf3f462f6a8b30f1ceea0a06c1403"; } ./nixos/
Details
@ofborg[bot]
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6dbc23e"; rev="6dbc23e75ddcf3f462f6a8b30f1ceea0a06c1403"; } ./nixos/
Details
@ofborg[bot]
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6dbc23e"; rev="6dbc23e75ddcf3f462f6a8b30f1ceea0a06c1403"; } ./pkgs/t
Details
@ofborg[bot]
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6dbc23e"; rev="6dbc23e75ddcf3f462f6a8b30f1ceea0a06c1403"; } ./pkgs/t
Details
@ofborg[bot]
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6dbc23e"; rev="6dbc23e75ddcf3f462f6a8b30f1ceea0a06c1403"; } ./pkgs/t
Details
@ofborg[bot]
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
@ofborg[bot]
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@ofborg[bot]
systemd, systemd.passthru.tests, systemdMinimal, systemdMinimal.passthru.tests on aarch64-linux Success
Details
@ofborg[bot]
systemd, systemd.passthru.tests, systemdMinimal, systemdMinimal.passthru.tests on x86_64-linux Success
Details
@flokli flokli deleted the systemd-more-optional branch Nov 1, 2020
@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
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants