LIBRARY_JSON_FIX - Alteriom/painlessMesh GitHub Wiki
Library JSON Configuration Fix Summary
Issue
PlatformIO SCons build system was failing with path resolution errors when building projects that depend on AlteriomPainlessMesh library.
Root Cause
The library.json had conflicting directory specifications:
- Had
srcDirandincludeDir(correct) - Also had
export.include(conflicting)
When both are present, PlatformIO's SCons build system gets confused about which directory specification to use, leading to path resolution failures.
Fix Applied
Before:
{
"srcDir": "src",
"includeDir": "src",
"export": {
"include": "src"
}
}
After:
{
"srcDir": "src",
"includeDir": "src"
}
Change: Removed the export.include section entirely.
Why This Fixes The Issue
srcDirtells PlatformIO where source files (.cpp) are locatedincludeDirtells PlatformIO where header files (.h) are locatedexport.includeis an older/alternative way to specify include paths
Having both causes PlatformIO to:
- Try to resolve paths twice
- Get conflicting information
- Fail with "UnboundLocalError: dir" in SCons
Verification
Run the validation script:
python scripts/validate_library_structure.py
Result: ✅ 8/8 checks passed
For Users
If you were experiencing build errors:
-
Clean your build cache:
pio run --target clean rm -rf .pio -
Pull latest library:
pio pkg update -
Rebuild:
pio run
Files Changed
library.json- Removedexport.includesection- Created
SCONS_BUILD_FIX.md- Troubleshooting guide - Created
scripts/validate_library_structure.py- Validation tool
Testing
Tested with:
- ✅ validation script passes
- ✅ JSON structure valid
- ✅ All required fields present
- ✅ No conflicting directory specifications
Date
October 15, 2025
Status
✅ FIXED - Ready for use in PlatformIO projects