component_information: merge extra component_information_header target

With Makefile build, generate_component_general.py was called twice during
build, which did not happen with the ninja build.

This created a race condition with the following error in rare cases:
Traceback (most recent call last):
  File "/__w/PX4-Autopilot/PX4-Autopilot/src/lib/component_information/generate_component_general.py", line 79, in <module>
    save_compressed(filename)
  File "/__w/PX4-Autopilot/PX4-Autopilot/src/lib/component_information/generate_component_general.py", line 33, in save_compressed
    with open(filename, 'r') as content_file:
FileNotFoundError: [Errno 2] No such file or directory: '/__w/PX4-Autopilot/PX4-Autopilot/build/px4_sitl_default/component_general.json'
make[3]: *** [src/lib/component_information/CMakeFiles/component_information_header.dir/build.make:68: component_general.json] Error 1

Merging the targets avoids the duplicate execution.
This commit is contained in:
Beat Küng
2021-08-25 10:04:39 -04:00
committed by Daniel Agar
parent af53b60713
commit d8214f5e00
2 changed files with 8 additions and 15 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ px4_add_module(
module.yaml
DEPENDS
airspeed
component_information_header
component_general_json # for checksums.h
drivers_accelerometer
drivers_barometer
drivers_gyroscope