← All tasks
cppPX4/PX4-Autopilot #28298Not a task: not reproduced

gz_bridge: fallback "Gazebo dependencies not found" targets are never created

envgap__PX4__PX4-Autopilot-28298

01 / FAILURE SIGNATURE

As reported upstream

ninja: error: unknown target 'gz_x500'
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
e3480a1e37a0bbf604fd4185b2fa2060df006bb3
Manifest
src/modules/simulation/gz_bridge/CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

PX4/PX4-Autopilot #28298 · read the original issue
On a host without gz-transport installed (macOS set up with `./Tools/setup/macos.sh` without `--sim-tools`, or Ubuntu without Gazebo), `make px4_sitl gz_x500` fails with an unhelpful build-system error instead of the "Gazebo simulation dependencies not found" message that was added for exactly this case. The only hint is the configure-time `message(STATUS "Gazebo simulation bridge module disabled: missing dependencies")`, which is easy to miss in the cmake output.

```
$ make px4_sitl gz_x500
ninja: error: unknown target 'gz_x500'
```

ff7c636065a (#24661) added an `else()` branch to `if (gz-transport_FOUND)` in `src/modules/simulation/gz_bridge/CMakeLists.txt` that creates `gz_<model>` and `gz_<model>_<world>` fallback targets which print the error and fail. At that time the `file(GLOB gz_worlds ...)` and `file(GLOB gz_airframes ...)` lines sat above the `if`, so both branches saw populated lists. 05c529359652 (#25829) moved both globs inside the `gz-transport_FOUND` branch (now lines 48-49, right after `px4_add_git_submodule(TARGET git_gz ...)`) so the worlds glob runs after the submodule is initialised. As a side effect, in the `else()` branch (lines 140-166) `gz_airframes` and `gz_worlds` are empty, the nested `foreach` iterates nothing, and no fallback targets are created. There is no other definition of either variable in the tree.

Suggested fix: glob `gz_airframes` before the `if`, since it only reads `ROMFS/px4fmu_common/init.d-posix/airframes/*_gz_*` and does not depend on the submodule, and in the `else()` branch emit one `gz_<model>` fallback target per airframe without iterating over worlds. The worlds glob legitimately needs the submodule and can stay inside the found branch as #25829 intended.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]