Skip to content

Commit e53a1e4

Browse files
committed
LU debug
1 parent bb6037b commit e53a1e4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pio-scripts/load_usermods.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,28 @@ def find_usermod(mod: str):
5757
for spec in not_found_specs:
5858
#print(f"LU: forcing install of {spec}")
5959
lm.install(spec)
60+
# Clear GetLibBuilders cache
61+
DefaultEnvironment().Replace(__PIO_LIB_BUILDERS=None)
6062

6163

6264
# Monkey-patch ConfigureProjectLibBuilder to mark up the dependencies
6365
# Save the old value
6466
cplb = env.ConfigureProjectLibBuilder
6567
# Our new wrapper
6668
def cplb_wrapper(xenv):
67-
# Update usermod properties
68-
lib_builders = xenv.GetLibBuilders()
69+
# Update usermod properties
70+
print(xenv.GetProjectOption('lib_deps'))
71+
lib_builders = xenv.GetLibBuilders()
6972
wled_dir = xenv["PROJECT_SRC_DIR"]
7073
um_deps = [dep for dep in lib_builders if usermod_dir in Path(dep.src_dir).parents]
7174
other_deps = [dep for dep in lib_builders if usermod_dir not in Path(dep.src_dir).parents]
75+
if usermods and not um_deps:
76+
# Debug: try resetting the lib builders??
77+
print("REPLACING??")
78+
xenv.Replace(__PIO_LIB_BUILDERS=None)
79+
lib_builders = xenv.GetLibBuilders()
80+
um_deps = [dep for dep in lib_builders if usermod_dir in Path(dep.src_dir).parents]
81+
other_deps = [dep for dep in lib_builders if usermod_dir not in Path(dep.src_dir).parents]
7282
for dep in lib_builders:
7383
print(f"Found dep: {str(dep)}")
7484
for um in um_deps:

0 commit comments

Comments
 (0)