Skip to content

Allow platforms without fixed version in profiles. #2940

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Jun 30, 2025

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
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

The idea is to allow in the sketch.yml platforms without a specific version, like the following giga_any:

profiles:
  giga:
    fqbn: arduino:mbed_giga:giga
    platforms:
      - platform: arduino:mbed_giga (4.3.1)

  giga_any:
    fqbn: arduino:mbed_giga:giga
    platforms:
      - platform: arduino:mbed_giga      # this does not specify a version
      # no need to specify index_url either

default_profile: giga_any

In this case, the Arduino CLI will not download the platform to the internal space, but it will use the globally installed platform.

What is the current behavior?

You must specify a version in the platform directive of the sketch.yml

What is the new behavior?

You can omit a version in the platform directive of the sketch.yml, in this case the Arduino CLI will use the globally installed platform.

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

No

Other information

cmaglie added 4 commits June 27, 2025 14:17
This will help to simplify the next commits.
If a platform requires tools from another referenced platform, we must
extract the relevant data in the `installed.json` file too.
@cmaglie cmaglie self-assigned this Jun 30, 2025
@cmaglie cmaglie added type: enhancement Proposed improvement topic: CLI Related to the command line interface topic: build-process Related to the sketch build process labels Jun 30, 2025
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 11 lines in your changes missing coverage. Please review.

Project coverage is 67.94%. Comparing base (4891ded) to head (69761fb).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
internal/arduino/sketch/profiles.go 83.33% 3 Missing and 4 partials ⚠️
internal/arduino/cores/packageindex/index.go 94.66% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2940      +/-   ##
==========================================
+ Coverage   67.82%   67.94%   +0.12%     
==========================================
  Files         238      238              
  Lines       22460    22513      +53     
==========================================
+ Hits        15234    15297      +63     
+ Misses       6023     6016       -7     
+ Partials     1203     1200       -3     
Flag Coverage Δ
unit 67.94% <90.90%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: build-process Related to the sketch build process topic: CLI Related to the command line interface type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant