Skip to content

ccn-lite: introduce feature and use in examples#12423

Closed
smlng wants to merge 2 commits intoRIOT-OS:masterfrom
smlng:pr_feature_ccn
Closed

ccn-lite: introduce feature and use in examples#12423
smlng wants to merge 2 commits intoRIOT-OS:masterfrom
smlng:pr_feature_ccn

Conversation

@smlng
Copy link
Copy Markdown
Member

@smlng smlng commented Oct 11, 2019

Contribution description

This introduces a new feature ccn-lite which is added to board that are currently whitelisted in examples/ccn-lite-relay. Also this removes the whitelist from the said examples and uses FEATURES_REQUIRED += ccn-lite instead.

This PR should only serve as an example on how to get rid of the boards whitelists and blacklists we currently use, and use features mechanism instead. Applied throughout the build system this should remove the hassle of updating board lists - at least white and black lists.

Testing procedure

Build examples/ccn-lite-relay for e.g. samr21-xpro and nucleo-f411re with this PR and on master it should work without warning for the former and should give a warning for the latter board.
Though the warnings will differ, the outcome is the same.

Also verify that make -C examples/ccn-lite-relay info-boards-supported has the same output on
this PR and master.

Issues/PRs references

partly replaces #12406

smlng added 2 commits October 11, 2019 08:30
Introducing a new feature for ccn-lite compatibility and append this to
Makefile.features for supported boards.
This adds required feature `ccn-lite`, making the BOARDS_WITHLIST obsolete.
@smlng smlng added Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 11, 2019
@smlng smlng requested review from aabadie, maribu and miri64 October 11, 2019 06:50
@smlng smlng added the Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR label Oct 11, 2019
@smlng
Copy link
Copy Markdown
Member Author

smlng commented Oct 11, 2019

what do you think about this approach to get rid of some boards list?
@cladmi your comments are very welcomed.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Oct 11, 2019

I think the approach is not good (I have a PR that can do it in a nicer way, e.g. without having to modify all boards). I'll comment why later (I'm AFK for the moment).

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Oct 11, 2019

@aabadie take your time. If you're referring to your PR #11676 then this looks very similar to my approach taken here, just netif instead of ccn-lite. Hence, I'm a bit puzzled why you think this approach is not good?

What can be improved here is, to link the feature ccn-lite with the package and thus get rid of the USE_PKG here and move it to Makefile.dep (or so).

But before adding this I would like to get opinions if this is the way to go at all.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Oct 11, 2019

This somehow seems to me a reverse logic. Why is a network stack a feature provided by a board?

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Oct 11, 2019

mhm, yeah the naming ... but we use the same mechanism for feature cpp. In general, the idea is to replace the boards list and use an already in place mechanism of the RIOT build system instead. We could introduce a better naming for this, but the mechanism would be the same as for FEATURES.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Oct 11, 2019

For C++ it somewhat makes sense, as architectural requirements need to be fullfilled by the MCU to run C++. But for CCN-lite it isn't an archictectural requirement that adds the board to the whitelist, isn't it? If it is, maybe this should be a dependency of CCN-lite, which in turn is provided by the board. E.g. (I don't know if this is actually the case here: FEATURE_PROVIDED += malloc.

@maribu
Copy link
Copy Markdown
Member

maribu commented Oct 11, 2019

This somehow seems to me a reverse logic. Why is a network stack a feature provided by a board?

It would indeed be better to have the network stack provide that feature. But currently the build system is not up to the task. (@cladmi: Maybe you have an idea how modules could provide features? So that checking if required features are indeed provide takes places after the dependencies of used modules have resolved.)

Back to topic: This is not be the ultimate and final solution. But boards are pretty static, while applications are moving targets. Also, out of tree applications could also use the features, while they would have to manually keep up with the black and white lists.

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Oct 11, 2019

@miri64 I agree this is not optimal, but to reiterate: the feature mechanism is ready-to-use and can immediately help to get rid of the BOARDS_{WHITE|BLACK}LIST.

For instance, we have 2 LUA examples with BOARD_BLACKLIST using the feature concept we can remove this lists and add FEATURES_REQUIRED += lua to both examples (and add feature lua to boards that are compatible).

This helps to remove clutter from the app Makefile and keeping the lists up to date in all applications. This makes it also easier when adding a new board, instead of updating numerous lists in many applications and tests, we just add the feature to the board (or not, if not supported). So its basically one-line per board in its Makefile.features instead of adding the board to the respective list (white|black) in numerous applications and tests.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Oct 11, 2019

I think you misunderstood me. I did not say using features is a bad idea nor that the naming is misplaced. I just think, we should rather name the features the board provides that others don't so that compilation or a working application are ensured instead of using the brute force approach of just putting the module there. Just one example: Most applications involving ethos don't work on some boards because they use Segger RTT rather than UART to communicate with the host machine and this is why they are blacklisted. So the FEATURE_PROVIDED by the board to remove those blacklist entries wouldn't be ethos, but e.g. stdio_uart (edit: and ethos would in turn have this feature as a dependency).

@miri64
Copy link
Copy Markdown
Member

miri64 commented Oct 11, 2019

I think #9081 is a good example of what I was talking about.

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Oct 11, 2019

@miri64 ah okay, now I get what you mean.

It might be sometimes difficult to find the features that cover all boards in a whitelist (or blacklist). Anyway, I'll look into that and add changes here.

@smlng smlng added State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 11, 2019
@miri64
Copy link
Copy Markdown
Member

miri64 commented Oct 11, 2019

It might be sometimes difficult to find the features that cover all boards in a whitelist (or blacklist). Anyway, I'll look into that and add changes here.

In that case we can discuss this, but for ccn-lite specifically, I don't really expect that.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Oct 11, 2019

So the FEATURE_PROVIDED by the board to remove those blacklist entries wouldn't be ethos, but e.g. stdio_uart (edit: and ethos would in turn have this feature as a dependency).

This is what I think I should do with #12304.

Regarding providing ccn-lite as a feature, this is totally non sense to me. In fact, any board with a radio should be able to run ccn-lite. ccn-lite is not a feature, it's a library, a module. To knowi if ccn-lite can be built for a given board, the main criteria is rather: does the board provide an interface (e.g. netif) or not ?

This was the initial goal of #11676, where the first versions were providing the netif feature at the board level. But after some thoughts, I realized it was a lot of code duplication for something that is, in fact, provided by the radio drivers implementing the netif/netdev interface.
Now I'm very convinced that the netif feature should be provided by radio drivers themselves. What is missing is a consensus on how this should be managed by the build system.

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 29, 2019

closing this needs a different approach

@smlng smlng closed this Nov 29, 2019
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: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants