Skip to content

Add number of processors as a make variable #988

@kayasoze

Description

@kayasoze

It would be nice if Bazel could compute the number of cores it is configured to use and make that available as a make variable. I have a number of Makefile based genrules which make use of make's -j, but the optimal value of -j varies from host to host. In particular, a high value of -j can massively slow build times by unnecessarily paging to swap. Querying the number of processors in a cross platform way is rather involved, and/or requires Python as a dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions