Skip to content

fix(LibCarla/cmake): install ros2/dds/ headers in server cmake for Windows builds - #9666

Merged
Blyron merged 1 commit into
carla-simulator:ue4-devfrom
JArmandoAnaya:fix/windows-dds-header-install
Apr 10, 2026
Merged

fix(LibCarla/cmake): install ros2/dds/ headers in server cmake for Windows builds#9666
Blyron merged 1 commit into
carla-simulator:ue4-devfrom
JArmandoAnaya:fix/windows-dds-header-install

Conversation

@JArmandoAnaya

@JArmandoAnaya JArmandoAnaya commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Description

PR #9644 added #include "carla/ros2/dds/DDSMiddleware.h" to ROS2.h for the new Enable(bool, DDSMiddleware) signature, but did not update the server cmake header install list. This breaks the Windows CI build with:

carla/ros2/ROS2.h(13): fatal error C1083: cannot open include file:
    'carla/ros2/dds/DDSMiddleware.h': No such file or directory

Why this only affects Windows: LibCarla headers are installed to CarlaDependencies/include/ via two different cmake paths:

  • Linux (make LibCarla ARGS="--ros2"): uses the ros2 build type, which delegates header installation to cmake/fast_dds/CMakeLists.txt. That file already installs all ros2/ subdirectories, including ros2/dds/. Working correctly.
  • Windows (make LibCarla, no --ros2): uses the Server build type, which runs cmake/server/CMakeLists.txt. This file contains a manually maintained foreach loop that lists every subdirectory whose headers should be installed. It listed "ros2/" but not "ros2/dds/".

The UE4 plugin includes ROS2.h unconditionally (not behind #ifdef WITH_ROS2) from CarlaEngine.h, CarlaEpisode.h, ActorROS2Handler.h, and several sensor .cpp files. Before #9644, ROS2.h had no subdirectory dependencies, so the missing entry was not a problem.

Fix: add "ros2/dds/" to the server cmake foreach install loop, following the same pattern already used for other nested subdirectories ("opendrive/parser/", "road/element/", "streaming/detail/tcp/", etc.).

Why this must merge before #9645: PR #9645 (delete legacy FastDDS-generated types) cannot pass Windows CI until this header installation gap is fixed. The error is caused by code already merged in #9644, not by #9645 itself.

Where has this been tested?

  • Platform(s): Ubuntu 22.04
  • Python version(s): 3.10-3.12
  • Unreal Engine version(s): 4.26

Tests:

make LibCarla ARGS="--ros2"    # builds server, client, ros2 targets
make check.LibCarla            # 114/114 server + 56/56 client tests pass

Header installation verified:

CarlaDependencies/include/carla/ros2/dds/DDSMiddleware.h  (present after build)

Possible Drawbacks

None. This is a pure addition to the CMake install list. It cannot affect existing installs, only adds previously missing headers. The Linux build path is unaffected because it uses a separate CMake target (cmake/fast_dds/CMakeLists.txt) that already installs these headers.


This change is Reviewable

…ndows builds

ROS2.h unconditionally includes DDSMiddleware.h (added in carla-simulator#9644), but the
server cmake header install loop only listed ros2/, missing the ros2/dds/
subdirectory. On Linux this was masked because the ros2 build type installs
all headers via cmake/fast_dds/CMakeLists.txt. On Windows, only the server
cmake runs, causing a fatal C1083 include error in the UE4 plugin build.
@JArmandoAnaya
JArmandoAnaya requested a review from a team as a code owner April 10, 2026 01:26
@update-docs

update-docs Bot commented Apr 10, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update our CHANGELOG.md based on your changes.

@JArmandoAnaya

Copy link
Copy Markdown
Contributor Author

@LuisPovedaCano Hello, I'm creating this PR because I noticed that since PR #9644, there has been an issue building the Windows version of Carla. The issue looks like a minor problem, and a small change can resolve it. It is probably better to check whether this code change fixes the Windows build in GitHub CI before merging the PR #9645 to verify everything is correct.

@Blyron
Blyron merged commit 364fd34 into carla-simulator:ue4-dev Apr 10, 2026
2 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the fix/windows-dds-header-install branch April 10, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants