-
-
Notifications
You must be signed in to change notification settings - Fork 456
Closed
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: build-processRelated to the sketch build processRelated to the sketch build processtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Describe the problem
In the first minutes of using sketch.yaml, without even knowing if the syntax is correct, arduino-cli panics.
% cat sketch.yaml
profiles:
garage:
fqbn: arduino:avr:uno
default_profile: garage
% arduino-cli compile
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/arduino/arduino-cli/internal/arduino/sketch.(*Profile).RequireSystemInstalledPlatform(...)
/home/runner/work/arduino-cli/arduino-cli/internal/arduino/sketch/profiles.go:127
github.com/arduino/arduino-cli/commands.(*arduinoCoreServerImpl).Init(0xc00000ec48, 0xc00038d040, {0x147ff40, 0xc00000f560})
/home/runner/work/arduino-cli/arduino-cli/commands/instances.go:253 +0x35ba
github.com/arduino/arduino-cli/internal/cli/instance.InitWithProfile({0x147ac88, 0xc0002fa1e0}, {0x148f6c8, 0xc00000ec48}, 0xc0003d4c60, {0xc000277950, 0x6}, 0xc0003c08e0)
/home/runner/work/arduino-cli/arduino-cli/internal/cli/instance/instance.go:80 +0x30b
github.com/arduino/arduino-cli/internal/cli/instance.CreateAndInitWithProfile({0x147ac88, 0xc0002fa1e0}, {0x148f6c8, 0xc00000ec48}, {0xc000277950, 0x6}, 0xc0003c08e0)
/home/runner/work/arduino-cli/arduino-cli/internal/cli/instance/instance.go:45 +0x115
github.com/arduino/arduino-cli/internal/cli/compile.runCompileCommand(0xc000398308, {0x1ce7ac0, 0x0, 0xe5d5bf9eb8329472?}, {0x148f6c8, 0xc00000ec48})
/home/runner/work/arduino-cli/arduino-cli/internal/cli/compile/compile.go:178 +0x328
github.com/arduino/arduino-cli/internal/cli/compile.NewCommand.func2(0xc000398308, {0x1ce7ac0, 0x0, 0x0})
/home/runner/work/arduino-cli/arduino-cli/internal/cli/compile/compile.go:96 +0x9e
github.com/spf13/cobra.(*Command).execute(0xc000398308, {0x1ce7ac0, 0x0, 0x0})
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1019 +0xa91
github.com/spf13/cobra.(*Command).ExecuteC(0xc00019e608)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1148 +0x46f
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.10.2/command.go:1064
main.main()
/home/runner/work/arduino-cli/arduino-cli/main.go:92 +0x468
To reproduce
$ cat <<EOF > sketch.yaml
garage:
fqbn: arduino:avr:uno
default_profile: garage
EOF
$ arduino-cli compile
Expected behavior
no panic whatever the content of sketch.yaml
Arduino CLI version
arduino-cli Version: nightly-20260119 Commit: 33cb387 Date: 2026-01-19T01:38:10Z
Operating system
Linux
Operating system version
Linux 6.18.5 / GNU libc 2.42
Additional context
Compiled with go 1.25.5 and 1.24.11: same result.
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details
cmaglie
Metadata
Metadata
Assignees
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: build-processRelated to the sketch build processRelated to the sketch build processtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project