Ask Your Question

colcon builds "in-source"

asked 2019-01-14 06:47:02 -0600

ipa-jba gravatar image

Opposed to the documentation provided here colcon build creates the output directories "log", "install" and "build" in place.

Considering I have packages in src the commands roscd <my_fancy_ros_package>; colcon build would create a workspace structure:

  - src
      - <my_fancy_ros_package>
          - build
          - log
          - install 
          - (other directories contained in <my_fancy_ros_packag> like "msg", "include" …

to have the output directories as peers of "src" I have to change directory up to "workspace" (roscd <my_fancy_ros_package>; cd ../..; colcon build

Are there any (undocumented) options I somehow set to disable out-out-source builds? I have the following colcon packages installed (from bouncy setup instructions as far as I remember)

python3-colcon-argcomplete/bionic,bionic,bionic,bionic,now 0.3.0-1 all [installed,automatic]
python3-colcon-bash/bionic,bionic,bionic,bionic,now 0.3.1-1 all [installed,automatic]
python3-colcon-bazel/bionic,bionic,bionic,bionic 0.1.0-1 all
python3-colcon-cmake/bionic,bionic,bionic,bionic,now 0.2.5-1 all [installed,automatic]
python3-colcon-common-extensions/bionic,bionic,bionic,bionic,now 0.2.0-2 all [installed]
python3-colcon-core/bionic,bionic,bionic,bionic,now 0.3.14-1 all [installed,automatic]
python3-colcon-defaults/bionic,bionic,bionic,bionic,now 0.2.1-1 all [installed,automatic]
python3-colcon-devtools/bionic,bionic,bionic,bionic,now 0.2.1-1 all [installed,automatic]
python3-colcon-library-path/bionic,bionic,bionic,bionic,now 0.2.0-1 all [installed,automatic]
python3-colcon-metadata/bionic,bionic,bionic,bionic,now 0.2.1-1 all [installed,automatic]
python3-colcon-mixin/bionic,bionic,bionic,bionic 0.1.1-1 all
python3-colcon-notification/bionic,bionic,bionic,bionic,now 0.2.5-1 all [installed,automatic]
python3-colcon-output/bionic,bionic,bionic,bionic,now 0.2.3-1 all [installed,automatic]
python3-colcon-package-information/bionic,bionic,bionic,bionic,now 0.2.1-1 all [installed,automatic]
python3-colcon-package-selection/bionic,bionic,bionic,bionic,now 0.2.1-1 all [installed,automatic]
python3-colcon-parallel-executor/bionic,bionic,bionic,bionic,now 0.2.2-1 all [installed,automatic]
python3-colcon-pkg-config/bionic,bionic,bionic,bionic,now 0.1.0-1 all [installed,automatic]
python3-colcon-powershell/bionic,bionic,bionic,bionic,now 0.3.3-1 all [installed,automatic]
python3-colcon-python-setup-py/bionic,bionic,bionic,bionic,now 0.2.1-1 all [installed,automatic]
python3-colcon-recursive-crawl/bionic,bionic,bionic,bionic,now 0.2.0-1 all [installed,automatic]
python3-colcon-ros/bionic,bionic,bionic,bionic,now 0.3.6-1 all [installed,automatic]
python3-colcon-test-result/bionic,bionic,bionic,bionic,now 0.3.0-1 all [installed,automatic]
python3-colcon-zsh/bionic,bionic,bionic,bionic,now 0.3.1-1 all [installed,automatic]

this happens with ros2 (bouncy) and ros1 (melodic) workspaces, regardless of which ROS_DISTRO is set

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-01-14 09:40:24 -0600

Dirk Thomas gravatar image

The documentation you referenced doesn't mention to invoke colcon build in the package directory but in the root of the workspace.

colcon doesn't support invoking the command in a subdirectory of the workspace (without providing custom paths to --build-base, --install-base, --log-base, --base-paths ) - see for the same feature request.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-01-14 06:47:02 -0600

Seen: 562 times

Last updated: Jan 14 '19