Skip to content

ash fails when Windows username contains spaces #2602

Closed as not planned
Closed as not planned
@Rybec

Description

@Rybec

Describe the problem

ash fails with the following error. My Windows username has two spaces in it (thank Microsoft's garbage Windows installer for that). I get the following error when attempting to build. ("Thalin" is the middle portion of the username, and it has a space before and after it).

ash: Thalin: unknown operand
ash: Thalin: unknown operand
sdcpp.exe: fatal error: too many input files
compilation terminated.
subprocess error 1
ash: Thalin: unknown operand
ash: Thalin: unknown operand

exit status 1

Compilation error: exit status 1

To reproduce

Install Windows 10, and give it a full name including middle, and it defaults to trying to just use the whole thing, spaces and all, as your username.
(TL;DR: Have two spaces in your Windows username.)
Install Arduino IDE (version 2.3.4 is what I'm using, but I did also test the nightly build noted in the version field).

I don't know how much difference this part makes, but I'm using ch55xduino with a QT Py CH552. So I installed ch55xduino, setup the board, and so on. (Additional notes on this later.)

Attempt to compile a simple sketch. (Copy/pasted from Adafruit's QT Py CH552 tutorial.)

Expected behavior

When I click "Verify" the sketch compiles successfully.

Arduino IDE version

2.3.5-nightly-20241212 (please make About dialog copyable!)

Operating system

Windows

Operating system version

10

Additional context

Note that the current official version of SDCC also has it's own spaces-in-path bug, and the SDCC that comes with c55xduino is old enough to still have this bug. I have replaced that broken version of SDCC in my local copy of c55xduino with the most recent snapshot, which no longer has that bug (I've tested it at the command line). The reason sdcpp.exe is failing is that it is getting an unquoted path with spaces as an argument, which ash interpreted as two separate arguments, because whatever is calling it has failed to correctly quote the path.

For completeness, I've enabled verbose compilation. Here is the output from that. (Given that the initial error is thrown by ash, I doubt the wrapper shell script has anything to do with this, though it may create additional errors once the ash error is resolved. I'll take a look at that tomorrow, and if it strips quotes without replacing them, I'll file a bug report with ch55xduino. I already need to file a bug report for that project encouraging updating to the latest SDCC snapshot.)

Hmm, it looks like the problem may be with busybox, given that the compile command does seem have everything quoted... (According to MS, some terminal programs don't handle argument quoting correctly. Maybe busybox is an example of this...)

FQBN: CH55xDuino:mcs51:ch552:clock=16internal
Using board 'ch552' from platform in folder: C:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\hardware\mcs51\0.0.25
Using core 'ch55xduino' from platform in folder: C:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\hardware\mcs51\0.0.25

Detecting libraries used...
C:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\tools\MCS51Tools\2023.10.10/win/busybox ash C:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\tools\MCS51Tools\2023.10.10/wrapper/sdcc.sh C:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\tools\sdcc\build.13407_4/bin/sdcc C:\Users\Rybec Thalin Arethda\AppData\Local\arduino\sketches\F28B92F05926EE5B7BA4053F3A9A7367\sketch\sketch_dec20a.ino.cpp nul re12 -c -Ddouble=float -DUSE_STDINT -D__PROG_TYPES_COMPAT__ --model-large --int-long-reent -E -MC -mmcs51 -DCH552 -DF_CPU=16000000L -DF_EXT_OSC=0L -DARDUINO=10607 -DARDUINO_ch55x -DARDUINO_ARCH_MCS51 -DEP0_ADDR=0 -DEP1_ADDR=10 -DEP2_ADDR=20 -IC:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\hardware\mcs51\0.0.25\cores\ch55xduino -IC:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\hardware\mcs51\0.0.25\variants\ch552 -IC:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\tools\sdcc\build.13407_4/include
Generating function prototypes...
C:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\tools\MCS51Tools\2023.10.10/win/busybox ash C:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\tools\MCS51Tools\2023.10.10/wrapper/sdcc.sh C:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\tools\sdcc\build.13407_4/bin/sdcc C:\Users\Rybec Thalin Arethda\AppData\Local\arduino\sketches\F28B92F05926EE5B7BA4053F3A9A7367\sketch\sketch_dec20a.ino.cpp C:\Users\Rybec Thalin Arethda\AppData\Local\Temp\1859949367\sketch_merged.cpp re12 -c -Ddouble=float -DUSE_STDINT -D__PROG_TYPES_COMPAT__ --model-large --int-long-reent -E -MC -mmcs51 -DCH552 -DF_CPU=16000000L -DF_EXT_OSC=0L -DARDUINO=10607 -DARDUINO_ch55x -DARDUINO_ARCH_MCS51 -DEP0_ADDR=0 -DEP1_ADDR=10 -DEP2_ADDR=20 -IC:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\hardware\mcs51\0.0.25\cores\ch55xduino -IC:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\hardware\mcs51\0.0.25\variants\ch552 -IC:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\CH55xDuino\tools\sdcc\build.13407_4/include
ash: Thalin: unknown operand
ash: Thalin: unknown operand
C:\Users\Rybec Thalin Arethda\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\Rybec Thalin Arethda\AppData\Local\Temp\1859949367\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\Rybec Thalin Arethda\\AppData\\Local\\Arduino15\\packages\\CH55xDuino\\tools\\MCS51Tools\\2023.10.10/win/busybox" ash "C:\\Users\\Rybec Thalin Arethda\\AppData\\Local\\Arduino15\\packages\\CH55xDuino\\tools\\MCS51Tools\\2023.10.10/wrapper/sdcc.sh" "C:\\Users\\Rybec Thalin Arethda\\AppData\\Local\\Arduino15\\packages\\CH55xDuino\\tools\\sdcc\\build.13407_4/bin/sdcc" "C:\\Users\\Rybec Thalin Arethda\\AppData\\Local\\arduino\\sketches\\F28B92F05926EE5B7BA4053F3A9A7367\\sketch\\sketch_dec20a.ino.cpp" "C:\\Users\\Rybec Thalin Arethda\\AppData\\Local\\arduino\\sketches\\F28B92F05926EE5B7BA4053F3A9A7367\\sketch\\sketch_dec20a.ino.cpp.o" re2 -MMD -c -Ddouble=float -DUSE_STDINT -D__PROG_TYPES_COMPAT__ --model-large --int-long-reent --less-pedantic -mmcs51 -DCH552 -DF_CPU=16000000L -DF_EXT_OSC=0L -DARDUINO=10607 -DARDUINO_ch55x -DARDUINO_ARCH_MCS51 -DEP0_ADDR=0 -DEP1_ADDR=10 -DEP2_ADDR=20 "-IC:\\Users\\Rybec Thalin Arethda\\AppData\\Local\\Arduino15\\packages\\CH55xDuino\\hardware\\mcs51\\0.0.25\\cores\\ch55xduino" "-IC:\\Users\\Rybec Thalin Arethda\\AppData\\Local\\Arduino15\\packages\\CH55xDuino\\hardware\\mcs51\\0.0.25\\variants\\ch552" "-IC:\\Users\\Rybec Thalin Arethda\\AppData\\Local\\Arduino15\\packages\\CH55xDuino\\tools\\sdcc\\build.13407_4/include"
sdcpp.exe: fatal error: too many input files
compilation terminated.
subprocess error 1
ash: Thalin: unknown operand
ash: Thalin: unknown operand

exit status 1

Compilation error: exit status 1

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions