-
-
Notifications
You must be signed in to change notification settings - Fork 398
nil pointer on core install #72
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
Comments
seens mostly a duplicate of #30 but I think the error should be more useful than an NPE at the least. |
uhm I can't reproduce this one:
are you using the latest alpha-release? could you check with |
arduino-cli version 0.3.1-alpha.preview main issue was my not understanding where to put the Assumption as to a solution to this issue: Edit: Just to clarify the install is via |
I'd like to reproduce the
without adding the 3rd party URL, but the result is:
so the cli correctly detects that there is no
maybe it was a partial install? |
I think it was installed via the IDE initially but if I invoke to install without the correct cli config and it is already installed I get this NP |
Hi, @cmaglie I met roughly the same issue here. Could you please help to see how to fix it? I use arduino-cli version: arduino-cli-0.3.6-alpha.(Download link) Steps:
board_manager:
additional_urls:
- https://raw.githubusercontent.com/VSChina/azureiotdevkit_tools/master/package_azureboard_index.json
$ arduino-cli core update-index
Updating index: package_index.json downloaded
Updating index: package_azureboard_index.json downloaded
$ arduino-cli core install AZ3166:stm32f4 --debug
INFO[0000] Checking for config file in: /home/builder/.arduino15/arduino-cli.yaml
INFO[0000] Reading configuration from /home/builder/.arduino15/arduino-cli.yaml
INFO[0000] Checking if CLI is Bundled into the IDE
INFO[0000] Candidate IDE Directory: /usr/bin
INFO[0000] CLI is not bundled into the IDE
INFO[0000] Checking for config in: /arduino-cli.yaml
INFO[0000] error loading error="open /arduino-cli.yaml: no such file or directory"
INFO[0000] Checking for config in: /home/arduino-cli.yaml
INFO[0000] error loading error="open /home/arduino-cli.yaml: no such file or directory"
INFO[0000] Checking for config in: /home/builder/arduino-cli.yaml
INFO[0000] error loading error="open /home/builder/arduino-cli.yaml: no such file or directory"
INFO[0000] Checking for config in: /home/builder/.arduino15/arduino-cli.yaml
INFO[0000] Checking for config in: /home/builder/.arduino15/packages/arduino-cli.yaml
INFO[0000] error loading error="open /home/builder/.arduino15/packages/arduino-cli.yaml: no such file or directory"
INFO[0000] Checking for config in: /home/builder/.arduino15/packages/AZ3166/arduino-cli.yaml
INFO[0000] error loading error="open /home/builder/.arduino15/packages/AZ3166/arduino-cli.yaml: no such file or directory"
INFO[0000] Configuration set
INFO[0000] arduino-cli-0.3.6-alpha.preview
INFO[0000] Starting root command preparation (`arduino`)
INFO[0000] Formatter set
INFO[0000] Executing `arduino core download`
INFO[0000] Package manager will scan only managed hardware folder
INFO[0000] Initializing package manager
INFO[0000] Loading hardware from: /home/builder/.arduino15/packages
INFO[0000] Loading package AZ3166 from: /home/builder/.arduino15/packages/AZ3166/hardware
INFO[0000] Checking existence of 'tools' path: /home/builder/.arduino15/packages/AZ3166/tools
INFO[0000] Loading tools from dir: /home/builder/.arduino15/packages/AZ3166/tools
INFO[0000] Loaded tool tool="AZ3166:arm-none-eabi-gcc@5_4-2016q3"
INFO[0000] Loaded tool tool="AZ3166:[email protected]"
INFO[0000] Loading package arduino from: /home/builder/.arduino15/packages/arduino
INFO[0000] Checking existence of 'tools' path: /home/builder/.arduino15/packages/arduino/tools
INFO[0000] Loading tools from dir: /home/builder/.arduino15/packages/arduino/tools
INFO[0000] Loaded tool tool="arduino:[email protected]"
INFO[0000] Loaded tool tool="arduino:[email protected]"
INFO[0000] Loaded tool tool="arduino:[email protected]"
INFO[0000] Loading package esp8266 from: /home/builder/.arduino15/packages/esp8266/hardware
INFO[0000] Loaded platform platform="esp8266:[email protected]"
INFO[0000] Checking existence of 'tools' path: /home/builder/.arduino15/packages/esp8266/tools
INFO[0000] Loading tools from dir: /home/builder/.arduino15/packages/esp8266/tools
INFO[0000] Loaded tool tool="esp8266:[email protected]"
INFO[0000] Loaded tool tool="esp8266:[email protected]"
INFO[0000] Loaded tool tool="esp8266:[email protected]"
WARN[0000] Tool already installed platform="AZ3166:[email protected]" tool="AZ3166:arm-none-eabi-gcc@5_4-2016q3"
Tool AZ3166:arm-none-eabi-gcc@5_4-2016q3 already installed
WARN[0000] Tool already installed platform="AZ3166:[email protected]" tool="AZ3166:[email protected]"
Tool AZ3166:[email protected] already installed
AZ3166:[email protected] already downloaded
INFO[0000] Installing platform platform="AZ3166:[email protected]"
Installing AZ3166:[email protected]...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x4fd462]
goroutine 1 [running]:
github.com/arduino/arduino-cli/vendor/github.com/arduino/go-paths-helper.(*Path).Rename(0x0, 0xc4200755c0, 0xc421892ce0, 0x0)
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/vendor/github.com/arduino/go-paths-helper/paths.go:211 +0x22
github.com/arduino/arduino-cli/arduino/resources.(*DownloadResource).Install(0xc4202a1770, 0xc420075de0, 0xc420075df0, 0xc4200755c0, 0x0, 0x0)
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/arduino/resources/install.go:88 +0x61b
github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).InstallPlatform(0xc4200a4b80, 0xc4202d0690, 0x0, 0x0)
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/arduino/cores/packagemanager/install_uninstall.go:33 +0x108
github.com/arduino/arduino-cli/commands/core.installPlatform(0xc4200a4b80, 0xc4202d0690, 0xc420075330, 0x2, 0x2)
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/commands/core/install.go:110 +0x5d2
github.com/arduino/arduino-cli/commands/core.installPlatformByRef(0xc4200a4b80, 0xc42016ced0)
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/commands/core/install.go:66 +0x7e
github.com/arduino/arduino-cli/commands/core.runInstallCommand(0xc42019f400, 0xc420105680, 0x1, 0x2)
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/commands/core/install.go:53 +0xcb
github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc42019f400, 0xc420105620, 0x2, 0x2, 0xc42019f400, 0xc420105620)
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc420153400, 0xc4201a4500, 0xc42019ef00, 0xc42019e780)
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra.(*Command).Execute(0xc420153400, 0x8c7fbc, 0xc420181f78)
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra/command.go:800 +0x2b
main.main()
/home/jenkins/workspace/arduino-cli/src/github.com/arduino/arduino-cli/main.go:30 +0x27 I was able to core install Besides,
Any help is appreciated. THX! |
Hi @dilin-MS, I've analyzed your packages and I think the problem is not the same as the OP. In your case, the error is caused by your ZIP archive becuase it has the filenames encoded with the backslash This results on unix/linux in a folder full of files with the
just to be clear, inside the folder
because unix/linux allows backslashes to be part of the name! So a workaround for now would be to re-do the zip archive using forward slashes only. Now, I'm fixing the crash on the arduino-cli and also print a better error message, PR is coming for this. |
Hi @cmaglie, We are using .net api(version earlier than 4.6.1) to zip the package. I figure out that .net api 4.6.1 fix the slash problem. Thanks! |
Hi, @cmaglie . I took a try and the build with the fix works like a charm :) |
Reopening since the OP original issue may not be fixed yet. |
Couldn't reproduce original issue with 0.4.0-rc1, closing. |
Fix crash when running LibraryPropertiesNameFieldGTRecommendedLength check function
command:
arduino-cli core install rambo:avr --debug
.cli-config.yml from current working dir:
Looks like the current dir is not considered for the .cli-config.yml and it is expected in the same dir as the arduino-cli executable. Once I cp the cli config over to the expected dir it works fine.
should probably print a more useful error at the least but my naive understanding it seems like it should consider the working dir for loading the cli config since the config is very much something that could be specific to a project and perhaps undesirable as a global config.
The text was updated successfully, but these errors were encountered: