Skip to content

util-linux: Fix build on non-Linux#244371

Closed
amarshall wants to merge 1 commit intoNixOS:stagingfrom
amarshall:util-linux-darwin-fix
Closed

util-linux: Fix build on non-Linux#244371
amarshall wants to merge 1 commit intoNixOS:stagingfrom
amarshall:util-linux-darwin-fix

Conversation

@amarshall
Copy link
Copy Markdown
Member

Build logs show:

configure: WARNING: non-linux system; not building mount
configure: WARNING: non-linux system; not building swapon

So skip these on non-Linux

See also:

Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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.

@Artturin
Copy link
Copy Markdown
Member

Artturin commented Jul 20, 2023

systemd needs to be changed to use getOutput to get outputs. example lib.getOutput "mount" pkgs.util-linux

should target staging https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#rebasing-between-branches-ie-from-master-to-staging

@Artturin Artturin marked this pull request as draft July 20, 2023 05:56
@amarshall amarshall force-pushed the util-linux-darwin-fix branch from 75d845c to 0df47d7 Compare July 20, 2023 12:11
@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/` 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. labels Jul 20, 2023
@amarshall amarshall changed the base branch from master to staging July 20, 2023 12:16
Build logs show:

> configure: WARNING: non-linux system; not building mount
> configure: WARNING: non-linux system; not building swapon

So skip these on non-Linux

See also:
- NixOS#244000
- aarch64-darwin: https://hydra.nixos.org/build/227974050
- x86_64-darwin: https://hydra.nixos.org/build/227804585
@amarshall amarshall force-pushed the util-linux-darwin-fix branch from 0df47d7 to c582f6e Compare July 20, 2023 12:27
@amarshall
Copy link
Copy Markdown
Member Author

@Artturin Done.

We could probably avoid the need for a mass rebuild by preserving the postInstall text content on Linux, but perhaps it’s not worth it.

How can I repro the need for lib.getOutput? Both it and just e.g. .mount eval okay for me and produce identical drvs.

@ofborg ofborg bot requested review from Mic92, flokli and kloenk July 20, 2023 16:03
@ofborg ofborg bot added 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jul 20, 2023
@Artturin
Copy link
Copy Markdown
Member

Artturin commented Jul 20, 2023

How can I repro the need for lib.getOutput? Both it and just e.g. .mount eval okay for me and produce identical drvs.

If you do .mount on a non Linux system it'll fail eval
getOutput will fallback to out so no eval fail.

Though now that I think about it it would be better to put those behind isLinux to not have possibly broken paths, even if they're not used.
nixos is linux only so no need to change there.

@amarshall
Copy link
Copy Markdown
Member Author

If you do .mount on a non Linux system it'll fail eval

Sure, but systemd is meta.platforms = platforms.linux already, so isn’t it going to fail eval on non-Linux either way?

@Artturin
Copy link
Copy Markdown
Member

If you do .mount on a non Linux system it'll fail eval

Sure, but systemd is meta.platforms = platforms.linux already, so isn’t it going to fail eval on non-Linux either way?

Hmm yeah true, but the ofborg eval was failing with a systemd issue.

@Artturin
Copy link
Copy Markdown
Member

Artturin commented Jul 20, 2023

Made a pr which can go in to master #244544, you can pick the changes here and target master if you prefer.

@Artturin Artturin closed this Jul 20, 2023
@Artturin
Copy link
Copy Markdown
Member

Merged to master. Thanks for the pr.

@amarshall amarshall deleted the util-linux-darwin-fix branch July 23, 2023 23:04
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 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants