[riot-notifications] [RIOT-OS/RIOT] Makefile.features: add declarative FEATURES_ variables definition (#11492)

Francisco notifications at github.com
Mon May 20 16:16:36 CEST 2019


fjmolinas requested changes on this pull request.

@cladmi Can you reword your last commit details to :

Define a variable for FEATURES_USED that conflict and use it in
`Makefie.include`.

About the first two commits, do you see more use for the recipe besides testing this PR? If there is one lets keep it, but if not remove them from the PR.

Otherwise I tested and got the same supported-applications output. But features

I like the general re-ordering introduced by this PR, I do have a couple of comments regarding naming. See below and FEATURES_CONFLICTING isn't working for me.


> @@ -1,3 +1,33 @@
 # Process FEATURES variables
 
 include $(RIOTBOARD)/$(BOARD)/Makefile.features
+
+
+# Resolve FEATURES_ variables
+# Their value will only be complete after resolving dependencies
+
+# Features that are required by the application but not provided by the BSP
+# Having features missing may case the build to fail.
+FEATURES_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_REQUIRED)))
+
+# Features that are only optional and not required at the same time.
+# The policy is to use by default whenever they are provided by the BSP.
+FEATURES_OPTIONAL_ONLY = $(sort $(filter-out $(FEATURES_REQUIRED),$(FEATURES_OPTIONAL)))
+FEATURES_OPTIONAL_USED = $(sort $(filter $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY)))
+# Optional features that will not be used because they are unavailable
+FEATURES_OPTIONAL_UNUSED = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY)))

I think FEATURES_OPTIONAL_MISSING would be clearer in this case, FEATURES_OPTIONAL_UNUSED doesn't let you know why they are unused. What do you think?

> +# Features that are required by the application but not provided by the BSP
+# Having features missing may case the build to fail.
+FEATURES_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_REQUIRED)))
+
+# Features that are only optional and not required at the same time.
+# The policy is to use by default whenever they are provided by the BSP.
+FEATURES_OPTIONAL_ONLY = $(sort $(filter-out $(FEATURES_REQUIRED),$(FEATURES_OPTIONAL)))
+FEATURES_OPTIONAL_USED = $(sort $(filter $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY)))
+# Optional features that will not be used because they are unavailable
+FEATURES_OPTIONAL_UNUSED = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY)))
+
+# Features that are used for an application
+FEATURES_USED = $(sort $(FEATURES_REQUIRED) $(FEATURES_OPTIONAL_USED))
+
+# Used features that conflict when used together
+FEATURES_CONFLICTING = $(sort $(foreach conflict,$(FEATURES_CONFLICT),$(call _features_conflicting,$(conflict))))

Not sure why but this is not working for me. I'm doing

`make -C tests/periph_rtt/ BOARDS=slstk3401a info-build`

while also setting `FEATURES_REQUIRED+=periph_rtc` and printing `FEATURES_CONFLICTING` right after the assignment, its always empty while `FEATURES_USED` contains `periph_rtt` and `periph_rtc` and `FEATURES_CONFLICT=periph_rtt:perih_rtc`. Am I missing something?

> +# Features that are required by the application but not provided by the BSP
+# Having features missing may case the build to fail.
+FEATURES_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_REQUIRED)))
+
+# Features that are only optional and not required at the same time.
+# The policy is to use by default whenever they are provided by the BSP.
+FEATURES_OPTIONAL_ONLY = $(sort $(filter-out $(FEATURES_REQUIRED),$(FEATURES_OPTIONAL)))
+FEATURES_OPTIONAL_USED = $(sort $(filter $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY)))
+# Optional features that will not be used because they are unavailable
+FEATURES_OPTIONAL_UNUSED = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY)))
+
+# Features that are used for an application
+FEATURES_USED = $(sort $(FEATURES_REQUIRED) $(FEATURES_OPTIONAL_USED))
+
+# Used features that conflict when used together
+FEATURES_CONFLICTING = $(sort $(foreach conflict,$(FEATURES_CONFLICT),$(call _features_conflicting,$(conflict))))

Not sure why but this is not working for me. I'm doing

`make -C tests/periph_rtt/ BOARDS=slstk3401a info-build`

while also setting `FEATURES_REQUIRED+=periph_rtc` and printing `FEATURES_CONFLICTING` right after the assignment, its always empty while `FEATURES_USED` contains `periph_rtt` and `periph_rtc` and `FEATURES_CONFLICT=periph_rtt:perih_rtc`. Am I missing something?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11492#pullrequestreview-239499106
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190520/6914bfa7/attachment-0001.html>


More information about the notifications mailing list