Skip to content

Carla & CarlaTools plugins fail to compile under bUseUnityBuild=false (latent IWYU bugs) #9763

Description

@youtalk

Setup

  • CARLA version: ue5-dev @ 1aae09e (post-fix(streaming): make ServerSession::CloseNow idempotent on ue5-dev #9761)
  • Platform: Linux x86_64
  • Unreal Engine: 5.5 (CARLA fork)
  • Build config: bUseUnityBuild=false in ~/.config/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml
  • Targets affected: carla-unreal-editor (editor); the same files compile under bUseUnityBuild=true only because their unity-blob siblings transitively supply the missing headers.

Describe the bug
Four .cpp/.h files in the Carla and CarlaTools plugins rely on transitive includes pulled in by neighboring .cpp files in their unity blob. With bUseUnityBuild=false they fail to compile. Beyond the obvious "I can't build without unity" hit, this also penalizes ccache even under unity ON: small edits churn the unity blob composition and invalidate sibling translation units that don't truly depend on the edit.

Concrete errors (from a clean build with unity off):

Plugins/Carla/Source/Carla/BlueprintLibary/PostProcessJsonUtils.cpp:7
  #pragma once  -- stray, in a .cpp
  + use of FJsonObjectConverter / USceneCaptureComponent2D / FFileHelper
    / FPaths / IFileManager without the corresponding includes

Plugins/Carla/Source/Carla/BlueprintLibary/MeshToLandscape.cpp:345
  error: no matching function for call to 'LockRead'
  note: cannot convert argument of incomplete type 'FPhysScene *'
        (aka 'FPhysScene_Chaos *') to 'FChaosScene *'

Plugins/CarlaTools/Source/CarlaTools/Private/BlueprintLibrary/MeshToSplineActor.cpp:347
  error: no matching function for call to 'DestructItems'
  note: invalid application of 'sizeof' to an incomplete type 'FProcMeshTangent'

The bundled StreetMap plugin (carla-simulator/StreetMap, branch ue5-dev-carla) has the same class of bug in two more files (StreetMapImportBlueprintLibrary.cpp, StreetMapComponentDetails.cpp) and will be addressed by a companion PR in that repository.

Steps to reproduce

  1. Set bUseUnityBuild=false in ~/.config/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml.
  2. export CARLA_CCACHE=1 && cmake --preset Development && cmake --build Build/Development --target carla-unreal-editor
  3. Build fails on the files above.

Expected behavior
carla-unreal and carla-unreal-editor build green with bUseUnityBuild=false, so devs can iterate per-file and ccache can key on stable individual TUs.

Additional context
Fix only adds includes (and removes a stray #pragma once from a .cpp); no API or behavior change. PR to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions