Skip to content

Commit d2cc91e

Browse files
authored
Change Windows path length limit defaults
1 parent 80eb448 commit d2cc91e

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

builder/frameworks/arduino.py

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def setup_logging():
9191

9292
def get_platform_default_threshold(mcu):
9393
"""
94-
Platform-specific bleeding edge default values for
94+
Platform-specific max performance default values for
9595
INCLUDE_PATH_LENGTH_THRESHOLD
9696
These values push the limits for maximum performance and minimal path
9797
shortening
@@ -100,36 +100,36 @@ def get_platform_default_threshold(mcu):
100100
mcu: MCU type (esp32, esp32s2, esp32s3, etc.)
101101
102102
Returns:
103-
int: Platform-specific bleeding edge default threshold
103+
int: Platform-specific default threshold
104104
"""
105-
# Bleeding edge values - pushing Windows command line limits
105+
# Max. performance values - pushing Windows command line limits
106106
# Windows CMD has ~32768 character limit, we use aggressive values close
107107
# to this
108108
platform_defaults = {
109-
"esp32": 45000, # Standard ESP32
110-
"esp32s2": 43000, # ESP32-S2
111-
"esp32s3": 48000, # ESP32-S3
112-
"esp32c3": 41000, # ESP32-C3
113-
"esp32c2": 38000, # ESP32-C2
114-
"esp32c6": 44000, # ESP32-C6
115-
"esp32h2": 40000, # ESP32-H2
116-
"esp32p4": 50000, # ESP32-P4
109+
"esp32": 32000, # Standard ESP32
110+
"esp32s2": 32000, # ESP32-S2
111+
"esp32s3": 33200, # ESP32-S3
112+
"esp32c3": 32000, # ESP32-C3
113+
"esp32c2": 32000, # ESP32-C2
114+
"esp32c6": 31600, # ESP32-C6
115+
"esp32h2": 32000, # ESP32-H2
116+
"esp32p4": 32000, # ESP32-P4
117117
}
118118

119-
default_value = platform_defaults.get(mcu, 45000) # Aggressive fallback
119+
default_value = platform_defaults.get(mcu, 31600)
120120

121121
# Debug output only in verbose mode
122122
if logging.getLogger().isEnabledFor(logging.DEBUG):
123123
logging.debug(
124-
f"Bleeding edge platform default threshold for {mcu}: "
124+
f"Max. possible platform default threshold for {mcu}: "
125125
f"{default_value}")
126126

127127
return default_value
128128

129129

130130
def validate_threshold(threshold, mcu):
131131
"""
132-
Validates threshold value with bleeding edge limits
132+
Validates threshold value with max. performance limits
133133
Uses aggressive boundaries for maximum performance
134134
135135
Args:
@@ -139,24 +139,24 @@ def validate_threshold(threshold, mcu):
139139
Returns:
140140
int: Validated threshold value
141141
"""
142-
# Bleeding edge absolute limits - pushing boundaries
143-
min_threshold = 15000 # Minimum reasonable value for complex projects
142+
# Absolute limits - pushing boundaries
143+
min_threshold = 20000 # Minimum reasonable value for complex projects
144144
# Maximum aggressive value (beyond Windows CMD limit for testing)
145-
max_threshold = 65000
145+
max_threshold = 32767
146146

147-
# MCU-specific bleeding edge adjustments - all values are aggressive
147+
# MCU-specific adjustments - all values are aggressive
148148
mcu_adjustments = {
149-
"esp32c2": {"min": 30000, "max": 40000},
150-
"esp32c3": {"min": 30000, "max": 45000},
151-
"esp32": {"min": 30000, "max": 50000},
152-
"esp32s2": {"min": 30000, "max": 50000},
153-
"esp32s3": {"min": 30000, "max": 50000},
154-
"esp32p4": {"min": 30000, "max": 55000},
155-
"esp32c6": {"min": 30000, "max": 50000},
156-
"esp32h2": {"min": 30000, "max": 40000},
149+
"esp32c2": {"min": 30000, "max": 32767},
150+
"esp32c3": {"min": 30000, "max": 32767},
151+
"esp32": {"min": 30000, "max": 32767},
152+
"esp32s2": {"min": 30000, "max": 32767},
153+
"esp32s3": {"min": 30000, "max": 32767},
154+
"esp32p4": {"min": 30000, "max": 32767},
155+
"esp32c6": {"min": 30000, "max": 32767},
156+
"esp32h2": {"min": 30000, "max": 32767},
157157
}
158158

159-
# Apply MCU-specific bleeding edge limits
159+
# Apply MCU-specific max. limits
160160
if mcu in mcu_adjustments:
161161
min_threshold = max(min_threshold, mcu_adjustments[mcu]["min"])
162162
max_threshold = min(max_threshold, mcu_adjustments[mcu]["max"])
@@ -165,48 +165,48 @@ def validate_threshold(threshold, mcu):
165165

166166
if threshold < min_threshold:
167167
print(f"*** Warning: Include path threshold {threshold} too "
168-
f"conservative for {mcu}, using bleeding edge minimum "
168+
f"conservative for {mcu}, using safe minimum "
169169
f"{min_threshold} ***")
170170
threshold = min_threshold
171171
elif threshold > max_threshold:
172172
print(f"*** Warning: Include path threshold {threshold} exceeds "
173-
f"bleeding edge maximum for {mcu}, using {max_threshold} ***")
173+
f"possible maximum for {mcu}, using {max_threshold} ***")
174174
threshold = max_threshold
175175

176176
# Warning for conservative values (opposite of original - warn if too low)
177177
platform_default = get_platform_default_threshold(mcu)
178-
if threshold < platform_default * 0.7: # More than 30% below bleeding edge default
178+
if threshold < platform_default * 0.7: # More than 30% below max. default
179179
print(f"*** Info: Include path threshold {threshold} is conservative "
180-
f"compared to bleeding edge default {platform_default} for "
180+
f"compared to maximum default {platform_default} for "
181181
f"{mcu} ***")
182182
print("*** Consider using higher values for maximum performance ***")
183183

184184
if original_threshold != threshold:
185185
logging.warning(f"Threshold adjusted from {original_threshold} to "
186-
f"bleeding edge value {threshold} for {mcu}")
186+
f"max. possible value {threshold} for {mcu}")
187187

188188
return threshold
189189

190190

191191
def get_include_path_threshold(env, config, current_env_section):
192192
"""
193193
Determines Windows INCLUDE_PATH_LENGTH_THRESHOLD from various sources
194-
with priority order and bleeding edge validation
194+
with priority order and max. possible validation
195195
196196
Priority order:
197197
1. Environment variable PLATFORMIO_INCLUDE_PATH_THRESHOLD
198198
2. Environment-specific setting in platformio.ini
199199
3. Global setting in [env] section
200200
4. Setting in [platformio] section
201-
5. MCU-specific bleeding edge default value
201+
5. MCU-specific max. possible default value
202202
203203
Args:
204204
env: PlatformIO Environment
205205
config: Project Configuration
206206
current_env_section: Current environment section
207207
208208
Returns:
209-
int: Validated bleeding edge threshold value
209+
int: Validated max. threshold value
210210
"""
211211
mcu = env.BoardConfig().get("build.mcu", "esp32")
212212
default_threshold = get_platform_default_threshold(mcu)
@@ -219,7 +219,7 @@ def get_include_path_threshold(env, config, current_env_section):
219219
try:
220220
threshold = int(env_var)
221221
threshold = validate_threshold(threshold, mcu)
222-
print(f"*** Using environment variable bleeding edge include "
222+
print(f"*** Using environment variable max. possible include "
223223
f"path threshold: {threshold} (MCU: {mcu}) ***")
224224
return threshold
225225
except ValueError:
@@ -231,44 +231,44 @@ def get_include_path_threshold(env, config, current_env_section):
231231
if config.has_option(current_env_section, setting_name):
232232
threshold = config.getint(current_env_section, setting_name)
233233
threshold = validate_threshold(threshold, mcu)
234-
print(f"*** Using environment-specific bleeding edge include "
234+
print(f"*** Using environment-specific max. possible include "
235235
f"path threshold: {threshold} (MCU: {mcu}) ***")
236236
return threshold
237237

238238
# 3. Check global setting in [env] section
239239
if config.has_option("env", setting_name):
240240
threshold = config.getint("env", setting_name)
241241
threshold = validate_threshold(threshold, mcu)
242-
print(f"*** Using global [env] bleeding edge include path "
242+
print(f"*** Using global [env] max. possible include path "
243243
f"threshold: {threshold} (MCU: {mcu}) ***")
244244
return threshold
245245

246246
# 4. Check setting in [platformio] section
247247
if config.has_option("platformio", setting_name):
248248
threshold = config.getint("platformio", setting_name)
249249
threshold = validate_threshold(threshold, mcu)
250-
print(f"*** Using [platformio] section bleeding edge include "
250+
print(f"*** Using [platformio] section max. possible include "
251251
f"path threshold: {threshold} (MCU: {mcu}) ***")
252252
return threshold
253253

254-
# 5. Use MCU-specific bleeding edge default value
254+
# 5. Use MCU-specific max. possible default value
255255
threshold = validate_threshold(default_threshold, mcu)
256256
if env.get("VERBOSE"):
257-
print(f"*** Using platform-specific bleeding edge default "
257+
print(f"*** Using platform-specific max. possible default "
258258
f"include path threshold: {threshold} (MCU: {mcu}) ***")
259259

260260
return threshold
261261

262262
except (ValueError, TypeError) as e:
263263
print(f"*** Warning: Invalid include path threshold value, using "
264-
f"bleeding edge platform default {default_threshold} for "
264+
f"max. possible platform default {default_threshold} for "
265265
f"{mcu}: {e} ***")
266266
return validate_threshold(default_threshold, mcu)
267267

268268

269269
def get_threshold_info(env, config, current_env_section):
270270
"""
271-
Helper function for debug information about bleeding edge threshold
271+
Helper function for debug information about max. possible threshold
272272
configuration
273273
274274
Args:

0 commit comments

Comments
 (0)