Problems installing Blinks SDK with Arduino CLI

VSCode is deprecating using Arduino IDE so I decided to try to use the new thing. Installation is failing due to what appears to be a file that ended up with some weird attributes when uncompressed under Linux:

./arduino-cli.app core install move38:avr
Tool arduino:avr-gcc@7.3.0-atmel3.6.1-arduino5 already installed
Tool arduino:avrdude@6.3.0-arduino17 already installed
Downloading packages...
move38:avr@1.3.0 downloaded                                                                            
Installing platform move38:avr@1.3.0...
Error during install: Cannot install platform: installing platform move38:avr@1.3.0: extracting archive: Create file /home/bga/.arduino15/tmp/package-647673701/Move38-Arduino-Platform/libraries/Examples05/BrokenRainbow/Broken Rainbow Map.png: open /home/bga/.arduino15/tmp/package-647673701/Move38-Arduino-Platform/libraries/Examples05/BrokenRainbow/Broken Rainbow Map.png: permission denied

It appears to be a combination of the file having the extent attribute set when uncompressed and having spaces on its name.

@bigjosh @jbobrow any chance you can take a look at this and possibly get it sorted up? That file is not technically even required to be there as it just serves to illustrate what the code is doing.

I had this issue a little bit ago I believe, it isn’t a great idea in general but what worked for me is to run it with sudo arduino, just make sure when you save it doesn’t save to a root folder.

Yeah, but having to install as root is not really a good solution to anything as there are several implications to doing that. This is definitely an easy fix in any case.

@BGA issue filed on the Github repo, should be able to test this out soon. I believe we see the same issue with the Arduino 2.0 IDE on mac computers.

Thanks. And yes, it most likely affects all POSIX-like systems.

1 Like

The repo is now updated, should test from a couple of different setups and welcome feedback to see if we are covering our bases.

1 Like

Thanks. It seems to be working now.

I am now getting a 404 error when trrying to download the platform package. Apparently this URL is incorrect:

https://github.com/bigjosh/Move38-Arduino-Platform/releases/download/1.3.1/Move38-Arduino-Platform-main.zip

I get a 404 when trying to download it manually.

Apparently the right link is:

https://github.com/bigjosh/Move38-Arduino-Platform/releases/download/1.3.1/Move38-Arduino-Platform.zip

(no “main” in the zip file name).

@bigjosh @jbobrow

Also, after locally fixing the URL, I am seeing this error:

./arduino-cli.app core install move38:avr
Tool arduino:avr-gcc@7.3.0-atmel3.6.1-arduino5 already installed
Tool arduino:avrdude@6.3.0-arduino17 already installed
Downloading packages…
move38:avr@1.3.1 downloaded
Installing platform move38:avr@1.3.1…
Error during install: Cannot install platform: installing platform move38:avr@1.3.1: extracting archive: Create file /home/bga/.arduino15/tmp/package-167593641/Move38-Arduino-Platform/libraries/Examples04/examples/BrokenRainbow/BrokenRainbow.ino: open /home/bga/.arduino15/tmp/package-167593641/Move38-Arduino-Platform/libraries/Examples04/examples/BrokenRainbow/BrokenRainbow.ino: permission denied

I guess the permission denied error is due to some weird attributes attached to the file.

And, for completeness. The actual error is not when unzipping the files but when trying to remove the temporary dir. I can manually reproduce that:

$ rm -rf Move38-Arduino-Platform/
rm: cannot remove 'Move38-Arduino-Platform/libraries/Examples04/examples/BrokenRainbow/BrokenRainbow.ino': Permission denied
rm: cannot remove 'Move38-Arduino-Platform/libraries/Examples04/examples/BrokenRainbow/Broken-Rainbow-Map.png': Permission denied

I tried to figure out what is happening. It is not a posix permission issue:

$ ls -l .
total 84
-rw-rw-r-- 1 bga bga 11811 Aug  1  2020 BrokenRainbow.ino
-rw-rw-r-- 1 bga bga 73094 May 28  2022 Broken-Rainbow-Map.png

And the only extended attribute on the files is the extent marker:

$ lsattr *
--------------e------- BrokenRainbow.ino
--------------e------- Broken-Rainbow-Map.png

Could it be that the file is being created on MacOS and something fishy happens due to that?

The parent directory also have the e attribute set and if I copy it, I can not remove the copy. I can also not create a file insider the directory.

sudo takes care of all of that but arduino-cli obviously does not use sudo for installations.

RE -main:

I’ve added the file https://github.com/bigjosh/Move38-Arduino-Platform/releases/download/1.3.1/Move38-Arduino-Platform-main.zip to the release so now either URL should work.

RE: Read-only error
Yea, this is a problem on Linux and OSX. I tracked it down to the extraction library they used for the Arduino-CLI…

I will clear these attribs on the next board manager push.

Thanks as always!

-josh

2 Likes

I am going to go there hit my head on the wall and will be right back. I figured out the issue and it was one of those in your face things:

$ ls -la
total 92
dr-xr-xr-x 2 bga bga  4096 Feb 22 23:16 .
drwxrwxr-x 3 bga bga  4096 Mar 17 13:37 ..
-rw-rw-r-- 1 bga bga 11812 Mar 17 13:44 BrokenRainbow.ino
-rw-rw-r-- 1 bga bga 73094 May 28  2022 Broken-Rainbow-Map.png

Check the current directory (“.”) permissions. It has no write permissions for the user, group or others so if you try to remove the files inside it will fail as you can not remove the directory entry. The solution?

chmod ugo+w .

@bigjosh that should be an easy fix. Just make sure the directory has the correct permissions (probably in your repository).

Do you still plan to push the next board manager?