You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i'm trying to compile WLED usermods are not included in the firmware.
To Reproduce Bug
If i clone the repository and try to build it like it is it will compile good with audioreactive. But if i add for example Temperature usermod and compile it again it will add Temperature usermod but it will not include audioreactive.
Then if i remove again Temperature it will not include any usermod anymore. I tried to delete .buildcache, .pio but no luck. Searching for string in the firmware file first compile it shows me about audioreactive, second about the Temperature and the third compile it will not find anything about any usermod.
Also even adding ${common.debug_flags} it will not change anything, the firmware will not be recompiled
Expected Behavior
It should add the usermods i set to custom_usermods in platformio.ini. And also recompile if anything changes in platformio.ini.
Install Method
Self-Compiled
What version of WLED?
Nightly Release 20250316 0.16.0
Which microcontroller/board are you seeing the problem on?
None of the usermods (except Audioreactive) are automatically compiled with WLED.
If you want to include usermods in your compile, you need to modify platformio.ini (or better override) as specified in usermod's readme file.
i did say that i am adding them in platformio.ini, first compile works with audioreactive, second is with audioreactive and Temperature but only Temperature is added, after that none will be added.
I can't replicate this in my development environment; changes to platformio.ini are always picked up on the next build, and seem to build correctly with the specified usermods.
@C0oL3r , are you using an IDE or building with platformio at the command prompt? What platform is your build system (Linux, Windows, macOS, GitHub codespaces, etc.)?
@willmmiles can confirm that building different configurations of usermods using VScode can lead to some or all of them not being added properly: after changing usermod configuration, a full clean must be executed prior to building, otherwise the usermods don't get pulled in properly. Can you confirm?
@willmmiles i am building it in VS Code with platformio, and i am using windows.
And yes i understand that creating a new environment and not setting the usermods from the original esp32dev will not include audioreactive, but i’m not using an override, i just add or delete usermods from the esp32dev environment. As @DedeHai said it’s very unstable.
If he confirms that even adding or removing flags in the configuration will not rebuild it correctly
It's meant to work correctly every build with up-to-date PlatformIO; I do know there's some bugs with older releases that cause problems with library building.
I'll retest some cases -- I do recall seeing an issue with removed modules not actually being removed, but I thought it'd been resolved with a PlatformIO update. Could be there's still something lurking there.
I couldn't reproduce this on my build system (Win11, VSCode 1.98.2, PlatformIO 6.1.18). I ran a series of verbose builds of a test environment:
custom_usermods = audioreactive
custom_usermods = audioreactive Temperature
custom_usermods = Temperature
custom_usermods = audioreactive
custom_usermods = animartrix
For each build the linker invocation included the correct files and only those for the specified usermods.
@C0oL3r could you please check your PlatformIO version on your windows machine? pio --version? If we can confirm there's an issue with a specific version, I can add a validation to the usermod inclusion script.
I tried it first on my normal PC where im able to compile v0.15 without problems and the usermods are present, but just downloading the newest source from git (today) and just i.e. enabling
custom_usermods = auto_save
doesnt include the usermod.
My Pc used Windows 10 btw. I also tested it on a fresh installed notebook with windows 10 where i installed VS Code today the first time and i also get the same with the same wled folder i used on my pc.
After that i installed on a server with docker a container with VS Code and i used again the same wled folder, and there it works.
I tried it with a couple of usermods and the bin file is always smaller on my windows 10 machines.
@KrX3D Could you please try the patch in #4622 and let me know if it improves anything? I haven't been able to reproduce this reliably enough to validate a fix.
As far as I could tell, the underlying problem seems to be something with SCons caching. PlatformIO always sets up the library links correctly, but - depending on the build history - it sometimes seems to think that it doesn't need to re-link the final output with the newly added libraries, and instead pulls an old build from ~/.buildcache. The patch in #4622 attempts to augment the caching metadata with an additional qualification on the usermod list, which seemed to work on my system, but I guess it isn't able to recover an already poisoned cache.
As you've noted, non-Windows systems seem less prone to this cache poisoning. I speculate this is due to some difference in filesystem metadata, but I don't know what it would be.
You can likely "unstick" your windows build system by deleting C:\users\username\.buildcache. #4622 should keep it from getting confused again. I'll need to see if I can deliberately engineer a poisoned cache so I can test recovery.
removing C:\users\username.buildcache didnt solve it.
but i kinda found a way to make it work, maybe this helps you to find out what the problem is.
i still got the fix #4622 in my wled folder and didn test it without it.
how i can make it work;
open a powershell 7 window and cd to the wled folder
remove the .pio folder
execute in powershell & "$env:USERPROFILE\.platformio\penv\Scripts\pio.exe" run -e lolin_s2_min_EleksTube
this will make an .bin file WHICH IS BROKEN 1025KB big
execute the command again and now the bin file gets replaced by another 1062KB big which IS WORKING
When i dont remove the .pio folder which was created by VS Code and just use the command in powershell, it doesnt matter how many times i compile it doesnt work.
Also when i just remove .pio\build i need to compile it once. Before the .pio folder was created by the command not VS Code.
But i cant get it ever working with VS Code, removing the .pio folder creates the broken bin file and compiling again creates each time the broken bin file. also lleaving the working bin file from the command and using VS Code just creates the broken bin file
here is the powershell output for both times (1st broken, 2nd working bin file):
Activity
blazoncek commentedon Mar 16, 2025
None of the usermods (except Audioreactive) are automatically compiled with WLED.
If you want to include usermods in your compile, you need to modify platformio.ini (or better override) as specified in usermod's readme file.
C0oL3r commentedon Mar 16, 2025
i did say that i am adding them in platformio.ini, first compile works with audioreactive, second is with audioreactive and Temperature but only Temperature is added, after that none will be added.
blazoncek commentedon Mar 16, 2025
Then perhaps @willmmiles may know more. Reopen if needed.
willmmiles commentedon Mar 16, 2025
I can't replicate this in my development environment; changes to platformio.ini are always picked up on the next build, and seem to build correctly with the specified usermods.
@C0oL3r , are you using an IDE or building with platformio at the command prompt? What platform is your build system (Linux, Windows, macOS, GitHub codespaces, etc.)?
willmmiles commentedon Mar 16, 2025
Actually, let me hazard another guess.
For this custom environment:
you will get the default usermods with esp32dev (ie. audioreactive).
For this environment spec:
you will get only Temperature; the
custom_usermodssettings has been overridden with the new value specified there. The inherited value is lost.For this environment spec:
you will get no usermods at all (it's being overriden with the empty string).
I think maybe you want:
...where it keeps the inherited value (as it is explicitly referenced), plus adds the extra module you want.
DedeHai commentedon Mar 17, 2025
@willmmiles can confirm that building different configurations of usermods using VScode can lead to some or all of them not being added properly: after changing usermod configuration, a full clean must be executed prior to building, otherwise the usermods don't get pulled in properly. Can you confirm?
C0oL3r commentedon Mar 17, 2025
@willmmiles i am building it in VS Code with platformio, and i am using windows.
And yes i understand that creating a new environment and not setting the usermods from the original esp32dev will not include audioreactive, but i’m not using an override, i just add or delete usermods from the esp32dev environment. As @DedeHai said it’s very unstable.
If he confirms that even adding or removing flags in the configuration will not rebuild it correctly
DedeHai commentedon Mar 17, 2025
It is not unstable, if you do a full clean it works just fine. The question is just: is that expected or not.
C0oL3r commentedon Mar 17, 2025
It works only for the first compile, after that things starts to get weird. Maybe it’s a problem with the platform on Windows
C0oL3r commentedon Mar 17, 2025
I can confirm that compiling it in a Docker container works well, compiling is done everytime with success and everything is added.
willmmiles commentedon Mar 18, 2025
It's meant to work correctly every build with up-to-date PlatformIO; I do know there's some bugs with older releases that cause problems with library building.
I'll retest some cases -- I do recall seeing an issue with removed modules not actually being removed, but I thought it'd been resolved with a PlatformIO update. Could be there's still something lurking there.
willmmiles commentedon Mar 19, 2025
I couldn't reproduce this on my build system (Win11, VSCode 1.98.2, PlatformIO 6.1.18). I ran a series of verbose builds of a test environment:
For each build the linker invocation included the correct files and only those for the specified usermods.
@C0oL3r could you please check your PlatformIO version on your windows machine?
pio --version? If we can confirm there's an issue with a specific version, I can add a validation to the usermod inclusion script.16 remaining items
Inject a dependency on the usermod list
Inject a dependency on the usermod list
KrX3D commentedon Apr 14, 2025
Hi, im getting also this problem.
I tried it first on my normal PC where im able to compile v0.15 without problems and the usermods are present, but just downloading the newest source from git (today) and just i.e. enabling
custom_usermods = auto_savedoesnt include the usermod.
My Pc used Windows 10 btw. I also tested it on a fresh installed notebook with windows 10 where i installed VS Code today the first time and i also get the same with the same wled folder i used on my pc.
After that i installed on a server with docker a container with VS Code and i used again the same wled folder, and there it works.
I tried it with a couple of usermods and the bin file is always smaller on my windows 10 machines.
willmmiles commentedon Apr 14, 2025
@KrX3D Could you please try the patch in #4622 and let me know if it improves anything? I haven't been able to reproduce this reliably enough to validate a fix.
KrX3D commentedon Apr 15, 2025
@willmmiles
i added it but that didnt solve it. i also removed the .pio folder and still no usermod available.
i tried
custom_usermods = auto_savein the .pio/libdeps/lolin_s2_mini folder i see a auto_save.pio-link which has the content:
{"cwd": "c:\\Users\\USERNAME\\Desktop\\WLED", "spec": {"owner": null, "id": null, "name": "auto_save", "requirements": null, "uri": "symlink://c:\\Users\\USERNAME\\Desktop\\WLED\\usermods\\usermod_v2_auto_save"}}and usermod_list.txt:
auto_saveim not sure if this helps but under WLED\build_output\map\lolin_s2_mini.map AND WLED.pio\build\lolin_s2_mini\firmware.map
in the working inside docker i get like 100 of those lines, and they are missing in the folder on windows:
.group 0x0000000000000000 0x24 .pio/build/lolin_s2_mini_EleksTube/libd14/usermod_v2_auto_save/usermod_v2_auto_save.cpp.oWLED.pio\build\lolin_s2_mini\idedata.json -> docker has got 6 times the path to the auto_save usermod folder and on windows only once
willmmiles commentedon Apr 16, 2025
As far as I could tell, the underlying problem seems to be something with SCons caching. PlatformIO always sets up the library links correctly, but - depending on the build history - it sometimes seems to think that it doesn't need to re-link the final output with the newly added libraries, and instead pulls an old build from
~/.buildcache. The patch in #4622 attempts to augment the caching metadata with an additional qualification on the usermod list, which seemed to work on my system, but I guess it isn't able to recover an already poisoned cache.As you've noted, non-Windows systems seem less prone to this cache poisoning. I speculate this is due to some difference in filesystem metadata, but I don't know what it would be.
You can likely "unstick" your windows build system by deleting
C:\users\username\.buildcache. #4622 should keep it from getting confused again. I'll need to see if I can deliberately engineer a poisoned cache so I can test recovery.blazoncek commentedon Apr 16, 2025
.buildcacheis usually the issue if PIO fails to build properly. Removing entire content (or updating core .h files) is the only remedy.KrX3D commentedon Apr 16, 2025
hi,
removing C:\users\username.buildcache didnt solve it.
but i kinda found a way to make it work, maybe this helps you to find out what the problem is.
i still got the fix #4622 in my wled folder and didn test it without it.
how i can make it work;
& "$env:USERPROFILE\.platformio\penv\Scripts\pio.exe" run -e lolin_s2_min_EleksTubeWhen i dont remove the .pio folder which was created by VS Code and just use the command in powershell, it doesnt matter how many times i compile it doesnt work.
Also when i just remove .pio\build i need to compile it once. Before the .pio folder was created by the command not VS Code.
But i cant get it ever working with VS Code, removing the .pio folder creates the broken bin file and compiling again creates each time the broken bin file. also lleaving the working bin file from the command and using VS Code just creates the broken bin file
here is the powershell output for both times (1st broken, 2nd working bin file):
willmmiles commentedon Apr 27, 2025
@KrX3D Thank you very much! I've been able to replicate this locally with your instructions. Hopefully a fix will follow soon...
Fix up usermod libArchive settings
Fix up usermod libArchive settings
Fix up usermod libArchive settings