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

tinydtls package has undeclared dependencies #13121

Closed
chrysn opened this issue Jan 14, 2020 · 0 comments · Fixed by #13132
Closed

tinydtls package has undeclared dependencies #13121

chrysn opened this issue Jan 14, 2020 · 0 comments · Fixed by #13132
Labels
Area: build system Area: Build system Area: pkg Area: External package ports Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@chrysn
Copy link
Member

chrysn commented Jan 14, 2020

Description

When tinydtls is added to a minimal example, it won't build until some additional modules are enabled manually.

That's not a problem most of the time (when tinydtls is used as a DTLS library, there's bound to be something else that pulls in UDP sockets), but when using it only for its crypto primitives (like in bergzand/libcose#91), that's not the case.

Steps to reproduce the issue

In the hello-world example, add USEPKG += tinydtls under QUIET ?= 1 and make all

Expected results

tinydtls pulls in any dependencies it has, or (if it can't make sane default decisions) errs at dependency checking time, telling the user to make a particular choice.

Actual results

sys/include/net/sock/udp.h:452:10: fatal error: sock_types.h: No such file or directory
  452 | #include "sock_types.h"
      |          ^~~~~~~~~~~~~~

As a workaround, you can add USEMODULE += gnrc_sock. That shifs the error to

pkg/tinydtls/contrib/sock_dtls.c: In function ‘sock_dtls_session_create’:
pkg/tinydtls/contrib/sock_dtls.c:295:50: error: ‘const union <anonymous>’ has no member named ‘ipv6’; did you mean ‘ipv4’?
  295 |     memcpy(&remote->dtls_session.addr, &ep->addr.ipv6, sizeof(ipv6_addr_t));

which can be mitigated by a USEMODULE += gnrc_ipv6.

Versions

Tested on Linux with native board and current RIOT master (7430ea9).

Steps forward

If the respective code sections are necessary for tinyDTLS to be buildable at all, please add dependencies from the pkg to the modules.

Otherwise, ifdef fences around them could allow slimmer builds for tinydtls-as-crypto-primitive cases (but I do see that they are corner cases right now, so "depend on the module with a note that the dependency could probably removed by putting more work into it" would work fine for me as well).

@aabadie aabadie added Area: build system Area: Build system Area: pkg Area: External package ports Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Jan 15, 2020
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 Area: pkg Area: External package ports Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants