Mbed-os: Remove nanostack dependency in netsocket

Created on 21 Sep 2020  路  8Comments  路  Source: ARMmbed/mbed-os

Description of defect

Hi

Compilation is failing if we remove nanostack.

https://github.com/ARMmbed/mbed-os/blob/master/connectivity/netsocket/source/NetworkInterface.cpp#L17

=> netsocket can not be compiled without nanostack.

Idea is to avoid to compile nanostack:

  • create .mbedignore with:
    mbed-os/connectivity/nanostack* mbed-os/connectivity/libraries/nanostack*
  • compile

Target(s) affected by this defect ?

All
NA

Toolchain(s) (name and version) displaying this defect ?

All
NA

What version of Mbed-os are you using (tag or sha) ?

mbed-os-6.3.0

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

NA

How is this defect reproduced ?

See description

IOTOSM-2415 OPEN mirrored bug

All 8 comments

This is using ns list from nanostack libservice - as I understand this library is a collection of functionality that is stack agnostic. Or is it not?

Compilation is failing if we remove nanostack.

removing connectivity/nanostack ? As this ns_list is part of the library nanostack-libservice

@ARMmbed/mbed-os-ipcore @kjbracey-arm

@jeromecoutant thank you for raising this issue.Please take a look at the following comments:

Could you add some more detail to the description? A good description should be at least 25 words.
How can we reproduce your issue?

NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'.This indicates to us that at least all the fields have been considered.
Please update the issue header with the missing information, the issue will not be mirroredto our internal defect tracking system or investigated until this has been fully resolved.

Proposition:
could we use MBED_CONF_NANOSTACK_LIBSERVICE_PRESENT macro in netsocket ?

Again, this is inventing a problem. The whole point of libservice (in the environment where it was created) was that it was the utterly foundational utility library for all components in the framework (mbed-client, Nanostack, applications).

Trying to exclude the lowest-level utility library from a build is just making work for yourself. Is there really any point in excluding it from a bare metal Mbed OS build?

This is using ns list from nanostack libservice - as I understand this library is a collection of functionality that is stack agnostic. Or is it not?

Correct. It's general standalone utilities. Historically associated with Nanostack, and required by it, but no dependency on it. (Or on anything else, with the possible exception of a bit of grief with random number seeding, but I think that's already covered by the Mbed OS porting).

For ns_list in particular, it's the best list implementation in the tree (IMHO, having spent a long time on it 4 years ago), so not using it would be daft. I think more people should be, but there has been general reluctance to do so, partly because its different heritage means it doesn't quite fit Mbed OS style, and hasn't been properly integrated into the docs or anything. (It does have good Doxygen though - not sure if that's reached the Mbed OS docs)

I'd suggest including libservice in the base build, or just adding the dependency to netsocket and anyone else using it.

Just my two cents, but while I do overall like the directory structure updates, I did not understand what nanostack-libservice was until this issue was written up.

I now understand that is essentially a number of functions (and data structures) that a socket based application or library would use, so it is here in a common area.

My belief is that naming it nanostack-anything-here is confusing as it makes it appear tied directly to nanostack instead of being a socket/IP utility library, like I believe it is. So, if I wanted to write a driver layer, for example, for one of the WizNet TCP/IP on chip devices they make, I would have avoided using this and written some of my own. (I've started and stopped this very thing at least twice and just now realized that this was a general use library.)

My suggestion: rename the folder and at least some items to something like this: netsocket-libraries, connectivity-libraries, or net-libs.

I had similar issue recently with CMake , and realized the same. I initally thought netsocket is pulling in nanostack but no, nanostack-libservice is just generic library without any other dependencies.

Naming suggestion sounds fine to me but as it came from outside (upstreamed), it might be not that simple. I'll let @ARMmbed/mbed-os-ipcore to review this.

Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers.
Internal Jira reference: https://jira.arm.com/browse/IOTOSM-2415

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cesarvandevelde picture cesarvandevelde  路  4Comments

ghost picture ghost  路  4Comments

neilt6 picture neilt6  路  4Comments

rbonghi picture rbonghi  路  3Comments

hasnainvirk picture hasnainvirk  路  3Comments