Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

customBuildProperties does not put quotes on build.path #974

Closed
astro-stan opened this issue Feb 29, 2020 · 4 comments
Closed

customBuildProperties does not put quotes on build.path #974

astro-stan opened this issue Feb 29, 2020 · 4 comments

Comments

@astro-stan
Copy link

Ext version: 0.2.29
VScode version: 1.42.1
Arduino IDE version: 1.85
Board selected: one of the STM32Duino boards

The contents of my arduino.json look like:

{
    "sketch": "...",
    "board": "...",
    "configuration": ...,
    "output": "build"
}

However the full path of the output folder is

/home/myname/a_dir/another dir with spaces/myproject/build

The sketch verification fails with the error:

....
bash: line 0: [: too many arguments
mkdir: cannot create directory ‘another’: Permission denied
mkdir: cannot create directory ‘dir’: Permission denied
mkdir: cannot create directory ‘with’: Permission denied
mkdir: cannot create directory ‘spaces’: Permission denied
....

When I look at the build/build.options.json:

...
"customBuildProperties": "build.path=/home/myname/a_dir/another dir with spaces/myproject/build,...
...

Notice how the path is not in quotes. I suspect this is what is causing the issue. However I do no know how to force the arduino.json to put quotes around it.

@elektronikworkshop
Copy link
Contributor

Hi Slav,

thanks for reporting!

This seems to be a bug. I'll fix this in my fork and provide you with a link to an alpha version later.

Regards,
EW

@astro-stan
Copy link
Author

Hi EW,
thanks for the quick reply!

Waiting on the fix!

Regards,
Slav

@elektronikworkshop
Copy link
Contributor

elektronikworkshop commented Feb 29, 2020

You're welcome!

I can't reproduce the problem with an Arduino Nano. Here's my build output:

[Starting] Verify sketch - app.ino
Please see the build logs in Output path: /home/uli/Projects/delme with spaces/yet another folder/build
Picked up JAVA_TOOL_OPTIONS: 
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
<...snip...>

And my configuration

{
    "board": "arduino:avr:nano",
    "configuration": "cpu=atmega328",
    "sketch": "app.ino",
    "output": "build"
}

But with a BluePill I'm able to reproduce. This leads me to the conclusion that STM32Duino's build back-end can not handle output paths with spaces. You should file an issue there (and close this one 😉 of course).

Regards,
EW

P.S.: The reason I thought it was a bug: I'm currently implementing better IntelliSense support for this extension and thought I spotted something (I'm pretty familiar with the code base by now). But I was wrong.
P.P.S.: For the records: Forcing the quotes when invoking the build back-end with

--pref build.path="/my funny build/path"

Will cause the back-end to create a directory at a completely bad locations.

@astro-stan
Copy link
Author

astro-stan commented Feb 29, 2020

Hello EW,
Interesting result, I did not bother to try with other board types once I found the missing quotes.
Thank you for your time. I will open an issue in the stm32duino repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants