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

lm_sensors: fix build, split outputs, modernize and remove perl from library closure #373242

Merged
merged 6 commits into from
Jan 18, 2025

Conversation

oxalica
Copy link
Contributor

@oxalica oxalica commented Jan 12, 2025

  • Fix build with sensord = true on GCC 14.
  • Split outputs, so the library no longer depends on perl, removing perl from closure of its dependents (especially, htop).
  • Use tag = for fetchFromGitHub.
  • Use --replace-fail for substituteInPlace.
  • enableParallelBuilding = true

Unresolved:

  • Should we rename the package to lm-sensors (dash instead of underscore), because of the upstream project name? The code and docs seem to use lm_sensors and lm-sensors interchangeable. For reference, Arch and Fedora both use lm_sensors (underscore). I don't have a strong opinion about it.
  • Is the doc output really useful? It's done by manually cp -r configs doc/* <outdir> and it's not installed by upstream Makefile. The arch package does not install these files either. cc the introducer @peterhoeg

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 501-1000 labels Jan 12, 2025
pkgs/by-name/lm/lm_sensors/package.nix Outdated Show resolved Hide resolved
];

outputs = [
"bin"
Copy link
Member

Choose a reason for hiding this comment

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

5 outputs are a lot for such a small tool. We can probably drop the bin output without any impact

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The split of bin and out is the main purpose of this PR. It removes perl dependency for downstream packages that only want libsensors, which is the main use case from a quick search.
I personally want to remove "doc" but I want to wait for opinion from @ peterhoeg

pkgs/by-name/lm/lm_sensors/package.nix Show resolved Hide resolved
Copy link
Member

@mtoohey31 mtoohey31 left a comment

Choose a reason for hiding this comment

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

The fan2go changes lgtm. Thanks for improving the closure size!

@wegank wegank added 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package 12.approvals: 1 This PR was reviewed and approved by one reputable person labels Jan 12, 2025
Copy link
Contributor

@r-vdp r-vdp left a comment

Choose a reason for hiding this comment

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

Tested this and it seems to work well. Diff LGTM.

@oxalica are we good to merge this?

@oxalica
Copy link
Contributor Author

oxalica commented Jan 18, 2025

Tested this and it seems to work well. Diff LGTM.

@oxalica are we good to merge this?

Yes, it's ready, thanks. We can always remove "doc" output later if needed.

@r-vdp r-vdp merged commit 322147e into NixOS:master Jan 18, 2025
27 of 29 checks passed
@oxalica oxalica deleted the feat/lm-sensors-split branch January 18, 2025 23:29
assert sensord -> rrdtool != null;
let
version = "3.6.0";
tag = lib.replaceStrings [ "." ] [ "-" ] version;

Choose a reason for hiding this comment

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

Should this be "V3-6-0" rather than just "3-6-0"?

I'm getting the following error when trying to build from source:

trying https://github.com/lm-sensors/lm-sensors/archive/refs/tags/3-6-0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch! Filed #375622

@oxalica oxalica mentioned this pull request Jan 21, 2025
13 tasks
@fxzzi
Copy link
Contributor

fxzzi commented Jan 22, 2025

I think either this change or a different one relating to lm_sensors has broken the hardware.fancontrol option.

The service it creates exec's /nix/store/4r3d2jbp7c3rjpsa1x1y4xs6qj696mxc-lm-sensors-3.6.0-bin/sbin/fancontrol /nix/store/irri99z9vq2db39nx8phfwpv3i6is1vg-fancontrol.conf

but the sbin dir no longer exists, so it should be bin/fancontrol instead right?

@SuperSandro2000
Copy link
Member

yeah, probably. sbin has no special meaning in nixpkgs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 501-1000 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants