Hi Chris,

This is tricky... I've never ran into the issue even though I also build w/o 
ext-deps from time to time.
My understanding of what could happen here: we have the top Makefile building 
external dependencies outside of the VPP cmake infra. So from VPP cmake PoV, 
those external libs are really external and it has no idea on how to build 
them. They are supposed to be there.
In the plugins CMakeLists, we do check if those external lib are present. If 
they are not, we disable the build of the plugin. However this detection is 
done during cmake config phase, and cmake cache the results.
So what could happen is you build the external libs, cmake found them and 
enable the plugin build. Later on you removed the external libs from the 
install dir and the top Makefile did not manage to detect the lib was missing 
and need rebuild. Then VPP cmake relies on its cache, tries to build the plugin 
and boom.
I'll look into the build dep management in the top Makefile and external lib 
build system to see what's wrong.

ben


> -----Original Message-----
> From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Christian
> Hopps
> Sent: jeudi 26 septembre 2019 18:17
> To: vpp-dev <vpp-dev@lists.fd.io>
> Cc: Christian Hopps <cho...@chopps.org>
> Subject: [vpp-dev] Odd build issue/failure.
> 
> Locally we build VPP w/o installing ext deps (e.g., dpdk). This mostly
> work fine, and allows us to easily make modifications to these external
> libraries if we need to.
> 
> Recently I've had issues with the build failing occasionally due to not
> being able to find some external library, but only under certain
> circumstances (seemingly when something in an external build rebuilds
> itself, I haven't quite figured out what the trigger is).
> 
> Here's an example of the failure with rdma plugin (I also saw and "fixed"
> this with quic for which I include the diff below);
> 
>       -- Build files have been written to: /home/chopps/net/w/vpp/build-
> root/build-vpp_debug-native/vpp
>       @@@@ Building vpp in /home/chopps/net/w/vpp/build-root/build-
> vpp_debug-native/vpp @@@@
>       ninja: error: '/home/chopps/net/w/vpp/build-root/install-vpp_debug-
> native/external/lib/libibverbs.a', needed by
> 'lib/vpp_plugins/rdma_plugin.so', missing and no known rule to make it
> 
> As mentioned above, I also have a fix that I can apply to the failing
> plugin CMakefile; however, I don't fully understand what is going on and
> so I'm not comfortable submitting it as a proposed fix.
> 
> Can someone help describe what might be going on, or at least what the
> correct fix is?
> 
> Below is the diff which fixes this same issue for the quic plugin.
> 
> Thanks,
> Chris.
> 
> 1 file changed, 12 insertions(+), 8 deletions(-)
> src/plugins/quic/CMakeLists.txt | 20 ++++++++++++--------
> 
> modified   src/plugins/quic/CMakeLists.txt
> @@ -20,14 +20,16 @@ find_library (QUICLY_LIBRARY NAMES "libquicly.a")
>  find_library (PICOTLS_CORE_LIBRARY NAMES "libpicotls-core.a")
>  find_library (PICOTLS_OPENSSL_LIBRARY NAMES "libpicotls-openssl.a")
> 
> -list(APPEND QUIC_LINK_LIBRARIES
> -  ${QUICLY_LIBRARY}
> -  ${PICOTLS_CORE_LIBRARY}
> -  ${PICOTLS_OPENSSL_LIBRARY}
> -)
> +if(QUICLY_INCLUDE_DIR AND QUICLY_LIBRARY)
> +  get_filename_component(QUICLY_LIB_DIR ${QUICLY_LIBRARY} DIRECTORY)
> +  set(QUIC_LINK_FLAGS "-Wl,--whole-
> archive,${QUICLY_LIB_DIR}/libquicly.a,--no-whole-archive")
> +
> +  get_filename_component(PICOTLS_LIB_DIR ${PICOTLS_CORE_LIBRARY}
> DIRECTORY)
> +  set(QUIC_LINK_FLAGS "${QUIC_LINK_FLAGS} -Wl,--whole-
> archive,${PICOTLS_LIB_DIR}/libpicotls-core.a,--no-whole-archive")
> +
> +  get_filename_component(PICOTLS_OPENSSL_LIB_DIR
> ${PICOTLS_OPENSSL_LIBRARY} DIRECTORY)
> +  set(QUIC_LINK_FLAGS "${QUIC_LINK_FLAGS} -Wl,--whole-
> archive,${PICOTLS_OPENSSL_LIB_DIR}/libpicotls-openssl.a,--no-whole-
> archive")
> 
> -if(QUICLY_INCLUDE_DIR AND QUIC_LINK_LIBRARIES)
> -  include_directories (${QUICLY_INCLUDE_DIR})
>    add_vpp_plugin(quic
>      SOURCES
>      certs.c
> @@ -35,8 +37,10 @@ if(QUICLY_INCLUDE_DIR AND QUIC_LINK_LIBRARIES)
>      quic.c
>      quic_crypto.c
> 
> -    LINK_LIBRARIES ${QUIC_LINK_LIBRARIES}
> +    LINK_FLAGS
> +    ${QUIC_LINK_FLAGS}
>    )
> +  include_directories (${QUICLY_INCLUDE_DIR})
>    message(STATUS "Found quicly in ${QUICLY_INCLUDE_DIR}")
>  else()
>    message(WARNING "-- quicly not found - quic_plugin disabled")
> 
> I've now hit the same issue with rdma and libibverbse

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#14072): https://lists.fd.io/g/vpp-dev/message/14072
Mute This Topic: https://lists.fd.io/mt/34300592/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to