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

Makefile.features: add driver_% provided features and FEATURES_REQUIRED_DRIVERS #12952

Closed
wants to merge 7 commits into from

Conversation

fjmolinas
Copy link
Contributor

@fjmolinas fjmolinas commented Dec 15, 2019

Contribution description

Drivers can now be required by an application by setting FEATURES_REQUIRED_DRIVERS += driver_%. This allows avoiding running tests or compiling applications for boards that don't have the necessary BSP or driver integration.

Since drivers/% code should be BOARD independent FEATURES_REQUIRED_DRIVERS is not included in the dependency resolution by default. To include INCLUDE_FEATURES_REQUIRED_DRIVERS must be set. I did not include them by default because murdock currently relies on info-boards-supported to decide when to build an application. If included by default a lot of test applications could be built by only a handful, one or no BOARD at all. IMO we wan't to compile on at leat on board of every arch to verify code portability.

This is done so that the test applications are still built for all boards in architectures, if not we could have driver tests that are only built for one application.

This still allows setting INCLUDE_FEATURES_REQUIRED_DRIVERS so only when the required BSP is supported the application is compiled or tested, e.g.

INCLUDE_FEATURES_REQUIRED_DRIVERS=1 python dist/tools/compile_and_test_for_board/compile_and_test_for_board.py  -j0 . nucleo-l073rz . --applications="tests/driver_grove_ledbar"
INFO:nucleo-l073rz:Saving toolchain
INFO:nucleo-l073rz.tests/driver_grove_ledbar:Board supported: False
INFO:nucleo-l073rz:Tests successful

I used the feature on tests/driver_grove_ledbar. I chose that applicator because it's a driver test with an automatic script and because no BOARD actually has the driver integrated so I could show how #12183 could be used to still have a supported BOARD for the test.

Testing procedure

Review should be focused on commits f6efa41and 4ad994b, 8d135bc and 684ae17 show a use case.

The first commits are showcasing how we can handle cases where no BOARD supports the driver FEATURE. c895b44, 76a7e87, 8cb5e10 are some modifications/extensions I had to do to #12183. Will PR them to that PR.

This PR wants to introduce the concept of required drivers, migrating applications would be done on a second step.

I would be happy to document this more extensively, but I think the place for this would be the same one as for #12473. I could extend that PR afterwards.

  • Default keeps same behaviour:
