arduino-cli icon indicating copy to clipboard operation
arduino-cli copied to clipboard

Improved `{build.*.platform.path}` vars enumeration.

Open cmaglie opened this issue 1 year ago • 2 comments
trafficstars

Please check if the PR fulfills these requirements

See how to contribute

  • [X] The PR has no duplicates (please search among the Pull Requests before creating one)
  • [X] 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?

This is a tentative fix for #2616. The original issue provided an experimental platform that extends esp32 to experiment with. This PR adds the following template variables that will be available to compose recipes:

  • {build.core.platform.path} contains the path to the reference (build) platform
  • {build.board.platform.path} contains the path to the board platform

Also, adds the input variable build.use_core_platform_for_runtime_platform_path to be set on boards.txt or platform.txt:

  • if set to true then the value of {runtime.platform.path} will be the path to the reference platform.
  • in all other cases (unset or !=true) the value of {runtime.platform.path} will be the path to the board platform (as it always has been)

What is the current behavior?

The compile fails with an "extended" platforms

What is the new behavior?

Unfortunately, the compile still fails. Hopefully, this PR could help to resolve the remaining issues.

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

Other information

/cc @egnor

cmaglie avatar Jun 25 '24 14:06 cmaglie

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.23%. Comparing base (8b6ad25) to head (452cf32).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2652      +/-   ##
==========================================
- Coverage   70.26%   70.23%   -0.04%     
==========================================
  Files         222      222              
  Lines       21343    21348       +5     
==========================================
- Hits        14996    14993       -3     
- Misses       5161     5176      +15     
+ Partials     1186     1179       -7     
Flag Coverage Δ
unit 70.23% <100.00%> (-0.04%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 25 '24 15:06 codecov[bot]

(kibitz: build.use_core_platform_for_runtime_platform_path might not be quite right, since it doesn't just affect the build but in fact just about any variable, including upload and so on?)

egnor avatar Jun 26 '24 22:06 egnor

(This seems to work, by the way! -- see https://github.com/arduino/arduino-cli/issues/2616#issuecomment-2192746629 -- is it likely to land any time soon?)

egnor avatar Jul 17 '24 02:07 egnor

(kibitz: build.use_core_platform_for_runtime_platform_path might not be quite right, since it doesn't just affect the build but in fact just about any variable, including upload and so on?)

Uhm... ok I'll rename it to runtime.use_core_platform_path_for_runtime_platform_path.

(This seems to work, by the way! -- see #2616 (comment) -- is it likely to land any time soon?)

Yes, sorry for the long delay, I'm updating the docs right now, and it should be ready for the next release.

cmaglie avatar Jul 26 '24 09:07 cmaglie