colcon / colcon-core

Command line tool to build sets of software packages
http://colcon.readthedocs.io
Apache License 2.0
107 stars 46 forks source link

`colcon build` executor not affecting `make -j` command #657

Open YossiO-BWR opened 4 months ago

YossiO-BWR commented 4 months ago

Issue

When trying to limit the building threads with either colcon build --parallel-workers 2 or colcon build --executor sequential, the underlying make command is still called with the number of available threads.

In catkin build we had the --jobs and --parallel-packages parameters.

In colcon build the executor seems to be similar to the --parallel-packages parameter.

image

image

Desired behavior

--jobs parameter to catkin build

-j JOBS, --jobs JOBS Maximum number of build jobs to be distributed across active packages. (default is cpu count)

Possible workaround

Using export MAKEFLAGS="-j2" seems to limit the number of jobs per package image

Other ideas are welcome, to the point of manually modifying the colcon_core/../build.py

christophebedard commented 4 months ago

See https://github.com/colcon/colcon-parallel-executor/issues/36