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

build system: clean up netif features #20700

Merged
merged 4 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ FEATURES_CONFLICT_MSG += "Only one GPIO IRQ implementation can be used."
FEATURES_CONFLICT += periph_usbdev:tinyusb_device
FEATURES_CONFLICT += periph_usbdev:tinyusb_host
FEATURES_CONFLICT_MSG += "Package tinyUSB is not yet compatible with periph_usbdev."

# Features provided implicitly
ifneq (,$(filter periph_eth,$(FEATURES_PROVIDED)))
FEATURES_PROVIDED += netif_ethernet
endif

ifneq (,$(filter netif_%,$(FEATURES_PROVIDED)))
FEATURES_PROVIDED += netif
endif
2 changes: 1 addition & 1 deletion boards/esp32-ethernet-kit-v1_0/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ CPU_MODEL = esp32-wrover
include $(RIOTBOARD)/common/esp32/Makefile.features

# additional features provided by the board
FEATURES_PROVIDED += esp_eth
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_eth
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm

Expand Down
2 changes: 1 addition & 1 deletion boards/esp32-olimex-evb/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FEATURES_CONFLICT += periph_sdmmc:periph_spi
FEATURES_CONFLICT_MSG += "SD/MMC and SPI cannot be used at the same time on this board."

# unique features of the board
FEATURES_PROVIDED += esp_eth # Ethernet MAC (EMAC)
FEATURES_PROVIDED += periph_can # CAN peripheral interface
FEATURES_PROVIDED += periph_eth # Ethernet MAC (EMAC)

FEATURES_PROVIDED += arduino_pins
3 changes: 1 addition & 2 deletions boards/native/common_features.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_qdec

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif_ethernet
FEATURES_PROVIDED += motor_driver
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += netif_ethernet
2 changes: 0 additions & 2 deletions boards/nucleo-f207zg/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif_ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += tinyusb_device

Expand Down
2 changes: 0 additions & 2 deletions boards/nucleo-f429zi/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif_ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += tinyusb_device

# load the common Makefile.features for Nucleo boards
Expand Down
2 changes: 0 additions & 2 deletions boards/nucleo-f439zi/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif_ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += tinyusb_device

# load the common Makefile.features for Nucleo boards
Expand Down
2 changes: 0 additions & 2 deletions boards/nucleo-f767zi/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif_ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += tinyusb_device

Expand Down
2 changes: 0 additions & 2 deletions boards/same54-xpro/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,5 @@ FEATURES_PROVIDED += periph_freqm
FEATURES_PROVIDED += periph_can

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif_ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += tinyusb_device
2 changes: 0 additions & 2 deletions boards/stm32f746g-disco/features-shared.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ FEATURES_PROVIDED += periph_usbdev_hs
FEATURES_PROVIDED += periph_usbdev_hs_ulpi

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif_ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += tinyusb_device
2 changes: 1 addition & 1 deletion cpu/esp32/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ifneq (,$(filter esp_ble,$(USEMODULE)))
endif

ifneq (,$(filter esp_eth,$(USEMODULE)))
FEATURES_REQUIRED += esp_eth
FEATURES_REQUIRED += periph_eth
USEMODULE += esp_idf_eth
USEMODULE += esp_idf_event
USEMODULE += esp_idf_gpio
Expand Down
6 changes: 6 additions & 0 deletions dist/tools/buildsystem_sanity_check/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
: "${RIOTBASE:="$(cd "$(dirname "$0")/../../../" || exit; pwd)"}"

: "${RIOTTOOLS:=${RIOTBASE}/dist/tools}"
. "${RIOTTOOLS}"/ci/github_annotate.sh

Check warning on line 19 in dist/tools/buildsystem_sanity_check/check.sh

View workflow job for this annotation

GitHub Actions / static-tests

Not following: ./ci/github_annotate.sh was not specified as input (see shellcheck -x). [SC1091]

SCRIPT_PATH=dist/tools/buildsystem_sanity_check/check.sh


tab_indent() {
# Ident using 'bashism' to to the tab compatible with 'bsd-sed'
sed 's/^/\'$'\t/'

Check warning on line 26 in dist/tools/buildsystem_sanity_check/check.sh

View workflow job for this annotation

GitHub Actions / static-tests

Want to escape a single quote? echo 'This is how it'\''s done'. [SC1003]
}

prepend() {
Expand All @@ -34,13 +34,13 @@
}

error_with_message() {
while read INPUT; do

Check warning on line 37 in dist/tools/buildsystem_sanity_check/check.sh

View workflow job for this annotation

GitHub Actions / static-tests

read without -r will mangle backslashes. [SC2162]
if github_annotate_is_on; then
MESSAGE="${1}"
FILE=$(echo "${INPUT}" | cut -d: -f1)
LINE=$(echo "${INPUT}" | cut -d: -f2)
MATCH=$(echo "${INPUT}" | cut -d: -f3)
if [[ $var =~ ^[0-9]+$ ]] || [ -z "$MATCH" ]; then

Check warning on line 43 in dist/tools/buildsystem_sanity_check/check.sh

View workflow job for this annotation

GitHub Actions / static-tests

var is referenced but not assigned. [SC2154]
# line is not provided in grep pattern
LINE=0
fi
Expand Down Expand Up @@ -74,6 +74,12 @@
# These two files contain sanity checks using FEATURES_ so are allowed
pathspec+=(':!Makefile.include' ':!makefiles/info-global.inc.mk')

# We extend FEATURES_PROVIDED in Makefile.features based on what is
# already provided to avoid clutter in each boards Makefile.features.
# E.g. `periph_eth` will pull in `netif_ethernet`, which
# will pull in `netif`.
pathspec+=(':!Makefile.features')

git -C "${RIOTBASE}" grep -n "${patterns[@]}" -- "${pathspec[@]}" \
| error_with_message 'Modules should not check the content of FEATURES_PROVIDED/REQUIRED/OPTIONAL'
}
Expand Down Expand Up @@ -172,7 +178,7 @@
# Only run if there are patterns, otherwise it matches everything
if [ ${#patterns[@]} -ne 0 ]; then
git -C "${RIOTBASE}" grep -n "${patterns[@]}" -- "${pathspec[@]}" \
| error_with_message 'Variables must only be exported in `makefiles/vars.inc.mk`'

Check warning on line 181 in dist/tools/buildsystem_sanity_check/check.sh

View workflow job for this annotation

GitHub Actions / static-tests

Expressions don't expand in single quotes, use double quotes for that. [SC2016]
fi
}

Expand Down Expand Up @@ -287,14 +293,14 @@
local patterns=()
local pathspec=()

patterns+=(-e '/$(BOARD)/')

Check warning on line 296 in dist/tools/buildsystem_sanity_check/check.sh

View workflow job for this annotation

GitHub Actions / static-tests

Expressions don't expand in single quotes, use double quotes for that. [SC2016]

pathspec+=('boards/')
# boards/common/nrf52 uses a hack to resolve dependencies early
pathspec+=(':!boards/common/nrf52/Makefile.include')

git -C "${RIOTBASE}" grep -n "${patterns[@]}" -- "${pathspec[@]}" \
| error_with_message 'Code in boards/ should not use $(BOARDS) to reference files since this breaks external BOARDS changing BOARDSDIR"'

Check warning on line 303 in dist/tools/buildsystem_sanity_check/check.sh

View workflow job for this annotation

GitHub Actions / static-tests

Expressions don't expand in single quotes, use double quotes for that. [SC2016]
}

check_no_pseudomodules_in_makefile_dep() {
Expand Down
4 changes: 0 additions & 4 deletions features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ groups:
- title: ESP Specific Features
help: These features are only available on (some) ESP MCUs.
features:
- name: esp_eth
help: >
An ESP Ethernet peripherals is available.
(FIXME: `periph_eth` instead.)
- name: esp_jtag
help: The MCU supports JTAG for programming and debugging. Enable this
feature to expose the interface at the cost of having fewer pins as
Expand Down
1 change: 0 additions & 1 deletion makefiles/features_existing.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ FEATURES_EXISTING := \
esp_ble \
esp_ble_esp32 \
esp_ble_esp32c3 \
esp_eth \
esp_hw_counter \
esp_jtag \
esp_now \
Expand Down
Loading