Commit Graph

62 Commits

Author SHA1 Message Date
Will Miles
2ab9659332 Speed up usermod validation
Avoid checking usermods we've already matched, and exit early if we've
got everything.

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-10 10:29:56 -04:00
Will Miles
3bfdb736e3 Fix usermod validation portability
Use proper path analysis instead of bare text matching.

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-10 10:11:44 -04:00
Will Miles
7f44396f7f validate_modules: Support LTO
When LTO is enabled, the map file no longer provides a positive
indication of whether a given object file has contributed to the final
binary.  Instead use nm to parse the debug data in the .elf file.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-08 10:04:38 -04:00
Will Miles
05498f2ae4 Apply fixes from code review
h/t @coderabbitai
2026-03-06 23:21:04 -05:00
Will Miles
19292675d8 Support lib_deps syntax in custom_usermods
Expand the parsing of custom_usermods to accept the same syntax as
lib_deps.  This allows external usermods to appear on the
custom_usermods lines.  Also includes comment handling.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-01 21:35:16 -05:00
Will Miles
ac1a4dfbfd validate_modules: Remove obsolete code 2026-03-01 19:27:14 -05:00
Will Miles
3bfbbab807 Formalize dynarray system
Break out the dynamic array macros to a re-usable component and fix
the implementation.
2026-02-28 22:47:48 -05:00
Will Miles
b97b46ae12 Use new section for dynamic arrays
Use a custom linker section to hold dynamic arrays such as the
usermod list.  This provides an extensible solution for wider use
in the future (such as FX or Bus drivers), as well as IDF v5
compatibility.
2026-02-28 22:47:48 -05:00
Will Miles
d538736411 Always use package.json for WLED_VERSION
Ensures consistency between UI and metadata; fixes release bin names.
2025-10-26 17:58:23 -04:00
Will Miles
b268aea0ab set_metadata: Apply code fixes from @coderabbit 2025-10-25 13:43:10 -04:00
Will Miles
a04d70293d Fix set_metadata script 2025-10-25 09:58:01 -04:00
Will Miles
5ca10f35d1 Process metadata only in metadata.cpp
Improves cache utilization as fewer things are passed via CFLAGS to
all files.  In the event that no metadata is available, let the cpp
file handle warning about default usage.
2025-10-06 21:52:16 -04:00
copilot-swe-agent[bot]
ed2b170e1b Fix set_repo.py to detect tracked remote instead of hardcoding origin
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-09-20 10:56:48 +00:00
copilot-swe-agent[bot]
e69bf4eceb Fix compilation error by properly escaping quotes in WLED_REPO build flag
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-09-19 22:50:20 +00:00
copilot-swe-agent[bot]
684224c614 Remove Python cache file and add __pycache__ to .gitignore
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-09-19 10:47:33 +00:00
copilot-swe-agent[bot]
9826197083 Improve error handling for missing git CLI
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-09-19 10:46:56 +00:00
copilot-swe-agent[bot]
efeb791807 Implement GitHub repo extraction in build process
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
2025-09-19 10:30:36 +00:00
Will Miles
368351bbdd Remove nonfunctional usermod validation
Non-platform-safe usermods are filtered out before validation runs;
so this check is no longer functional.
2025-06-18 12:10:00 -04:00
Will Miles
f9bfcce65d Fix disabled usermod presence validation
PlatformIO doesn't clean out the libdir when usermods are disabled, so
they still appear in the LibBuilders() set.  Ensure that we validate
only usermods that were actually deps for the build.
2025-06-18 12:08:57 -04:00
Will Miles
f3623158d7 Usermod script cleanup
Fix whitespace and remove unused imports
2025-05-25 08:33:27 -04:00
Will Miles
309c8d67f3 Generalize module link validation
Perform validation for external modules, too.
2025-05-24 23:14:22 -04:00
Will Miles
0a7d3a9d9b load_usermods: Simplify load code
Remove all the unnecessary bits.
2025-05-24 22:16:01 -04:00
Will Miles
75cd411073 Improve all-usermod handling
Use a magic custom_usermods string instead of a magic environment
name; and disable the validation script as it triggers on the non-
platform-compatible mods.
2025-05-24 14:13:08 -04:00
Will Miles
792a7aa081 load_usermods: Resolve folder paths
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.
2025-05-22 09:13:54 -04:00
Will Miles
7ea510e75b validate_usermods: Improve message 2025-05-22 08:44:05 -04:00
Will Miles
242df4b049 validate_usermods: Fix old ESP32 platform
The modern linker used with new platforms (ESP8266, ESP32 >v4) always
produces paths in the map file with slash; however the old linker for
the old ESP32 platform instead produces paths with backslash when
building on Windows.  Match both types as a path separator when
scanning linked symbols.
2025-05-22 08:43:52 -04:00
Will Miles
358e38e056 validate_usermods: Ensure map file is created
Not all of our platforms create one by default; ensure it's produced.
2025-05-22 08:41:59 -04:00
Will Miles
ac61eb4b1b validate_usermods: Fix inverted check
Difference direction was inverted.  It's tough to test when it always
works correctly on your local machine!

H/t @coderabbitai
2025-05-19 17:41:11 -04:00
Will Miles
999637f8ad Validate usermods at link time
Add additional validation of the linker .map output to confirm that the
correct usermods were added.
2025-05-19 17:30:22 -04:00
Will Miles
ee3864175d load_usermods: Make missing libArchive an error
Rather than try and fail to add this property, abort if it's missing
from any requested usermod.
2025-05-06 22:39:10 -04:00
Will Miles
6464c620c7 load_usermods: Enforce CPPPATH type
Ensure that entries put in CPPPATH are always strings so SCons can
correctlly deduplicate.
2025-04-30 21:56:56 -04:00
Will Miles
7998650e60 Fix up usermod libArchive settings
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
2025-04-30 21:18:05 -04:00
Will Miles
e00789f838 Merge remote-tracking branch 'upstream/main' into usermod-libs 2025-03-01 20:32:12 +00:00
netmindz
fa2949af7d use npm ci 2025-02-22 17:39:00 +00:00
Will Tatam
1dc7647bb9 Merge branch 'main' into usermod-libs 2025-02-16 10:40:30 +00:00
SpiroC
778cecb512 Check if Node.js is installed and present in PATH 2025-02-15 14:43:08 +11:00
Will Miles
2431f2058b load_usermods: Split on any whitespace
This allows the common newline syntax in platformio
2025-02-06 22:23:12 -05:00
Will Miles
51db63dff7 load_usermods: Also search for mod_v2 2025-01-31 03:39:05 +00:00
Will Miles
4bc3408410 load_usermods: Don't cross usermod includes
Only include paths for the base system deps, not those of other
usermods.
2025-01-31 01:35:58 +00:00
Will Miles
5d392d89ce load_usermods: Improve include path assembly
Don't blast the path of any mentioned library - parse only the tree of
the actual build deps.
2025-01-31 01:33:34 +00:00
Will Miles
15edfcd088 Fix usermod platformio integration
Should now work for new *and* old versions of PlatformIO!
2025-01-16 01:05:12 +00:00
Will Miles
8fd905215f Integrate usermods environment
Move the "all usermods" logic in to the platformio script, so the
'usermods' environment can be built in any checkout without extra setup
commands.
2025-01-14 22:21:26 +00:00
Will Miles
270d75afe2 Update usermod deps earlier
When processing usermods, update their include path properties before
the LDF runs, so it can see through wled.h.
2025-01-14 22:16:55 +00:00
Will Miles
0b8721c25e Fix usermod libArchive setting
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.
2025-01-14 02:48:00 +00:00
Will Miles
cc9e9b109c Fix usermod library builds
Manage include folders via a second platformio script, fixing builds and
removing all the extra boilerplate from usermod library.json files.
2025-01-12 17:07:36 +00:00
Will Miles
4d5e0ca7a3 load_usermods: Expand name search
Look for 'usermod_v2_x' as well.  This could be removed later if we
clean up the folder names.
2025-01-11 13:31:20 -05:00
Will Miles
b8685f2c39 Convert usermods to static libraries
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.
2025-01-11 12:08:29 -05:00
Will Tatam
0c77dbb7ea cleanup WLED_RELEASE_NAME only if present 2024-11-24 13:55:23 +00:00
Will Tatam
0be1df7ee8 Stip \" from WLED_RELEASE_NAME 2024-11-23 16:46:41 +00:00
Frank
2607c44fbb make objdump work
Script update based on latest version from Tasmota
* add support for all esp32 variants
* add "-C" : Decode (demangle) low-level symbol names into user-level C++ names.
2024-05-06 11:00:41 +02:00