Advanced scripting: script wont run

Is it still true that it’s not possible to define a pre action to the buildprog target?
If so, why does the documentation Pre & Post Actions — PlatformIO latest documentation specifically use this as an example:

# Custom actions when building program/firmware
#

env.AddPreAction("buildprog", callback...)

Of course, I write here because I also fail to do this. Running the code directly in the extra script would mean I won’t get any advantages of SCons, such as only rebuilding when it’s necessary.

If this functionality is not of interest for PlatformIO, may I suggest:

  • Remove it as an example
  • Document that this is impossible
  • Make the build system emit a warning if someone adds a pre action to buildprog
1 Like