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

Francisco notifications at github.com
Tue May 21 09:03:05 CEST 2019


fjmolinas commented on this pull request.



> @@ -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 wanted to separate missing which for me sounds like an error from they are not available but optional anyway/or not used. And even changed it from the previous FEATURES_MISSING message that was in info-build.

I agree with this. But FEATURES_OPTIONAL_UNUSED makes me think of features that are optional but that I (or the build system) have decided not to use. I had to read up the comment and code to understand what it meant since it went against my intuition of what the variable name made me think.

> FEATURES_OPTIONAL_DISABLE #10047 (comment) variable, an optional feature could be provided but not included.

In that case to me its more intuitive to have:

```
FEATURES_OPTIONAL_UNUSED = $(sort $(filter $(FEATURES_OPTIONAL_DISABLE),$(FEATURES_OPTIONAL_ONLY)))
```
and

```
FEATURES_OPTIONAL_MISSING = $(sort $(filter-out $(FEATURES_PROVIDED),$(FEATURES_OPTIONAL_ONLY)))

```

Anyway this is just my interpretation, but I think is exactly the kind of questioning you wanted right?

-- 
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#discussion_r285876325
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190521/b5237c89/attachment.html>


More information about the notifications mailing list