make -C tests/driver_grove_ledbar/ info-boards-supported --no-print-directory
acd52832 airfy-beacon arduino-due arduino-duemilanove arduino-leonardo arduino-mega2560 arduino-mkr1000 arduino-mkrfox1200 arduino-mkrwan1300 arduino-mkrzero arduino-nano arduino-uno arduino-zero atmega1284p atmega256rfr2-xpro atmega328p avr-rss2 avsextrem b-l072z-lrwan1 b-l475e-iot01a blackpill blackpill-128kib bluepill bluepill-128kib calliope-mini cc1352-launchpad cc2538dk cc2650-launchpad cc2650stk derfmega128 derfmega256 ek-lm4f120xl esp32-mh-et-live-minikit esp32-olimex-evb esp32-wemos-lolin-d32-pro esp32-wroom-32 esp32-wrover-kit esp8266-esp-12x esp8266-olimex-mod esp8266-sparkfun-thing f4vi1 feather-m0 firefly fox frdm-k22f frdm-k64f frdm-kw41z hamilton hifive1 hifive1b i-nucleo-lrwan1 ikea-tradfri iotlab-a8-m3 iotlab-m3 limifrog-v1 lobaro-lorabox lsn50 maple-mini mbed_lpc1768 mega-xplained microbit microduino-corerf msb-430 msb-430h msba2 msbiot mulle native nrf51dk nrf51dongle nrf52832-mdk nrf52840-mdk nrf52840dk nrf52dk nrf6310 nucleo-f030r8 nucleo-f031k6 nucleo-f042k6 nucleo-f070rb nucleo-f072rb nucleo-f091rc nucleo-f103rb nucleo-f207zg nucleo-f302r8 nucleo-f303k8 nucleo-f303re nucleo-f303ze nucleo-f334r8 nucleo-f401re nucleo-f410rb nucleo-f411re nucleo-f412zg nucleo-f413zh nucleo-f429zi nucleo-f446re nucleo-f446ze nucleo-f722ze nucleo-f746zg nucleo-f767zi nucleo-l031k6 nucleo-l053r8 nucleo-l073rz nucleo-l152re nucleo-l432kc nucleo-l433rc nucleo-l452re nucleo-l476rg nucleo-l496zg nucleo-l4r5zi nz32-sc151 opencm904 openmote-b openmote-cc2538 p-l496g-cell02 particle-argon particle-boron particle-xenon pba-d-01-kw2x phynode-kw41z pic32-clicker pic32-wifire pyboard reel remote-pa remote-reva remote-revb ruuvitag samd21-xpro same54-xpro saml10-xpro saml11-xpro saml21-xpro samr21-xpro samr30-xpro samr34-xpro seeeduino_arch-pro sensebox_samd21 slstk3401a slstk3402a sltb001a slwstk6000b-slwrb4150a slwstk6000b-slwrb4162a slwstk6220a sodaq-autonomo sodaq-explorer sodaq-one sodaq-sara-aff spark-core stk3600 stk3700 stm32f030f4-demo stm32f0discovery stm32f3discovery stm32f429i-disc1 stm32f4discovery stm32f723e-disco stm32f769i-disco stm32l0538-disco stm32l476g-disco teensy31 telosb thingy52 ublox-c030-u201 udoo usb-kw41z waspmote-pro wsn430-v1_3b wsn430-v1_4 yunjia-nrf51822 z1
  • Handle driver requirements correctly.
INCLUDE_FEATURES_REQUIRED_DRIVERS=1 make -C tests/driver_grove_ledbar/ info-boards-supported --no-print-directory
pba-d-01-kw2x

Issues/PRs references

Doesn't depend but is currently using #12183 to show how to handle bordercases.

@fjmolinas fjmolinas added Area: build system Area: Build system Type: new feature The issue requests / The PR implemements a new feature for RIOT Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR labels Dec 15, 2019
@fjmolinas
Copy link
Contributor Author

NOTE: github is not showing the commit history in the proper order.

Drivers can now be required by an application by setting
FEATURES_REQUIRED_DRIVERS += driver_%. This allows avoiding
running tests or compiling applicaitons for boards that don't
have the necessary BSP or driver integration.

Since drivers/% code should be BOARD independent FEATURES_REQUIRED_DRIVERS
is not included in the dependency resolution by default. To include
INCLUDE_FEATURES_REQUIRED_DRIVERS must be set. This keeps the same
default behaviour for `info-boards-supported`. This way the application
code is still compiled for all boards.
BOARDS can know provide driver_% features to specify that a specific
driver is wired to the BOARD. Since they all translate into a MODULE
we include that MODULE by default when the driver FEATURE is USED.
Add an extension of pba-d-01-kw2x which declares itself as providing
driver_grove_ledbar so at least one board is supported by the
application when calling:
`INCLUDE_FEATURES_REQUIRED_DRIVERS=1 make info-boards-supported`
@fjmolinas
Copy link
Contributor Author

Rebased with #12183 in.

@fjmolinas
Copy link
Contributor Author

Splitthe BOARDSDIR commits into #12972 .

@stale
Copy link

stale bot commented Jun 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Jun 19, 2020
@fjmolinas
Copy link
Contributor Author

I still like this..

@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Jun 19, 2020
@stale
Copy link

stale bot commented Dec 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Dec 23, 2020
@stale stale bot closed this Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR State: stale State: The issue / PR has no activity for >185 days Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant