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

Attachment: signature.asc
Description: Message signed with OpenPGP

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

View/Reply Online (#14069): https://lists.fd.io/g/vpp-dev/message/14069
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