Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip-changelog] Correct profile dependency version constraint format…
Browse files Browse the repository at this point in the history
… in demo sketch project file

The Sketch Project File documentation includes a demonstration of a complete project file.

Sketch project files use Arduino CLI's `<dependency ID> (<constraint>)` version constraint format but previously an
unsupported `<dependency ID>@<version>` format was used in some of the dependencies specified in the demonstration
project file. This would cause a panic if used in a project file:

panic: profiles parsing err: invalid 'platform' directive

goroutine 1 [running]:
github.com/arduino/arduino-cli/arduino/sketch.(*projectRaw).getProfiles(0xc0003f2000)
        E:/git/arduino/arduino-cli/arduino/sketch/profiles.go:84 +0x1fe
github.com/arduino/arduino-cli/arduino/sketch.LoadProjectFile(0xc0002fac40?)
        E:/git/arduino/arduino-cli/arduino/sketch/profiles.go:265 +0xb6
github.com/arduino/arduino-cli/arduino/sketch.New(0xc00022d6c0?)
        E:/git/arduino/arduino-cli/arduino/sketch/sketch.go:90 +0x587
github.com/arduino/arduino-cli/commands/sketch.LoadSketch({0xc000150060?, 0xc000000004?}, 0xc00022d9b8?)
        E:/git/arduino/arduino-cli/commands/sketch/load.go:30 +0x58
github.com/arduino/arduino-cli/internal/cli/compile.runCompileCommand(0xc0003aa000?, {0xc0003029c0, 0x1, 0x15c1559?})
        E:/git/arduino/arduino-cli/internal/cli/compile/compile.go:162 +0x1dc
github.com/spf13/cobra.(*Command).execute(0xc0003aa000, {0xc000302990, 0x1, 0x1})
        C:/Users/per/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x863
github.com/spf13/cobra.(*Command).ExecuteC(0xc00019e300)
        C:/Users/per/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3a5
github.com/spf13/cobra.(*Command).Execute(0x0?)
        C:/Users/per/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992 +0x13
main.main()
        E:/git/arduino/arduino-cli/main.go:31 +0xda
per1234 committed May 5, 2024
1 parent 03d8653 commit 2cabf7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/sketch-project-file.md
Original file line number Diff line number Diff line change
@@ -81,9 +81,9 @@ profiles:
notes: testing the very limit of the AVR platform, it will be very unstable
fqbn: attiny:avr:ATtinyX5:cpu=attiny85,clock=internal16
platforms:
- platform: attiny:avr@1.0.2
- platform: attiny:avr (1.0.2)
platform_index_url: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
- platform: arduino:avr@1.8.3
- platform: arduino:avr (1.8.3)
libraries:
- ArduinoIoTCloud (1.0.2)
- Arduino_ConnectionHandler (0.6.4)

0 comments on commit 2cabf7b

Please sign in to comment.