-
-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ash fails when Windows username contains spaces #2602
Comments
Something else worth noting: SDCC cannot take multiple C files. It can take a C file and multiple rel files (SDCC object files). I'm not sure what the "re2" in the SDCC command is, but maybe it is being interpreted as an another file? The two ash errors are almost certainly due to lack of any quoting at all in the first two busybox commands that invoke ash. I wonder if the "re2" is an artifact of those failures? I'll take a look at the wrapper script tomorrow and see exactly what it is doing with the arguments. This might be related to arduino/arduino-cli#958, though that is a batch file and not a shell script. |
Hi @Rybec. The problem is a lack of quoting in the compilation command templates defined in the ch55xduino boards platform: https://github.com/DeqingSun/ch55xduino/blob/ch55xduino/ch55xduino/ch55x/platform.txt Please report the bug to that project's issue tracker: https://github.com/DeqingSun/ch55xduino/issues
Nice work on finding that issue! However, as you pointed out, that bug is specific to batch files so it is not relevant. This is actually good news because working around that bug is difficult, while in this case the fix is simply a matter of adding some quotes in |
Thanks for helping to narrow this down! I'll report this to ch55xduino. |
Related to: DeqingSun/ch55xduino#175 Ok, this might indeed be an Arduino issue. I've looked at the various files, I've worked out what commands are actually being executed, I've messed with the shell script file, and I've experimented at the command line. Here's what I've worked out: The ash errors seem to be separate from the sdcpp error. Those are part of the "Detecting libraries used..." and "Generating function prototypes..." steps, and they aren't using the quoting that appears to be specified in platform.txt. (Can someone with more experience look at platform.txt in ch55xduino and let me know if the quoting looks right? While things appear to be correctly quoted, I don't actually know exactly what it should look like... If there are things in there that are not quoted correctly, please let me know what correct quoting looks like, and I'll work with DeqingSun to fix it.) As far as I can tell, the wrapper shell script is quoting arguments correctly, except that certain arguments are being passed to the script by Arduino without proper quoting. The paths in question are the include paths:
I'm attempting to modify the wrapper script to quote these, but it' a bit of a pain, because quoting 100% of the arguments fails (because some arguments don't like to be quoted), so I'm going to have to look for Solutions I've found that allow compilation when working from the command line include quoting the full argument, eg. |
Ok, they are properly quoted coming into the script, as they enter as complete arguments rather than individual components. Is there a way in platform.txt to add a second layer of quoting to just the If not, then it looks like the only solution is for me to learn shell scripting better and add quotes back on in the script. |
Line 76 in platform.txt might be a place where an additional layer of quotes (probably escaped) would help, however that will only solve one of the three include lines (the one that ends with |
DeqingSun/ch55xduino#175 (comment) I tried this. It appears to work for the third |
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).
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...)
Issue checklist
The text was updated successfully, but these errors were encountered: