-
Notifications
You must be signed in to change notification settings - Fork 33
Description
On Windows, during cmake configuration (and possibly later steps, I am not able to test) commands are executed by passing strings to cmd.exe. When the User's username contains parentheses, the paths in the home directory to the toolchain also contain parentheses and cause the command parsing to break.
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Users\LastFirst(123)\.pico-sdk\toolchain\14_2_Rel1\bin\arm-none-eabi-gcc.exe -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp -mfloat-abi=softfp -mcmse -Wl,--build-id=none -nostdlib CMakeFiles/cmTC_df74f.dir/testCCompiler.c.obj -o cmTC_df74f.elf && cd ."
'C:\Users\LastFirst' is not recognized as an internal or external command,
I understand it's a facepalm situation to have a username with parentheses but this is what the IT department has graced our organization with, and apparently Windows allows for it.
Extension Logs
2025-06-17 07:37:13.016 [error] [Window] [Extension Host] [�[31mERROR�[0m] [raspberry-pi-pico - cmakeUtil] Failed to configure CMake: Error: Command failed: "C:/Users/LastFirst(123)/.pico-sdk/cmake/v3.31.5/bin/cmake" -DPython3_EXECUTABLE="c:/Users/LastFirst(123)/AppData/Local/Programs/Python/Python313/python.exe" -G Ninja -B ./build "c:\code\pico_playground\blink"
PICO_SDK_PATH is C:/Users/LastFirst(123)/.pico-sdk/sdk/2.1.1
Target board (PICO_BOARD) is 'pico2_w'.
Using board configuration from C:/Users/LastFirst(123)/.pico-sdk/sdk/2.1.1/src/boards/include/boards/pico2_w.h
Auto-converting non-specific PICO_PLATFORM='rp2350' to 'rp2350-arm-s'
Defaulting platform (PICO_PLATFORM) to 'rp2350-arm-s' based on PICO_BOARD setting.
Defaulting compiler (PICO_COMPILER) to 'pico_arm_cortex_m33_gcc' since not specified.
Configuring toolchain based on PICO_COMPILER 'pico_arm_cortex_m33_gcc'
Defaulting PICO_GCC_TRIPLE to 'arm-none-eabi'
CMake Error at C:/Users/LastFirst(123)/.pico-sdk/cmake/v3.31.5/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/Users/LastFirst(123)/.pico-sdk/toolchain/14_2_Rel1/bin/arm-none-eabi-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'C:/code/pico_playground/blink/build/CMakeFiles/CMakeScratch/TryCompile-sm6qwo'
Run Build Command(s): C:/Users/LastFirst(123)/.pico-sdk/ninja/v1.12.1/ninja.exe -v cmTC_df74f
[1/2] C:\Users\LastFirst(123)\.pico-sdk\toolchain\14_2_Rel1\bin\arm-none-eabi-gcc.exe -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp -mfloat-abi=softfp -mcmse -std=gnu11 -o CMakeFiles/cmTC_df74f.dir/testCCompiler.c.obj -c C:/code/pico_playground/blink/build/CMakeFiles/CMakeScratch/TryCompile-sm6qwo/testCCompiler.c
[2/2] C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Users\LastFirst(123)\.pico-sdk\toolchain\14_2_Rel1\bin\arm-none-eabi-gcc.exe -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp -mfloat-abi=softfp -mcmse -Wl,--build-id=none -nostdlib CMakeFiles/cmTC_df74f.dir/testCCompiler.c.obj -o cmTC_df74f.elf && cd ."
FAILED: cmTC_df74f.elf
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Users\LastFirst(123)\.pico-sdk\toolchain\14_2_Rel1\bin\arm-none-eabi-gcc.exe -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp -mfloat-abi=softfp -mcmse -Wl,--build-id=none -nostdlib CMakeFiles/cmTC_df74f.dir/testCCompiler.c.obj -o cmTC_df74f.elf && cd ."
'C:\Users\LastFirst' is not recognized as an internal or external command,
operable program or batch file.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:31 (project)
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at ChildProcess.exithandler (node:child_process:415:12)
at ChildProcess.emit (node:events:518:28)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
2025-06-17 07:38:40.631 [error] [Window] [Extension Host] [�[31mERROR�[0m] [raspberry-pi-pico - cmakeUtil] Failed to configure CMake: Error: Command failed: "C:/Users/LastFirst(123)/.pico-sdk/cmake/v3.31.5/bin/cmake" -DPython3_EXECUTABLE="c:/Users/LastFirst(123)/AppData/Local/Programs/Python/Python313/python.exe" -G Ninja -B ./build "c:\code\pico_playground\blink"
PICO_SDK_PATH is C:/Users/LastFirst(123)/.pico-sdk/sdk/2.1.1
Target board (PICO_BOARD) is 'pico2_w'.
Using board configuration from C:/Users/LastFirst(123)/.pico-sdk/sdk/2.1.1/src/boards/include/boards/pico2_w.h
Pico Platform (PICO_PLATFORM) is 'rp2350-arm-s'.
CMake Error at C:/Users/LastFirst(123)/.pico-sdk/cmake/v3.31.5/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/Users/LastFirst(123)/.pico-sdk/toolchain/14_2_Rel1/bin/arm-none-eabi-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'C:/code/pico_playground/blink/build/CMakeFiles/CMakeScratch/TryCompile-vr9a8o'
Run Build Command(s): C:/Users/LastFirst(123)/.pico-sdk/ninja/v1.12.1/ninja.exe -v cmTC_71b1b
[1/2] C:\Users\LastFirst(123)\.pico-sdk\toolchain\14_2_Rel1\bin\arm-none-eabi-gcc.exe -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp -mfloat-abi=softfp -mcmse -std=gnu11 -o CMakeFiles/cmTC_71b1b.dir/testCCompiler.c.obj -c C:/code/pico_playground/blink/build/CMakeFiles/CMakeScratch/TryCompile-vr9a8o/testCCompiler.c
[2/2] C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Users\LastFirst(123)\.pico-sdk\toolchain\14_2_Rel1\bin\arm-none-eabi-gcc.exe -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp -mfloat-abi=softfp -mcmse -Wl,--build-id=none -nostdlib CMakeFiles/cmTC_71b1b.dir/testCCompiler.c.obj -o cmTC_71b1b.elf && cd ."
FAILED: cmTC_71b1b.elf
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Users\LastFirst(123)\.pico-sdk\toolchain\14_2_Rel1\bin\arm-none-eabi-gcc.exe -mcpu=cortex-m33 -mthumb -march=armv8-m.main+fp+dsp -mfloat-abi=softfp -mcmse -Wl,--build-id=none -nostdlib CMakeFiles/cmTC_71b1b.dir/testCCompiler.c.obj -o cmTC_71b1b.elf && cd ."
'C:\Users\LastFirst' is not recognized as an internal or external command,
operable program or batch file.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:31 (project)
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at ChildProcess.exithandler (node:child_process:415:12)
at ChildProcess.emit (node:events:518:28)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
To Reproduce
Steps to reproduce the behavior:
- Using an account with parentheses in the name ie. "LastFirst(123)"
- Install the latest extension vsix
- Create a blink example
- See error after the sdk is downloaded and the CMake configuration is automatically triggered
- To trigger the error again, click "Configure CMake" in the Project quick access toolbar
Expected behavior
Expected CMake configuration to succeed on a basic example project on Windows
Screenshots
Platform (please complete the following information):
- OS: Microsoft Windows [Version 10.0.22631.5335] - Windows 11
- Architecture: 64bit Intel
Additional context
I noticed that in the extensions settings, the instructions specifically say to use no spaces in the toolchain path options. This makes me think that the way the extension is set up that somehow quoting the strings inside the already quoted call to cmd.exe is an known problem. I wanted to create this bug to raise the issue that this affects users with certain constraints on their username. Perhaps an option to configure the extension to locate the .pico-sdk folder somewhere custom could be a way to side-step this issue. Manually moving this toolchain folder seems fraught since I can't find all the path references to fix.
