What changed, and why it matters
This commit changes a build script to use a more portable way of writing sed commands. It replaces a non-standard regular-expression feature with one that works on macOS. There is no security relevance: the change only affects how source code is preprocessed during firmware builds and does not alter runtime behavior or introduce any vulnerability.
No security action needed. This is a build-portability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies core/site_scons/site_tools/micropython/init.py, which constructs sed expressions used during the MicroPython build. It changes two sed substitution patterns from using \0 (a GNU sed back-reference that may not be portable) to using & (the POSIX-compatible matched-string reference), and changes a regex character class from ^\s) to ^[[:space:]]). These changes make the build tooling work on macOS sed. The generated output of the sed commands is unchanged, so firmware behavior is unaffected.
Changed components
core/site_scons/site_tools/micropython/__init__.pyInspect captured patch +3 / −3
diff --git a/core/site_scons/site_tools/micropython/__init__.py b/core/site_scons/site_tools/micropython/__init__.py
index 3c3ddb0e..ccd28d62 100644
--- a/core/site_scons/site_tools/micropython/__init__.py
+++ b/core/site_scons/site_tools/micropython/__init__.py
@@ -78,9 +78,9 @@ def generate(env):
rf"-e 's/utils\.USE_THP/{thp}/g'",
rf"-e 's/utils\.USE_POWER_MANAGER/{power_manager}/g'",
r"-e 's/if TYPE_CHECKING/if False/'",
- r"-e 's/import typing/# \0/'",
- r"-e '/from typing import (/,/^\s*)/ {s/^/# /; }'",
- r"-e 's/from typing import/# \0/'",
+ r"-e 's/import typing/# &/'",
+ r"-e '/from typing import (/,/^[[:space:]]*)/ {s/^/# /; }'",
+ r"-e 's/from typing import/# &/'",
]
MODELS = ["T2T1", "T2B1", "T3T1", "T3B1", "T3W1"]
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.