Skip to content

treewide: replace broken udev paths with systemd#268718

Merged
NickCao merged 1 commit intoNixOS:masterfrom
ners:udev
Nov 21, 2023
Merged

treewide: replace broken udev paths with systemd#268718
NickCao merged 1 commit intoNixOS:masterfrom
ners:udev

Conversation

@ners
Copy link
Copy Markdown
Member

@ners ners commented Nov 20, 2023

Description of changes

Currently, modules like usmbuxd are broken because they use an old path to /bin/udevadm. This PR fixes all instances of ${pkgs.udev}/bin/udevadm with the following rules:

  • NixOS modules can use ${config.systemd.package}/bin/udevadm
  • everything else can use ${pkgs.systemd}/bin/udevadm

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ners ners requested a review from joachifm as a code owner November 20, 2023 13:50
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 20, 2023
@ofborg ofborg bot requested review from NickCao, bramd and symphorien November 20, 2023 14:59
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 20, 2023
@NickCao
Copy link
Copy Markdown
Member

NickCao commented Nov 20, 2023

Does the eudev udevadm work with the systemd udevd?

@ners
Copy link
Copy Markdown
Member Author

ners commented Nov 21, 2023

@NickCao to the best of my knowledge, yes; it aims to be independent of the init system while maintaining compatibility. Perhaps we should find/add some NixOS tests for this.
At the very least, using ${pkgs.eudev}/bin/udevadm resolves to a file that exists. :)

@NickCao
Copy link
Copy Markdown
Member

NickCao commented Nov 21, 2023

@NickCao to the best of my knowledge, yes; it aims to be independent of the init system while maintaining compatibility. Perhaps we should find/add some NixOS tests for this. At the very least, using ${pkgs.eudev}/bin/udevadm resolves to a file that exists. :)

Still it feels strange that some udevadms are from systemd while others are from eudev, how about just use systemd, is the impact on closure size that big?

@NickCao
Copy link
Copy Markdown
Member

NickCao commented Nov 21, 2023

cc @NixOS/systemd

Also I believe the ${config.systemd.package}/bin/udevadm is uncontroversial, we can get that in first.

@ners
Copy link
Copy Markdown
Member Author

ners commented Nov 21, 2023

We can use systemdMinimal to minimise the closure size impact. I thought eudev might be a better fit for packages (rather than modules) to keep them init-system independent.

@NickCao
Copy link
Copy Markdown
Member

NickCao commented Nov 21, 2023

We can use systemdMinimal to minimise the closure size impact.

Maybe not #264163

And that PR suggests:

We replace systemdMinimal with: systemd, if systemd commands or udevadm is needed (bluez) or when systemd is already in the closure (dbus)

So simply systemd is the choice?

@ners ners changed the title treewide: replace broken udev/bin paths with systemd or eudev treewide: replace broken udev paths with systemd Nov 21, 2023
@ners
Copy link
Copy Markdown
Member Author

ners commented Nov 21, 2023

@NickCao excellent point. On closer look, I discovered that all instances where I initially used eudev, already had systemd as a dependency.

Copy link
Copy Markdown
Member

@NickCao NickCao left a comment

Choose a reason for hiding this comment

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

diff LGTM

@NickCao
Copy link
Copy Markdown
Member

NickCao commented Nov 21, 2023

@ofborg test hardened

@NickCao
Copy link
Copy Markdown
Member

NickCao commented Nov 21, 2023

@ofborg test stratis

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Nov 21, 2023
@NickCao
Copy link
Copy Markdown
Member

NickCao commented Nov 21, 2023

@ofborg test os-prober

@NickCao
Copy link
Copy Markdown
Member

NickCao commented Nov 21, 2023

Result of nixpkgs-review pr 268718 run on x86_64-linux 1

1 package blacklisted:
  • nixos-install-tools
6 packages built:
  • brltty
  • orca
  • os-prober
  • pantheon.elementary-session-settings
  • stratisd
  • stratisd.initrd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants