Skip to content

Conversation

@tpwrules
Copy link
Contributor

@tpwrules tpwrules commented Nov 1, 2025

waf has built in logic to scan your source files and automatically add dependencies on the included files. It also supports using GCC to do this.

Long long ago:

But today, seven years later, essentially nobody works with such old branches and nobody's run into issues with GCC's scanner. So we can remove the option to switch to waf's scanner then delete the complex logic from #4590 which has been disabled by default for seven years and only helped waf's scanner anyway.

Confirmed that there is no performance reduction and no compiler output change.

Timings of CubeOrange copter build:

      before, fresh git tree, gccdeps: 2m3s
      before, `./waf clean`,  gccdeps: 2m2s
      before, fresh git tree, default: 2m26s
      before, `./waf clean`,  default: 2m2s
    
      after,  fresh git tree, gccdeps: 2m3s
      after,  `./waf clean`,  gccdeps: 2m3s

Due to the slowness of waf's source header dependency scanner, logic was
introduced to avoid deleting the results during a `./waf clean`.
However, this logic has not done anything since switching to the gccdeps
scanner (to speed scanning up) many years ago. That overrides the
`sig_implicit_deps` method too and results in
`_original_sig_implicit_deps != real_fn` always being true and the
custom logic never activating.

There's little reason to use the default dependency scanner anymore.
Since the logic is complex, not necessary, and doesn't work in that
case, just delete it.

Timings of CubeOrange build:

  before, fresh git tree, gccdeps: 2m3s
  before, `./waf clean`,  gccdeps: 2m2s
  before, fresh git tree, default: 2m26s
  before, `./waf clean`,  default: 2m2s

  after,  fresh git tree, gccdeps: 2m3s
  after,  `./waf clean`,  gccdeps: 2m3s
  after,  fresh git tree, default: 2m28s
  after,  `./waf clean`,  default: 2m27s
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.
@tridge tridge merged commit 9030985 into ArduPilot:master Nov 4, 2025
107 of 108 checks passed
@tpwrules tpwrules deleted the pr/waf-deps-cleanup branch November 4, 2025 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants