Add ability to override `build_machine.cpu()` in host == build configurations
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 1.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 33
Description
Currently, we don't have a mechanism to overide the build_machine.cpu() method, like we do with host_machine. This generally doesn't matter, but given that the host_machine.cpu() can only be overwritten when build != host (ie, cross compiling) there's no way to get finer grained cpu constraints in a host == build setup. This could either be done through a build_machine section in the native file, or with a command line argument.
It's important to differentiate this from cross compiling, as it may be important to specify the micro architecture of a build machine, like armv7 vs armv6, which cpu_family() will always return as arm.
See: https://github.com/NixOS/nix/pull/3160 for more details
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how host_machine.cpu() is overridden in cross-compiling configurations and how native files or command-line arguments are processed. Compare the proposed build_machine section and command-line approaches, then define tests for overriding build_machine.cpu() when host equals build while preserving the distinction from cross compilation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100