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

CMake netsockets: too many libraries dependencies #14413

Open
0xc0170 opened this issue Mar 11, 2021 · 6 comments
Open

CMake netsockets: too many libraries dependencies #14413

0xc0170 opened this issue Mar 11, 2021 · 6 comments

Comments

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 11, 2021

Description of defect

Build mbed-os-example-sockets with mbedtools (CMake) and check what files are being included. While we were looking at object libraries, we found these dependencies for netsockets:

target_link_libraries(mbed-netsocket
    PRIVATE
        mbed-nanostack
        mbed-randlib
        mbed-core
        mbed-rtos
        mbed-lwipstack
        mbed-nanostack-libservice
        mbed-ppp
    PUBLIC
        mbed-events
        mbed-mbedtls
)

Note, the above comes from feature-cmake-object-libraries branch. It is not that obvious if you use master due to INTERFACE libraries and how they are all linked together. You can however confirm these deps with an application to see what it pulls in.

This is also related to #14412 (not certain if we clean up randlib, we would remove nanostack dependency for netsockets, we should review if we need mbed-nanostack-libservice and mbed-ppp always. Questionable would be also mbedtls events as they are required only for secure sockets, or anything else in the tree?

The other part is because events and tls are used in the public headers (basically they are leaked to anyone using netsockets), this mean anyone linking to netsockets will also need to get events/tls linked (see PUBLIC linking above). But this might be more related to mbed.h as it provides all by default.

Target(s) affected by this defect ?

all

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

all

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

mbed-os-6.8

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

mbedt-tools 7.0

How is this defect reproduced ?

Build mbed-os-exaple-socket and explore build.ninja file what is include (number of files is a good indicator as well how much we are including for this example).

@ciarmcom
Copy link
Member

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-3576

@boraozgen
Copy link
Contributor

Compiling 800+ files for an ethernet based socket example. Not much of an improvement on the old tools in this case :)

@0xc0170
Copy link
Contributor Author

0xc0170 commented Apr 20, 2021

Compiling 800+ files for an ethernet based socket example. Not much of an improvement on the old tools in this case :)

Correct. I created these issues about deps so we can plan this work - most of us are not aware of them as old tool hide this detail. It's not trivial as it was just easy to add a header here, there - building tree with "all in" for years.

It will require to go through the libraries and remove deps where they can.

@ladislas
Copy link
Contributor

Just hit this issue, compilation times are way to long because of this.

@ladislas
Copy link
Contributor

Correct. I created these issues about deps so we can plan this work

@0xc0170 any ideas when things like this will be worked on? It seems like the CMake migration, though promising, has been lost in translation.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Jan 10, 2022

Unfortunately, we haven't been able to continue the migration.
The teams are much smaller as the previous years, we are currently coping with other priorities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants