Skip to content
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

[skip-changelog] Correct profile dependency version constraint format in demo sketch project file #2590

Merged
merged 1 commit into from May 14, 2024

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented May 5, 2024

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • [N/A] Tests for the changes have been added (for bug fixes / features)
  • [N/A] Docs have been added / updated (for bug fixes / features)
  • [N/A] UPGRADING.md has been updated with a migration guide (for breaking changes)
  • [N/A] configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

Docs fix

What is the current behavior?

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 causes 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

What is the new behavior?

Use valid version constraint format in demonstration sketch project file.

Does this PR introduce a breaking change, and is titled accordingly?

No breaking change.

… 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 per1234 added topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project labels May 5, 2024
@per1234 per1234 self-assigned this May 5, 2024
@per1234 per1234 merged commit 21c5803 into arduino:master May 14, 2024
6 checks passed
@per1234 per1234 deleted the fix-demo-project-file branch May 14, 2024 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants