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

Add support for defining a default build profile #1752

Closed
3 tasks done
per1234 opened this issue Jun 8, 2022 · 2 comments · Fixed by #2203
Closed
3 tasks done

Add support for defining a default build profile #1752

per1234 opened this issue Jun 8, 2022 · 2 comments · Fixed by #2203
Assignees
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@per1234
Copy link
Contributor

per1234 commented Jun 8, 2022

Describe the request

Implement the "Using a default profile" component of the "Sketch build profiles and reproducible builds" RFC.

Describe the current behavior

The majority of the "Sketch build profiles and reproducible builds" RFC has now been implemented (#1713).

One missing part is the support for the default_profile key of the sketch project file.

🙁 There is currently no way to define a default profile, to be used when the arduino-cli command operating on a sketch with build profiles does not contain a --profile flag.

Arduino CLI version

0.23.0

Operating system

All

Operating system version

N/A

Additional context

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 8, 2022
@MatteoPologruto MatteoPologruto linked a pull request Jun 6, 2023 that will close this issue
6 tasks
@cmaglie
Copy link
Member

cmaglie commented Jun 14, 2023

Here are some use cases and the expected outcome:

Sketch with the following project file:

profiles:
  uno:
    fqbn: arduino:avr:uno
    platforms:
      - platform: arduino:avr (1.8.6)

Case 1:

$ arduino-cli compile

Output: error Missing FQBN (Fully Qualified Board Name)

Case 2:

$ arduino-cli compile --profile uno

Output: compile using profile uno

Case 3:

$ arduino-cli compile --profile uno -b arduino:avr:leonardo

Output: compile using profile uno but overrides FQBN with arduino:avr:leonardo

Case 4:

$ arduino-cli compile -b arduino:avr:uno

Output: compile for arduino:avr:uno without using the profiles

Sketch with the following project file:

profiles:
  uno:
    fqbn: arduino:avr:uno
    platforms:
      - platform: arduino:avr (1.8.6)

  leonardo:
    fqbn: arduino:avr:leonardo
    platforms:
      - platform: arduino:avr (1.8.6)

default_profile: leonardo

Case 5:

$ arduino-cli compile

Output: compiles using the default profile leonardo

Case 6:

$ arduino-cli compile --profile uno

Output: compiles using profile uno

Case 7:

$ arduino-cli compile --profile uno -b arduino:avr:leonardo

Output: compile using profile uno but overrides FQBN with arduino:avr:leonardo

Case 8:

$ arduino-cli compile -b arduino:avr:uno

Output: compile using the default profile leonardo but overrides FQBN with arduino:avr:uno

@alexxus
Copy link

alexxus commented Aug 16, 2023

Please implement it. It would be so helpful!

I'm forced to use the --profile flag, even if my sketch.yaml file has only one profile. It doesn't make sense!
arduino-cli could simply default to the single profile.

Something like default_profile: leonardo, like suggested by @cmaglie, could be also a good alternative. In fact, it would be almost better than the "magical" defaulting to the single profile. In this case the user would tell, which profile has to be used as the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants