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

tlp: Add support for non-x86 platforms #98618

Merged
merged 1 commit into from Oct 20, 2020
Merged

tlp: Add support for non-x86 platforms #98618

merged 1 commit into from Oct 20, 2020

Conversation

@jbaum98
Copy link
Contributor

@jbaum98 jbaum98 commented Sep 24, 2020

Before this commit, tlp won't build because it depends on
x86_energy_perf_policy which is only available on x86. This commit only
relies on x86_energy_perf_policy on systems where it is available,
allowing tlp to build on other systems like aarch64-linux.

Motivation for this change
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.
Before this commit, tlp won't build because it depends on
x86_energy_perf_policy which is only available on x86. This commit only
relies on x86_energy_perf_policy on systems where it is available,
allowing tlp to build on other systems like aarch64-linux.
] ++ lib.optional enableRDW networkmanager
++ lib.optional (lib.any (lib.meta.platformMatch stdenv.hostPlatform) x86_energy_perf_policy.meta.platforms) x86_energy_perf_policy
Copy link
Member

@lovesegfault lovesegfault Sep 24, 2020

Why do you need lib.any here? Why not just x86_energy_perf_policy.meta.platforms?

Copy link
Contributor Author

@jbaum98 jbaum98 Sep 24, 2020

My intention was to say that if the current platform matches any of the platforms supported by x86_energy_perf_policy, then include it, otherwise don't. So I guess lib.any is there because there are multiple platforms in x86_energy_perf_policy.meta.platforms.

Copy link
Member

@lovesegfault lovesegfault Sep 26, 2020

Understood, approved!

@lovesegfault
Copy link
Member

@lovesegfault lovesegfault commented Oct 20, 2020

Pinging @flokli for merging

@flokli flokli merged commit 76d6af3 into NixOS:master Oct 20, 2020
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants