264 Commits
Author SHA1 Message Date
George Zogopoulos 6fb3bf6767 waf: Remove --enable-custom-controller flag
It will be served by the custom build server from now on.
2026-07-10 10:14:26 +10:00
Pierre KancirandClaude Fable 5 56705e5755 waf: do not let generated build option aliases shadow explicit options
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>
2026-06-20 12:38:49 +10:00
Pierre Kancir 421f90aa37 wscript: add directive to build scripting docs 2026-06-17 14:36:22 +10:00
Peter BarkerandClaude Opus 4.8 59fda7527a waf: compile DroneCAN generated sources once into a shared target
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>
2026-06-09 10:19:52 +10:00
Christian Clauss 26f27f5d68 waf: Drop support for end-of-life Python 3.8 2026-03-31 10:08:52 -05:00
Peter Barker 805409e3cb waf: add boards dynamically for SITL (i.e. hwdefs) 2026-01-14 09:43:22 +11:00
Thomas Watson 5c15ae261c ardupilotwaf: force versions when consistent builds are enabled
Avoids the need to specify manually in environment variables.
2025-11-04 12:55:57 +11:00
Thomas Watson 1c74832764 ardupilotwaf: memorize consistent build flag in configure stage 2025-11-04 12:55:57 +11:00
Thomas Watson 90309858cb ardupilotwaf: only use gccdeps source header dependency scanner
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.
2025-11-04 12:04:06 +11:00
Peter Barker ddcee62551 waf: create an abstract base class for linux boards
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.
2025-11-01 10:46:28 -05:00
Peter Barker 7e41eb4bdd waf: suppress help output on all-lower-case-and-dashes options 2025-07-07 19:33:21 -05:00
Peter Barker f6de8ae66f waf: accept entirely lower case values for BUILD_OPTIONS options 2025-07-07 19:33:21 -05:00
Thomas Watson 98fe3547fa ardupilotwaf: drop subprocess monkeypatching for unsupported Python
Not needed now that minimum Python is 3.8.
2025-07-06 20:01:10 -05:00
Thomas Watson 6a0893479f ardupilotwaf: belt-and-suspenders Python version check
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.
2025-07-06 20:01:10 -05:00
Christian Clauss dc9446af62 wscript: Add # flake8: noqa linter directive 2025-06-20 20:30:15 +10:00
Thomas Watson 8ef0c22295 ardupilotwaf: require minimum Python 3.8
Makes the comment accurate. Python 3.8 is shipped in Ubuntu 20.04 focal
by default so we can't move past until that goes EOL.
2025-06-19 21:27:25 +10:00
Stephen Dade 850c124e19 Waf: Allow DDS to be enabled via hwdef 2025-05-21 17:20:38 +10:00
Pierre Kancir bf026e8242 wscript: print CI group tag on CI 2025-05-07 10:51:32 +10:00
Andrew Tridgell 62fadb915c waf: allow --embed-XXX on configure
allows embedding of any lua driver or applet in the tree into ROMFS
2025-05-06 13:58:34 +10:00
Peter Barker 41b5f796b5 waf: remove Python print_function import 2025-02-26 10:06:11 +11:00
Huibean 57e98e2b16 Waf:add --vs-launch 2025-01-22 18:23:57 +11:00
Thomas Watson a93f51d631 wscript: only build littlefs if called for 2025-01-21 11:10:31 +11:00
Andy Piper da74370fdd wscript: address review comments 2025-01-21 11:10:31 +11:00
Andy Piper a2de66b8d2 wscript: add littlefs build option for sitl 2025-01-21 11:10:31 +11:00
Andy Piper 35b6dd9814 wscript: build in littlefs 2025-01-21 11:10:31 +11:00
bugobliterator 93d99ece0a Tools:waf: add option to build IOMCU firmware with profiled support 2024-11-20 19:12:44 +11:00
Ryan Friedman 0725109d1c waf: Fail if custom hwdef file doesn't exist
Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
2024-10-27 11:42:28 +11:00
Andrew Tridgell b2b9226863 waf: allow any custom build option to be specified in waf configure
this makes it easy to configure with any option from build_options.py
2024-09-11 16:11:22 +10:00
bugobliterator b93ba1ae68 waf: add support for generating compile_commands.json 2024-06-19 17:11:46 +10:00
Andrew Tridgell 93f1bb576b waf: added --enable-new-checking option
this allows CI to check for violations of new, calling without
NEW_NOTHROW
2024-06-04 09:20:21 +10:00
Andrew Tridgell c097cd7fb9 waf: cope with CI python oddity 2024-05-08 18:28:59 +10:00
Peter Barker 7f1a551364 waf: factor out a vehicles array
most elements duplicated for sitl, linux and ChibiOS
2024-04-17 18:10:24 +10:00
Oleksiy Protas 4e21dbcc0b waf: Detect board class by inheritance instead of naming 2024-04-06 09:45:01 +11:00
Andrew Tridgell 38b5d942fd waf: avoid trying to compile .github directory as DSDL 2024-02-11 16:48:52 +11:00
Joshua Henderson f1ca5bea49 waf : wscript add submoduleclean & submodule_force_clean 2024-01-17 07:41:44 +11:00
Andrew Tridgell d26530c892 waf: added --enable-ppp option 2024-01-03 12:14:47 +11:00
Andrew Tridgell 468c532290 waf: recurse info AP_Networking 2024-01-03 12:14:47 +11:00
Peter Barker aa9bbd0fcb waf: invert ekf2-disable command-line option 2023-11-27 09:05:08 +11:00
Andrew Tridgell aec605b020 waf: enable networking by default when supported, and disable with --disable-networking 2023-11-17 10:54:24 -08:00
Ryan Friedman c09352102e waf: Improve help text for network tests
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-11-15 21:30:27 -08:00
Andrew Tridgell c4cf3268cb waf: added --enable-networking and --enable-networking-tests 2023-11-15 12:43:41 -08:00
Andrew Tridgell 1d05196b52 waf: moved SKETCHBOOK to AP_BUILD_ROOT in ap_version.h 2023-10-25 09:50:08 +11:00
Michelle Rossouw a900921f95 wscript: Add recurse into SITL library 2023-08-12 10:49:02 +10:00
Andy Piper ec02ac9378 wscript: recurse into AP_HAL_SITL 2023-08-02 16:22:59 +01:00
Peter Barker 46b262cb32 waf: tidy interpretation of -Werror 2023-08-01 11:31:07 +10:00
Peter Barker 35d7561c50 waf: allow AP_SCRIPTING_ENABLED to come from hwdef files 2023-06-09 16:10:52 +10:00
Ryan Friedman a32f429e23 waf: Preserve default to werr off on CLI
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-06-05 09:09:13 +10:00
Ryan Friedman fd10bc35f0 waf: Fix disable werror to actually work
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-06-05 09:09:13 +10:00
Ryan Friedman ae20754ab9 waf: Enable Werror by default and add option to disable it
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
2023-06-05 09:09:13 +10:00
Randy Mackay 49b9b0393e waf: revert run Tools/gittools/submodule-sync.sh at distclean
This reverts commit 22c1470aca
2023-05-31 18:44:35 +10:00