Skip to content

Default iteration of platforms in CI should respect library.properties "architecture" setting #246

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

Closed
ianfixes opened this issue Dec 14, 2020 · 2 comments · Fixed by #256
Labels
ci scripts The test runner scripts enhancement New feature or request
Milestone

Comments

@ianfixes
Copy link
Collaborator

Feature request

via Arduino-CI/action#11

A library.properties file can include architecture information, e.g.

architectures=avr

The CI runner should respect this by not attempting to test or compile such a library against sam or other architectures.

That suggests the following logic for implementation:

  1. if an override .arduino-ci.yml file exists, use that list
  2. if the library.properties file does not exist, use the default list
  3. if the architectures= line does not exist, use the default list
  4. if architectures are specified, generate a candidate list of platforms to test against

Knowns and unknowns

The library specification says 2 relevant things:

Arduino development software supports multiple microcontroller architectures (e.g. AVR, SAM, etc), meaning that libraries may need to work on multiple architectures. The new 1.5 library format doesn’t contain special support for cross-architecture libraries, but it does provide a preprocessor based mechanism for libraries to target sections of code to specific architectures.

and

architectures - (defaults to *) a comma separated list of architectures supported by the library. If the library doesn’t contain architecture specific code use * to match all architectures. This field is used as one factor in determining priority when multiple libraries match an #include directive and to provide a warning message when the library is compiled for a board of an architecture that doesn't match any on the list.

@per1234 in practice does this mean simply comparing the middle field of a platform name (e.g. arduino:sam:arduino_due_x would be sam) to the architectures in the properties file? Also, is there any reason not to test all platforms that match a given architecture? On one hand it seems like you'd want to guard against things like pins or serial ports not existing on certain boards, but on the other hand the extra tests are probably diminishing returns and the user can always override the config with specific boards that need testing.

@per1234
Copy link
Contributor

per1234 commented Dec 14, 2020

does this mean simply comparing the middle field of a platform name

Exactly. That's the board's architecture.

it seems like you'd want to guard against things like pins or serial ports not existing on certain boards

Yep. For example, arduino:avr:mega has Serial1, but arduino:avr:uno does not. arduino:avr:leonardo has HID, but arduino:avr:mega does not, and so on. Then you throw different memory capacities in and it gets even more messy. So just because a library specifies avr compatibility in its metadata, doesn't mean it's compatible with every AVR board.

@ianfixes
Copy link
Collaborator Author

ianfixes commented Dec 14, 2020

OK. For now I'll brute-force the architecture testing (i.e. test every platform that matches) and we can iterate from there.

@ianfixes ianfixes added this to the 2020 Wrapup milestone Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci scripts The test runner scripts enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants