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

Failed to build OTBR with SRPL support based on PR #1743 #2505

Open
superwhd opened this issue Sep 24, 2024 · 9 comments
Open

Failed to build OTBR with SRPL support based on PR #1743 #2505

superwhd opened this issue Sep 24, 2024 · 9 comments

Comments

@superwhd
Copy link
Contributor

Filing this issue for continuing discussion of the comment sent by @muralidhar-bn

We have created a environment with 2 OTBR's ( RPi4 with skyconnect RCP devices ) and 2 or more nanoleaf bulbs.
We want to test SPR replication using real environment. Can you provide test steps ?

  1. Taken both patches - [srpl] integrate SRPL #1743 & [srpl] adding support for SRP replication openthread#8403 in our local environment and build by enabling SRPL replication.
  2. We are getting build errors.

enthread-spinel-rcp.a third_party/openthread/repo/src/lib/url/libopenthread-url.a -lutil -lrt -lanl && :
| /usr/src/debug/ot-br-posix/git/third_party/openthread/repo/src/core/net/srp_replication.cpp:723: error: undefined reference to 'otPlatSrplDnssdBrowse'
| /usr/src/debug/ot-br-posix/git/third_party/openthread/repo/src/core/net/srp_replication.cpp:755: error: undefined reference to 'otPlatSrplUnregisterDnssdService'
| /usr/src/debug/ot-br-posix/git/third_party/openthread/repo/src/core/net/srp_replication.cpp:723: error: undefined reference to 'otPlatSrplDnssdBrowse'
| /usr/src/debug/ot-br-posix/git/third_party/openthread/repo/src/core/net/srp_replication.cpp:745: error: undefined reference to 'otPlatSrplRegisterDnssdService'
| /usr/src/debug/ot-br-posix/git/third_party/openthread/repo/src/core/net/srp_replication.cpp:723: error: undefined reference to 'otPlatSrplDnssdBrowse'
| /usr/src/debug/ot-br-posix/git/third_party/openthread/repo/src/core/net/srp_replication.cpp:723: error: undefined reference to 'otPlatSrplDnssdBrowse'
| /usr/src/debug/ot-br-posix/git/third_party/openthread/repo/src/core/net/srp_replication.cpp:755: error: undefined reference to 'otPlatSrplUnregisterDnssdService'
| /usr/src/debug/ot-br-posix/git/third_party/openthread/repo/src/core/net/srp_replication.cpp:745: error: undefined reference to 'otPlatSrplRegisterDnssdService'
| /usr/src/debug/ot-br-posix/git/third_party/openthread/repo/src/core/net/srp_replication.cpp:755: error: undefined reference to 'otPlatSrplUnregisterDnssdService'
4. Can u suggest how to resolve these errors ? Above code is available in simulation folder could be the reason ?

@superwhd
Copy link
Contributor Author

Hi @muralidhar-bn, have you enabled cmake options OTBR_SRP_REPLICATION and OTBR_DNS_DSO when building the project?

FYI the PR hasn't been updated for quite a long time so I'm not sure if it's still compatible with the recent code.

cc @yuzhyang

@Deepanshiva
Copy link

Hi @superwhd, yes we have enabled OTBR_SRP_REPLICATION and OTBR_DNS_DSO while building the project.

We have taken the changes over following release tag - https://github.com/openthread/ot-br-posix/releases/tag/thread-reference-20230710

@superwhd
Copy link
Contributor Author

Hi @superwhd, yes we have enabled OTBR_SRP_REPLICATION and OTBR_DNS_DSO while building the project.

How did you enable them? Could you share your build command or the change to the build script?

@Deepanshiva
Copy link

Hi @superwhd, yes we have enabled OTBR_SRP_REPLICATION and OTBR_DNS_DSO while building the project.

How did you enable them? Could you share your build command or the change to the build script?

@superwhd We are using yocto build environment and enabled the EXTRA_OECMAKE flags as below in bb file

-DOTBR_DNS_DSO=ON \
-DOTBR_SRP_REPLICATION=ON \

@superwhd
Copy link
Contributor Author

-DOTBR_DNS_DSO=ON \
-DOTBR_SRP_REPLICATION=ON \

The options looks correct though I'm not familiar with yocto.

However, the issue does look like the enablement of the options are missing. To double check that maybe you can add a compile-time macro check in src/srpl_dnssd/srpl_dnssd.cpp like 'if OTBR_ENABLE_SRP_REPLICATION is 1, print an error message by #error'. If you don't see the error message when you build it, it means the build option isn't turned on or the file isn't included as a source file.

@Deepanshiva
Copy link

-DOTBR_DNS_DSO=ON \
-DOTBR_SRP_REPLICATION=ON \

The options looks correct though I'm not familiar with yocto.

However, the issue does look like the enablement of the options are missing. To double check that maybe you can add a compile-time macro check in src/srpl_dnssd/srpl_dnssd.cpp like 'if OTBR_ENABLE_SRP_REPLICATION is 1, print an error message by #error'. If you don't see the error message when you build it, it means the build option isn't turned on or the file isn't included as a source file.

we have verified as mentioned and below is the output

/git/src/srpl_dnssd/srpl_dnssd.cpp:35:2: error: #error "SRP Replication is enabled" | 35 | #error "SRP Replication is enabled" | | ^~~~~

FYI, Initially we got, below errors after taking the patches and enabling the MACROS

/git/third_party/openthread/repo/src/core/net/srp_replication.hpp:37:2: error: #error "SRP Replication requires SRP Server support (OPENTHREAD_CONFIG_SRP_SERVER_ENABLE)." | 37 | #error "SRP Replication requires SRP Server support (OPENTHREAD_CONFIG_SRP_SERVER_ENABLE)." | | ^~~~~

So, we manually enabled adding below lines third_party/openthread/CMakeLists.txt
set(OT_SRP_SERVER ON CACHE STRING "enable SRP server" FORCE) set(OT_DNS_DSO ON CACHE STRING "enable DSO support" FORCE)

After above changes we are getting the undefined referrence, which has been mentioned in above comments.

@superwhd
Copy link
Contributor Author

So, we manually enabled adding below lines third_party/openthread/CMakeLists.txt
set(OT_SRP_SERVER ON CACHE STRING "enable SRP server" FORCE) set(OT_DNS_DSO ON CACHE STRING "enable DSO support" FORCE)

FYI The preferred way of specifying OT_SRP_SERVER in OTBR is to enable OTBR_SRP_ADVERTISING_PROXY so it indirectly turns on the OT_SRP_SERVER.

Sorry I haven't been working on this feature for quite some time so I cannot recall all the details.

@yuzhyang I wonder if you saw similar issues previously?

@mia1yang
Copy link
Contributor

mia1yang commented Sep 26, 2024

So, we manually enabled adding below lines third_party/openthread/CMakeLists.txt
set(OT_SRP_SERVER ON CACHE STRING "enable SRP server" FORCE) set(OT_DNS_DSO ON CACHE STRING "enable DSO support" FORCE)

FYI The preferred way of specifying OT_SRP_SERVER in OTBR is to enable OTBR_SRP_ADVERTISING_PROXY so it indirectly turns on the OT_SRP_SERVER.

Sorry I haven't been working on this feature for quite some time so I cannot recall all the details.

@yuzhyang I wonder if you saw similar issues previously?

Have used the following build options for reference.
-DOTBR_DNSSD_DISCOVERY_PROXY=ON -DOTBR_SRP_ADVERTISING_PROXY=ON -DOTBR_INFRA_IF_NAME=wlan0 -DOTBR_MDNS=mDNSResponder -DOTBR_SRP_REPLICATION=ON -DOTBR_VERSION= -DOT_PACKAGE_VERSION= -DOTBR_WEB=OFF -DOTBR_BORDER_ROUTING=ON -DOTBR_REST=OFF -DOTBR_BACKBONE_ROUTER=ON -DOTBR_DNS_DSO=ON

@muralidhar-bn
Copy link

@mia1yang - We have verifired all build options suggested above are available in our build environment. But still same error is shown. Is there any macro not covered ?

ot-br-posix/git-r0/git/third_party/openthread/repo/src/core/net/srp_replication.hpp:37:2: error: #error "SRP Replication requires SRP Server support (OPENTHREAD_CONFIG_SRP_SERVER_ENABLE)."
| 37 | #error "SRP Replication requires SRP Server support (OPENTHREAD_CONFIG_SRP_SERVER_ENABLE)."
| | ^~~~~
| compilation terminated due to -Wfatal-errors.

yacto bb file
EXTRA_OECMAKE = "-DBUILD_TESTING=OFF
-DOTBR_DBUS=ON
-DOTBR_REST=ON
-DOTBR_WEB=OFF
-DCMAKE_LIBRARY_PATH=${libdir}
-DOTBR_MDNS=avahi
-DOTBR_BACKBONE_ROUTER=ON
-DOTBR_BORDER_ROUTING=ON
-DOTBR_SRP_ADVERTISING_PROXY=ON
-DOTBR_BORDER_AGENT=ON
-DOT_SPINEL_RESET_CONNECTION=ON
-DOT_TREL=ON
-DOT_MLR=ON
-DOT_SRP_SERVER=ON
-DOT_ECDSA=ON
-DOT_SERVICE=ON
-DOTBR_DUA_ROUTING=ON
-DOT_DUA=ON
-DOT_BORDER_ROUTING_NAT64=ON
-DOTBR_DNSSD_DISCOVERY_PROXY=ON
-DOTBR_INFRA_IF_NAME=eth0
-DOTBR_NO_AUTO_ATTACH=1
-DOT_REFERENCE_DEVICE=ON
-DOT_DHCP6_CLIENT=ON
-DOT_DHCP6_SERVER=ON
"
yacto bb.append file
EXTRA_OECMAKE:append = "
-DOTBR_WEB=ON
-DOT_READLINE=OFF
-DOT_CONFIG='openthread-core-silabs-posix-config.h'
-DOT_BACKBONE_ROUTER_MULTICAST_ROUTING=OFF
-DOT_FIREWALL=OFF
-DOTBR_DNS_DSO=ON
-DOTBR_SRP_REPLICATION=ON
-DOTBR_VERSION=
-DOT_PACKAGE_VERSION= \

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

No branches or pull requests

4 participants