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

Shrink the ZFS closure by making mail support optional #109345

Merged
merged 3 commits into from Feb 10, 2021

Conversation

cole-h
Copy link
Member

@cole-h cole-h commented Jan 14, 2021

Motivation for this change

Fixes #83865.

# in a nixpkgs checkout
$ nix why-depends -f. zfs mariadb-connector-c
'/nix/store/7s4kkijwv4wd3sl6jgn20yjai8zvini6-zfs-user-2.0.0' does not depend on '/nix/store/1h8r94mfhlfqd2wxqqnzff5rhjbrpimf-mariadb-connector-c-3.1.8'

$ nix why-depends -f. zfs openssl.dev
'/nix/store/7s4kkijwv4wd3sl6jgn20yjai8zvini6-zfs-user-2.0.0' does not depend on '/nix/store/vrsxvbphmqnhz8fww6zv0fa5fi8xipy3-openssl-1.1.1i-dev'

$ nix why-depends -f. zfs mailutils
'/nix/store/7s4kkijwv4wd3sl6jgn20yjai8zvini6-zfs-user-2.0.0' does not depend on '/nix/store/yjj734x773ydfkz1qx1z640nni1gd9bm-mailutils-3.10'

# in my system flake
$ nixos-rebuild build --flake .#bootstrap &>/dev/null && nix why-depends ./result nixpkgs#openssl.dev
'/nix/store/y4mjgvnvrpjhkiz4kkla2m4pckmb399x-nixos-system-scadrial-21.03.20210113.dirty-cosmere' does not depend on '/nix/store/vrsxvbphmqnhz8fww6zv0fa5fi8xipy3-openssl-1.1.1i-dev
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.

There's probably a better way to do this, but at least this gets the ball rolling / starts the conversation. Pinged all the people who participated in the original issue.

TODO: write docs?

@cole-h
Copy link
Member Author

cole-h commented Jan 14, 2021

@ofborg test zfs

@@ -26,7 +27,7 @@ in stdenv.mkDerivation rec {
postPatch = "cp -v ${driverdb} drivedb.h";

configureFlags = [
"--with-scriptpath=${stdenv.lib.makeBinPath [ mailutils inetutils ]}"
"--with-scriptpath=${lib.makeBinPath ([ inetutils ] ++ lib.optional enableMail mailutils)}"
Copy link
Member

Choose a reason for hiding this comment

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

Does it even need inetutils when not enabling mail support? I can't think of another reason why smartmontools should talk to the network.

Copy link
Member Author

@cole-h cole-h Jan 14, 2021

Choose a reason for hiding this comment

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

The only inetutils binary it (maybe) uses is in update-smart-drivedb (ftp), which has a comment nearby of # OpenBSD. Say the word and I'll make them both optional; I don't know if that single use of ftp is worth "breaking" or not (considering it also supports curl, wget, svn, etc).

nixos/modules/tasks/filesystems/zfs.nix Show resolved Hide resolved
@cole-h
Copy link
Member Author

cole-h commented Jan 25, 2021

This is ready for review (basically just squashed everything). I'll write docs after the contents are approved to limit the amount of (potential) rewriting.

@@ -1,5 +1,6 @@
{ lib, stdenv, fetchurl, autoreconfHook
, mailutils, inetutils
, mailutils, enableMail ? true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
, mailutils, enableMail ? true
, enableMail ? true, mailutils

Comment on lines +11 to +12
, smartmontools, enableMail ? false
, sysstat, sudo, pkg-config
Copy link
Member

Choose a reason for hiding this comment

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

It is not clear for me which packages belong to enableMail.

Edit:

Maybe like this if we only need smartmontools.

Suggested change
, smartmontools, enableMail ? false
, sysstat, sudo, pkg-config
, sysstat, sudo, pkg-config
, enableMail ? false, smartmontools

"zed does not need the ability to send email by default" --Eelco
It's enabled by default since that's how it was before this change.
Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

LGTM though I haven't tested a thing.

@lheckemann lheckemann merged commit e4cf0e7 into NixOS:master Feb 10, 2021
@cole-h cole-h deleted the zfs-closure branch February 10, 2021 23:54
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.

zfs pulls in mailutils, mariadb-connector and openssl-dev
6 participants