Ensure all paths used in usermod symlinks are fully resolved, including
any case correctness issues on Windows. Apparently PlatformIO does
not handle symlink files correctly on Windows if there are case
differences between cwd and the resolved path.
The ConfigureProjectLibBuilder process will flush and reload the library
settings from the on-disk manifests if any new library is installed at
that stage. This has the side effect of reverting the libArchive setting
applied to usermods which was performed prior to that call.
Apply the setting afterwards, instead.
Fixes#4597
Monkey-patch PlatformIO to intercept the build process after library
dependencies are loaded, but before the build is fully analyzed. This
lets us enforce libArchive=False for usermods without making that
setting global across all libraries.
The rest of the fixup code is integrated at the same call site for
simplicity.
Redesign the usermod system so that usermods are implemented as
PlatformIO libraries instead of headers. This permits them to call for
dependencies, and eliminates the compiler flags for enabling each one,
allowing the build cache to behave better.
The usermod list is built using some linker magic to construct a static
list in ROM memory. This eliminates the need for wasting SRAM on
something fixed at build time.