Nixpkgs: linux depends on utillinux

Created on 25 Jul 2019  路  8Comments  路  Source: NixOS/nixpkgs

since commit e8fcced76e7f076340cd742c7179b5f4d32f079c, linux 4.15 and up depend on on utillinux. as far as i can tell, it does not need this dependency.

https://github.com/NixOS/nixpkgs/pull/32137#discussion_r153458192 suggests that it was initially included for the eject binary, but i am not aware of that being a requirement and @ElvishJerricco reports that the kernel builds fine without the utillinux dependency.

furthermore, utillinux pulls in other unnecessary dependencies like systemd. if we truly need binaries which it provides, we should consider busybox as an alternative.

Most helpful comment

@pstn util-linux is under System utilities in docs instead of Kernel compilation. The derivation is to build the kernel image only.

I tried kernel 4.19 and 5.4, they are both built well without util-linux.
Since kernel 4.19 is the earliest version later than 4.15 in current nixos-unstable,
I'm not sure if it is really a dependency, for now.

All 8 comments

Also, if it turns out it is necessary, we should see if utillinuxMinimal would work instead, which would prevent e.g. the dep on systemd.

cc @pstn @dezgeg

util-linux is a minimal dependency as per kernel.org docs. At the time linux 4.15 wouldn't build without it, so i added it. If utillinuxMinimal is enough, I'm all for using it but I wouldn't blindly try it.

@pstn util-linux is under System utilities in docs instead of Kernel compilation. The derivation is to build the kernel image only.

I tried kernel 4.19 and 5.4, they are both built well without util-linux.
Since kernel 4.19 is the earliest version later than 4.15 in current nixos-unstable,
I'm not sure if it is really a dependency, for now.

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

still important to me

In #86208, we partially fix the issue by replacing utillinux with utillinuxMinimal. But seems this issue is missed by them, @arianvp @flokli

I still think we should better totally remove utillinux as dependency if it works, because even in currently latest docs,

util-linux is under System utilities in docs instead of Kernel compilation. The derivation is to build the kernel image only.

Note that in docs, utillinux is in parallel with e2fsprogs and jfsutils, which are obviously not kernel compilation dependencies.

@oxalica Thanks for the highlight - I wasn't aware of this issue.

https://github.com/NixOS/nixpkgs/pull/86208 stated:

With this change, the linux kernel (of which i don't fully understand
why it would depend on util-linux in the first place, but this was added in
https://github.com/NixOS/nixpkgs/pull/32137/files without too much
explanation) depends on the minimal version of util-linux too.

Looking at https://github.com/NixOS/nixpkgs/pull/32137/files#diff-aee78996e4a0d3c9af109b3dd4ae9ff7R245, utillinux (or now utillinuxMinimal) is only added for certain versions (>=4.15).

I assume we need to check for which version of the linux kernel it is required, and update the condition accordingly, so it's only included where it's needed.

Would you mind opening a PR updating the condition to do that, and see if you can still build all the linux_ attributes in nixpkgs?

fixed by #97294.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

copumpkin picture copumpkin  路  3Comments

retrry picture retrry  路  3Comments

sid-kap picture sid-kap  路  3Comments

ob7 picture ob7  路  3Comments

spacekitteh picture spacekitteh  路  3Comments