add_build_options() registers an all-lower-case alias of every
generated --enable-X/--disable-X build option with SUPPRESS_HELP. The
option parser is created with conflict_handler='resolve', so when such
an alias collides with an option explicitly defined in wscript
(--enable-scripting, --disable-scripting, --disable-networking) the
alias replaces it and its help text silently disappears from
./waf --help, leaving only orphaned description lines from the
neighbouring generated options.
Skip adding the alias when an option with that name already exists:
the explicit definition keeps its visible help and the flag remains
accepted either way.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Each ap_stlib() defaulted to dynamic_source globbing the libcanard
dsdlc_generated/src/**.c files into itself, so every vehicle, tool,
test and example static library compiled the same generated sources.
waf names an object as "<source-name>.<idx>.o" placed next to the
source node, where idx is unique only per wscript folder. The generated
sources live in a single shared directory, and most of these wscripts
create their stlib as the first task generator in their folder (idx==1),
so they all emit e.g. MagneticFieldStrength2.c.1.o into the same path.
A task's uid is computed from its class and input/output paths only (no
compiler flags), so waf treats the colliding compile tasks as identical
and runs them anyway. With many static libraries built in parallel, one
library's archive (ar) step can read one of these object files while
another library's compile task is still writing it, giving intermittent
"ar: ... file truncated" failures. This showed up with clang in CI,
where compile timing widens the race window.
Compile the generated sources exactly once into a shared 'dronecan_libs'
objects target and pull it into each stlib via 'use'. This gives each
generated object a single owning task and a single output path, removing
the collision entirely (verified: full SITL build graph drops from 528+
colliding object outputs to zero). It also avoids recompiling the
generated sources for every library.
AP_Periph and the bootloader pass an explicit dynamic_source and are
single-firmware builds with no such collision, so they are unchanged.
This change was made with AI assistance (Claude).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There is essentially no reason to use the slower default, the option to
do so was only added many years ago to smooth working with older
branches which did use the default.
But those haven't been around for a long time so just delete the option.
This resolves a some oddness where the "linux" target you might use when configuring is also (sort of) the same class used when inheriting when creating a Linux board (e.g. bbbmini).
The "linux" hwdef has gained all of the bits which makes a build that works on your laptop work.
Gives a comprehensible error message in case we start using 3.8-only
features in the main `wscript`.
Keep the check in `wscript` in the somewhat unlikely case that another
Python is discovered by waf.