Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork436
Add first set ofprofile commands#2917
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Add first set ofprofile commands#2917
Uh oh!
There was an error while loading.Please reload this page.
Conversation
profile commandprofile commandscodecovbot commentedMay 21, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@## master #2917 +/- ##==========================================- Coverage 68.36% 68.29% -0.08%========================================== Files 241 252 +11 Lines 22731 23328 +597 ==========================================+ Hits 15541 15932 +391- Misses 5992 6166 +174- Partials 1198 1230 +32
Flags with carried forward coverage won't be shown.Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
896841b toa2c86efComparekittaakos commentedMay 27, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hello, this is great 🔥 Maybe you want to consider adding and removing multiple libs (later cores) with a single request. I do not know how it performs, but when a user interface wants to initialize a profile from a set of libraries and cores, one request would be better than multiple ones. Update: I checked the changes only from the point of the proto API as a client. |
alessio-perugini left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Great job! 🚀
We have a bug in the long standing:
arduino-cli/internal/arduino/sketch/profiles.go
Lines 166 to 167 in55f86b5
| res+=p.Platforms.AsYaml() | |
| res+=p.Libraries.AsYaml() |
arduino-cli profile init --profile Uno_profile -b arduino:avr:uno /tmp/skcat /tmp/sk/sketch.yamlprofiles: Uno_profile: fqbn: arduino:avr:uno platforms: - platform: arduino:avr (1.8.6) libraries:default_profile: c
You can see here that it produceslibraries: without[], this is an invalid yaml.
Basically we have to check if the items == 0, then we either skip that property or we setlibraries: [].
I'm afraid it could also happen for theplatforms so I'd put that check there too.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| } | ||
| newProfile:=&sketch.Profile{Name:req.GetProfileName(),FQBN:req.GetFqbn()} | ||
| // TODO: what to do with the PlatformIndexURL? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we have some kind of internal API that we can use to retrieve platform <-> index URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
cc:@cmaglie
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
per1234 left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I feel that the design of theprofile dump command is inappropriate. This command is actually printing the data of the entire sketch project file, not the build profile data alone. Although the primary usage of the sketch project file is currently for defining build profiles, it is not limited to this purpose and there is a good chance that it will be used for additional things unrelated to build profiles as time goes on.
Theprofile dump command should be a tool for printing the data from a build profile.
If you want a tool for printing the sketch project file, that should go somewhere else, such as under thesketch command (e.g.,sketch project dump), not under theprofile command.
If the user doesn't specify a profile ID, it should print the default build profile from the sketch project file. An--all flag could be added to cause it to print all build profiles present in the sketch project file.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
d92be42 to5381938CompareUh oh!
There was an error while loading.Please reload this page.
It creates a `sketch.yaml` file at the provided path. A new profile can be added to the file by providing a profile name and FQBN.
It adds one or multiple libraries to the specified profile.
It removes a library from the specified profile.
If the project file contains only one profile, it is automatically set as default, otherwise the `--default` flag can be used.Library operations are automatically executed on the default profile.
Sets the default profile to the provided existing profile.
It dumps the content of the project file.
Co-authored-by: Per Tillisch <accounts@perglass.com>
5381938 to3cd499aComparee9f6603 todbfdebdComparedbfdebd toe9ec51cCompareThis change makes the function libraryResolveDependencies a bit moregeneric, moving the rpc-related conversion into the gRPC method.This is useful for the next commits and, as a nice bonus, has alsomade more straighforward the exising InstallLibrary implementation.
e9ec51c to1a2a522Compare5721820 to830a052Compare830a052 to65354c4Compare
Uh oh!
There was an error while loading.Please reload this page.
Please check if the PR fulfills these requirements
Seehow to contribute
before creating one)
our contributing guidelines
UPGRADING.mdhas been updated with a migration guide (for breaking changes)configuration.schema.jsonupdated if new parameters are added.What kind of change does this PR introduce?
Code enhancement
What is the current behavior?
Operations on the
sketch.yamlproject file must be done manually.What is the new behavior?
First set of
profilecommands:profile init [<PATH>] [-m <PROFILE_NAME -b <FQBN>] [--default]creates asketch.yamlfile at the provided path. By default it creates the file in the current directory. A new profile can be added to the file by providing a profile name and FQBN (mandatory). The platform is detected automatically. If there is only one profile, it is automatically set as the default profile, otherwise the flag--defaultmust be used. The command fails in the following cases:profile lib add <LIB_NAME@LIB_VERSION> [-m <PROFILE_NAME] [--dest-dir <PATH>]adds a library to the provided profile or to the default one. By default it checks for thesketch.yamlfile in the current directory.profile lib remove <LIB_NAME> [-m <PROFILE_NAME] [--dest-dir <PATH>]removes a library from the provided profile or from the default one. By default it checks for thesketch.yamlfile in the current directory.profile set-default <PROFILE_NAME> [--dest-dir <PATH>]sets the default profile to an existing profile. By default it checks for thesketch.yamlfile in the current directory.profile dump [<PATH>]dumps the content of thesketch.yamlfile. It supports theyamlandjsonformats.Does this PR introduce a breaking change, and istitled accordingly?
Other information