This is a proof of concept for one potential (limited) version of parallelization which doesn't require complex implementation and doesn't put the number of CPUS into the cache key (and break caching across machines, the way using --action_env=CMAKE_BUILD_PARALLEL_LEVEL). This is not fully implemented in this MR, known things that are missing:
1) Windows and FreeBSD don't have impls because I'm not currently sure what to put there.
2) The ability to enable and disable this on a per-target basis is not currently implemented and is probably necessary (since otherwise, this would be a bit of a compat break, and it's not uncommon for projects to break under parallelization). I'm open to suggestions on the best way to plumb this.
This is a proof of concept for one potential (limited) version of parallelization which doesn't require complex implementation and doesn't put the number of CPUS into the cache key (and break caching across machines, the way using
--action_env=CMAKE_BUILD_PARALLEL_LEVEL
). This is not fully implemented in this MR, known things that are missing: 1) Windows and FreeBSD don't have impls because I'm not currently sure what to put there. 2) The ability to enable and disable this on a per-target basis is not currently implemented and is probably necessary (since otherwise, this would be a bit of a compat break, and it's not uncommon for projects to break under parallelization). I'm open to suggestions on the best way to plumb this.This might eventually implement a simplified form of https://github.com/bazelbuild/rules_foreign_cc/issues/329
@jsharpe I know you did some similar work on this in https://github.com/bazelbuild/rules_foreign_cc/issues/848; do you think an approach like this would be mergeable (if we figured out good ways of doing the TODOs above?)