Skip to content

Docker Makefile calls nproc which does not work on Windows #9894

@stephanegigandet

Description

@stephanegigandet

In Makefile, we have:

OS := $(shell uname)

[..]
ifeq ($(OS), Darwin)
  export CPU_COUNT=$(shell sysctl -n hw.logicalcpu || echo 1)
else
  export CPU_COUNT=$(shell nproc || echo 1)
endif

This fails on Windows because nproc is not available.

Instead we could use %NUMBER_OF_PROCESSORS% (it's unclear if those are physical or logical cores)

I'm not sure what's the returned value of uname is on Windows though, could someone test and add a condition on it so that we call this on Windows?

$(shell echo %NUMBER_OF_PROCESSORS%)

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    To discuss and validate

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions