Skip to content

PLATFORM_MTL-12127: Fix sl_setup_env.py and build.sh for Git Bash on Windows#648

Draft
Cedric Migliorini (migligli) wants to merge 1 commit intoSiliconLabsSoftware:mainfrom
migligli:bugfix/PLATFORM_MTL-12127_lock-app-917-ncp_hard-fault-issue
Draft

PLATFORM_MTL-12127: Fix sl_setup_env.py and build.sh for Git Bash on Windows#648
Cedric Migliorini (migligli) wants to merge 1 commit intoSiliconLabsSoftware:mainfrom
migligli:bugfix/PLATFORM_MTL-12127_lock-app-917-ncp_hard-fault-issue

Conversation

@migligli
Copy link
Copy Markdown

Issue Link:
https://jira.silabs.com/browse/PLATFORM_MTL-12127

Description of Problem/Feature:
See this MD file OUT_PLATFORM_MTL-12127_Description-changes-to-scripts.md

Description of Fix/Solution:
See this MD file OUT_PLATFORM_MTL-12127_Description-changes-to-scripts.md

Testing Done:
I was able to run the following scripts on my Windows 11 OS machine from a git bash terminal:

python slc/sl_setup_env.py
./slc/build.sh slc/apps/lock-app/wifi/lock-app-917-ncp.slcw brd4186c

Details from the commit message:
sl_setup_env.py:

  • Resolve SLT CLI from SILABS_SLT/SLT_EXE env, then PATH, before falling back to bundled slc/tools/slt. Skip download and slt update --self when using an external SLT.
  • Add --use-bundled-slt flag to force the old behavior.
  • Pass stdin=subprocess.DEVNULL to slt subprocess calls to prevent interactive prompts from hanging non-interactive runs.
  • Single-quote all .env values on Windows so that semicolons in TOOLS_PATH, backslashes, and spaces (e.g. Simplicity Commander) are safe when build.sh sources the file in bash.

build.sh:

  • Convert Windows TOOLS_PATH (semicolon-separated) to Unix PATH via cygpath -p -u when running under Git Bash / MSYS.
  • Force OS=Windows_NT and pass OS, ARM_GCC_DIR, POST_BUILD_EXE, and USERPROFILE on the make command line so generated Makefiles select the correct Windows toolchain paths in recursive builds.
  • Resolve POST_BUILD_EXE to a full path when .env provides only a basename (e.g. commander.exe).
  • Accept slc.bat in addition to slc for the SLC CLI check.
  • Fail early with a clear message when GNU Make is not on PATH.

…Windows

sl_setup_env.py:
- Resolve SLT CLI from SILABS_SLT/SLT_EXE env, then PATH, before
  falling back to bundled slc/tools/slt. Skip download and
  slt update --self when using an external SLT.
- Add --use-bundled-slt flag to force the old behavior.
- Pass stdin=subprocess.DEVNULL to slt subprocess calls to prevent
  interactive prompts from hanging non-interactive runs.
- Single-quote all .env values on Windows so that semicolons in
  TOOLS_PATH, backslashes, and spaces (e.g. Simplicity Commander)
  are safe when build.sh sources the file in bash.

build.sh:
- Convert Windows TOOLS_PATH (semicolon-separated) to Unix PATH
  via cygpath -p -u when running under Git Bash / MSYS.
- Force OS=Windows_NT and pass OS, ARM_GCC_DIR, POST_BUILD_EXE,
  and USERPROFILE on the make command line so generated Makefiles
  select the correct Windows toolchain paths in recursive builds.
- Resolve POST_BUILD_EXE to a full path when .env provides only
  a basename (e.g. commander.exe).
- Accept slc.bat in addition to slc for the SLC CLI check.
- Fail early with a clear message when GNU Make is not on PATH.
@github-actions
Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. For privacy information, see our Privacy Notice. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: example@example.com

or

I have read the CLA Document and I hereby sign the CLA behalf of my company, e-mail: example@example.com

Signature is valid for 6 months.


This bot will be retriggered when the Contributor License Agreement comment has been provided. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant