1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

8 Commits

Author SHA1 Message Date
Marian Buschsieweke
d29652350b
build system: Improve failure mode for FEAUTRES_REQUIRED_ANY
Failing to provide any of the required features can provide a message
such as:

    There are unsatisfied feature requirements: periph_uart|periph_lpuart

This can be confusing and may hide the actual. E.g. above message
was generated when using SPI on the `msb-430` and `stdio_uart`. However,
the MSB-430 board *does* provide `periph_uart`, so this looks like a bug
in the feature resolution. This changes the failure mode of
`FEATURES_REQUIRED_ANY` to just pick the first of the alternatives
given if none of the alternative is usable, which gives in the example
the following message instead:

    The following features may conflict: periph_spi periph_uart
    Rationale: Both SPI and UART are provided by the same USART
               peripheral

The output is less surprising and can provide non-obvious reasons
why `FEATURES_REQUIRED_ANY` failed to pick a feature. The downside is
that the alternatives are no longer visible. However, that output
likely was so confusing this might be for the best.

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
2024-02-22 14:02:53 +01:00
Marian Buschsieweke
43781c3fba
build_system: don't optionally use conflicting features
If adding a provided but optional feature would result in a feature conflict,
don't use it.
2021-02-22 12:06:27 +01:00
Marian Buschsieweke
4304600512
build system: fix using optional blacklisted features 2021-02-10 09:38:21 +01:00
Marian Buschsieweke
8fb30660b5
makefiles/features_check.inc.mk: fix declaration order
FEATURES_CONFLICTING previously was declared prior to the function it is
calling, resulting in empty output during the first dependency resolution
iteration. This fixes the order so that the conflicting features are detected
right from the first recursion.
2021-02-10 09:29:50 +01:00
Marian Buschsieweke
47035fbc2a
build system: fix feature resolution
Fix FEATURES_REQUIRED_ANY using more features than needed.
2021-02-09 21:24:03 +01:00
Marian Buschsieweke
f41dcc9a8d
build system: fix FEATURES_REQUIRED_ANY
Previously, FEATURES_REQUIRED_ANY didn't honor the order of the alternatives
provided, if none of the features were already in used and multiple options
are provided. This fixes this.
2021-02-09 10:45:03 +01:00
Marian Buschsieweke
af21f15b02
makefiles: Minor clean ups
- Add FEATURES_REQUIRED_ANY to dependency-debug:
  Now `make dependency-debug` by default also stores the contents of
  `FEATURES_REQUIRED_ANY`.
- makefiles/features_check.inc.mk: Break long lines
- {tests/minimal,tests/unittests,bootloaders/riotboot}:
  Disable auto_init_% in addition to auto_init.

This works around weird behavior due to the USEMODULE being recursively expended
in the first iteration of dependency resolution: Modules added to DEFAULT_MODULE
get automatically added to USEMODULE during the first run, but not for
subsequent. This should be iron out later on.
2020-04-02 09:56:39 +02:00
Marian Buschsieweke
7bc15acee2
build system: Restructure dependency resolution
Goals:
- Untangle dependency resolution and feature checking for better maintainability
- Improve performance of "make info-boards-supported"

Changes:
- Makefile.dep
    - Dropped handling of default modules and recursion
    - Now only dependencies of the current set of used modules and pkgs are
      added
  ==> External recursion is needed to catch transient dependencies
- Changed Makefile.features:
    - Dropped checking of provided features
    - Dropped populating FEATURES_USED with provided features that are required
      or optional
    - Dropped populating FEATURES_MISSING with required but not provided
      features
    - Dropped adding modules implementing used features to USE_MODULE
  ==> This now only populates FEATURES_PROVIDED, nothing more
- Added makefiles/features_check.inc.mk:
    - This performs the population of FEATURES_USED and FEATURES_MISSING now
- Added makefiles/features_modules.inc.mk:
    - This performs now the addition of modules implementing used features
- Added makefiles/dependency_resolution.inc.mk:
    - This now performs the recursion required to catch transient dependencies
    - Also the feature check is performed recursively to handle also required
      and optional features of the transient dependencies
    - DEFAULT_MODULES are added repeatedly to allow it to be extended based on
      used features and modules
      ==> This allows modules to have optional dependencies, as these
          dependencies can be blacklisted
- Use simply expanded variables instead of recursively expended variables
  (`foo := $(bar)` instead `foo = $(bar)`) for internal variables during feature
  resolution. This improves performance significantly for
  `make info-boards-supported`.
- Reduce dependency resolution steps in `make info-boards-supported`
    - Globally resolve dependencies without any features (including arch)
      provided
      ==> This results in the common subset of feature requirements and modules
          used
        - But for individual boards additional modules might be used on top due
          to architecture specific dependencies or optional features
    - Boards not supporting this subset of commonly required features are not
      supported, so no additional dependency resolution is needed for them
    - For each board supporting the common set of requirements a complete
      dependency resolution is still needed to also catch architecture specific
      hacks
         - But this resolution is seeded with the common set of dependencies to
           speed this up
2020-04-02 09:55:07 +02:00