Skip to content

nil pointer on core install #72

Closed
@trevjonez

Description

@trevjonez

command: arduino-cli core install rambo:avr --debug

INFO[0000] Initiating configuration                     
INFO[0000] Unserializing configurations from /Users/tjones/go/bin/.cli-config.yml 
WARN[0000] Error reading config, using default configuration  error="open /Users/tjones/go/bin/.cli-config.yml: no such file or directory"
WARN[0000] Did not manage to get config file, using default configuration  error="open /Users/tjones/go/bin/.cli-config.yml: no such file or directory"
INFO[0000] Checking if CLI is Bundled into the IDE      
INFO[0000] Candidate IDE Directory: /Users/tjones/go/bin 
INFO[0000] CLI is not bundled into the IDE              
INFO[0000] Configuration set                            
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: /Users/tjones/Library/arduino15/packages 
INFO[0000] Loading package arduino from: /Users/tjones/Library/arduino15/packages/arduino/hardware 
INFO[0000] Loaded platform                               platform="arduino:[email protected]"
INFO[0000] Checking existence of 'tools' path: /Users/tjones/Library/arduino15/packages/arduino/tools 
INFO[0000] Loading tools from dir: /Users/tjones/Library/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 builtin from: /Users/tjones/Library/arduino15/packages/builtin 
INFO[0000] Checking existence of 'tools' path: /Users/tjones/Library/arduino15/packages/builtin/tools 
INFO[0000] Loading tools from dir: /Users/tjones/Library/arduino15/packages/builtin/tools 
INFO[0000] Loaded tool                                   tool="builtin:[email protected]"
INFO[0000] Loading package rambo from: /Users/tjones/Library/arduino15/packages/rambo/hardware 
INFO[0000] Loaded platform                               platform="rambo:[email protected]"
Downloading rambo:[email protected]...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x42fbdee]

goroutine 1 [running]:
github.com/arduino/arduino-cli/arduino/resources.(*DownloadResource).ArchivePath(0x0, 0xc0001ed5f0, 0x4d15a10, 0xc000055800, 0x0)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/arduino/resources/helpers.go:31 +0x2e
github.com/arduino/arduino-cli/arduino/resources.(*DownloadResource).IsCached(0x0, 0xc0001ed5f0, 0x40c5e60, 0x4d15a10, 0x0)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/arduino/resources/helpers.go:40 +0x39
github.com/arduino/arduino-cli/arduino/resources.(*DownloadResource).TestLocalArchiveIntegrity(0x0, 0xc0001ed5f0, 0xc0001ac000, 0x0, 0xc0001d1b60)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/arduino/resources/checksums.go:92 +0x3c
github.com/arduino/arduino-cli/arduino/resources.(*DownloadResource).Download(0x0, 0xc0001ed5f0, 0x1e, 0x467c420, 0xc0003b6140)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/arduino/resources/helpers.go:49 +0x4d
github.com/arduino/arduino-cli/arduino/cores/packagemanager.(*PackageManager).DownloadPlatformRelease(0xc000202480, 0xc0002d98f0, 0x0, 0x0, 0xf)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/arduino/cores/packagemanager/download.go:116 +0x3c
github.com/arduino/arduino-cli/commands/core.downloadPlatformByRef(0xc000202480, 0xc0001f0c90)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/commands/core/download.go:79 +0x243
github.com/arduino/arduino-cli/commands/core.runInstallCommand(0xc00020c780, 0xc0001e6aa0, 0x1, 0x2)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/commands/core/install.go:53 +0xd3
github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc00020c780, 0xc0001e6a40, 0x2, 0x2, 0xc00020c780, 0xc0001e6a40)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra/command.go:760 +0x2cc
github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0001f8780, 0xc00020d680, 0xc00020c280, 0xc0001f9900)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra/command.go:846 +0x2fd
github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra.(*Command).Execute(0xc0001f8780, 0x0, 0xc0001d1f88)
        /Users/tjones/go/src/github.com/arduino/arduino-cli/vendor/github.com/spf13/cobra/command.go:794 +0x2b
main.main()
        /Users/tjones/go/src/github.com/arduino/arduino-cli/main.go:30 +0x27

.cli-config.yml from current working dir:

board_manager:
  additional_urls:
    - https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json 

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions