Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert usermods to static libraries #4480

Draft
wants to merge 57 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b8685f2
Convert usermods to static libraries
willmmiles Sep 14, 2024
4d5e0ca
load_usermods: Expand name search
willmmiles Jan 11, 2025
71b0e8e
Convert AnimARTrix usermod to library
willmmiles Jan 11, 2025
90b1815
Convert usermods from header to library
netmindz Jan 11, 2025
a5575bc
Fix naming of usermod files to match library name
netmindz Jan 11, 2025
6e76a72
Convert usermods from header to library
netmindz Jan 11, 2025
67022be
Build all usermods
netmindz Jan 11, 2025
cbed841
Include basic usermods in CI
netmindz Jan 11, 2025
c16d83f
Build custom_usermods = audioreactive auto_save animartrix
netmindz Jan 11, 2025
d64cedd
Build custom_usermods = audioreactive auto_save animartrix
netmindz Jan 11, 2025
2381e32
Define dependencies for ADS1115 usermod
netmindz Jan 11, 2025
79bac91
use bigger partitions for usermods env
netmindz Jan 11, 2025
d3eec72
Defining more usermod dependencies
netmindz Jan 12, 2025
3521732
fix env:userods
netmindz Jan 12, 2025
52b784e
fix env:usermods
netmindz Jan 12, 2025
52bee88
fix word_clock_matrix naming
netmindz Jan 12, 2025
075fd4d
Defining more usermod dependencies
netmindz Jan 12, 2025
4c19341
Merge branch 'usermod-libs-migration' of github.com:netmindz/WLED int…
netmindz Jan 12, 2025
8527d23
audioreactive: Move flags to library
willmmiles Jan 12, 2025
cc9e9b1
Fix usermod library builds
willmmiles Jan 12, 2025
f2626b0
Remove now-obsolete AR_build_flags
willmmiles Jan 12, 2025
24accf9
Remove now redundant build section from library.json
netmindz Jan 13, 2025
b380d5e
reinstate libArchive:false
netmindz Jan 14, 2025
2c9c413
Merge branch 'usermod-libs' into usermod-libs-migration
netmindz Jan 14, 2025
1dbd706
Revert LOROL_LITTLEFS hack
netmindz Jan 14, 2025
e471487
typo in usermods/sensors_to_mqtt/library.json
netmindz Jan 14, 2025
869e275
typo in usermods/sensors_to_mqtt/library.json
netmindz Jan 14, 2025
0b8721c
Fix usermod libArchive setting
willmmiles Jan 14, 2025
270d75a
Update usermod deps earlier
willmmiles Jan 14, 2025
8fd9052
Integrate usermods environment
willmmiles Jan 14, 2025
30559cd
Fix dependency for EleksTube_IPS usermod
willmmiles Jan 14, 2025
32607ee
Revert incorrect testing platformio.ini
willmmiles Jan 15, 2025
ef2eb07
Merge branch 'main' into usermod-libs
Jan 15, 2025
2adf745
Update env:usermods to use V4
Jan 15, 2025
5da380e
Update dependencies for sensors_to_mqtt
Jan 15, 2025
59a79a3
Add deps for usermods/BME280_v2
Jan 15, 2025
0afd2fe
Destructor must be public
Jan 15, 2025
5d05d79
Add usermod dependencies
Jan 15, 2025
8487dd7
Disable build of usermods that are broken at the moment
Jan 15, 2025
15edfcd
Fix usermod platformio integration
willmmiles Jan 16, 2025
193926c
usermods: Remove #pragma once from cpps
willmmiles Jan 17, 2025
2b07be1
usermod mpu6050: Fix incorrect int type
willmmiles Jan 19, 2025
44a1a1e
usermods: Fix MQTT checks
willmmiles Jan 19, 2025
48372bc
platformio: Fix audioreactive usermod for ESP8266
willmmiles Jan 19, 2025
0233dae
usermods/sensors_to_mqtt: Fix char type
willmmiles Jan 19, 2025
30a697e
usermods/PWM_fan: Disable pending cross-mod check
willmmiles Jan 19, 2025
1d558e8
platformio.ini: Add extra flags for usermod test
willmmiles Jan 19, 2025
0d44e7e
Usermods: Remove libArchive
willmmiles Jan 21, 2025
86f9761
platformio.ini: Fix esp32dev_V4 usermods
willmmiles Jan 31, 2025
5d392d8
load_usermods: Improve include path assembly
willmmiles Jan 31, 2025
4bc3408
load_usermods: Don't cross usermod includes
willmmiles Jan 31, 2025
a5b972d
Merge remote-tracking branch 'upstream/main' into usermod-libs
willmmiles Jan 31, 2025
51db63d
load_usermods: Also search for mod_v2
willmmiles Jan 31, 2025
851e9ec
Remove deprecated mqtt_switch_v2 usermod
willmmiles Jan 31, 2025
070b08a
Rename usermod EXAMPLE_v2 to EXAMPLE
willmmiles Jan 31, 2025
b3f9983
First half of usermod readme updates
willmmiles Jan 31, 2025
7a40ef7
Fix up PWM_fan
willmmiles Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ jobs:
cache: 'pip'
- name: Install PlatformIO
run: pip install -r requirements.txt
- name: Add usermods environment
run: |
cp -v usermods/platformio_override.usermods.ini platformio_override.ini
echo -n "custom_usermods = " >> platformio_override.ini
find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | xargs echo >> platformio_override.ini

- name: Build firmware
run: pio run -e ${{ matrix.environment }}
Expand Down
5 changes: 5 additions & 0 deletions pio-scripts/load_usermods.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
from pathlib import Path # For OS-agnostic path manipulation

usermod_dir = Path(env["PROJECT_DIR"]) / "usermods"
all_usermods = [f for f in usermod_dir.iterdir() if f.is_dir() and f.joinpath('library.json').exists()]

if env['PIOENV'] == "usermods":
# Add all usermods
env.GetProjectConfig().set(f"env:usermods", 'custom_usermods', " ".join([f.name for f in all_usermods]))
Comment on lines +8 to +12
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The downside to this change is that you have no control of what you are building

For testing I was setting my local platform_override.ini to only list the mods I was trying to build.

I guess I can still do that, but just need to name my env somehting like usermods_local

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not thrilled at magic environment names, but I think it's important to be able to locally replicate what the CI system does without having to run shell commands to update local state after every git pull. I'm open to alternative suggestions!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly less need for an "all in one" build if we just let the CI handle a matrix build for usermods, then just define the one we are working on locally in our own platform_override ?

willmmiles#3

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stand by my opinion from above -- I think it's important that what the CI system does should be easily and directly reproducible by developers. I don't think it's appropriate to have to hand hack custom files in your personal workspace to replicate what the CI does; that's just asking to get it wrong.

From a practical perspective, I'd also like it to be simple to validate my local changes before pushing to the CI. If we depend on matrix builds, that becomes almost impossible. Id be stuck waiting on the CI system any time I want to have some confidence I haven't inadvertently broken the build of some random usermod.

Finally, I don't know much about GitHub CI; I'm concerned that adding dozens of extra builds per run would be costly.


def find_usermod(mod: str):
"""Locate this library in the usermods folder.
Expand Down
1 change: 1 addition & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,4 @@ build_unflags = ${common.build_unflags}
build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"USERMODS\"
${esp32.AR_build_flags}
lib_deps = ${esp32.lib_deps}
board_build.partitions = ${esp32.big_partitions}
9 changes: 0 additions & 9 deletions usermods/platformio_override.usermods.ini

This file was deleted.