All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] zeromq: Fix host-specific path issue with libsodium
@ 2020-04-22 16:35 niko.mauno
  0 siblings, 0 replies; only message in thread
From: niko.mauno @ 2020-04-22 16:35 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Niko Mauno

Avoid propagation of full build host specific path into
WORKDIR/sysroot-destdir/usr/share/cmake/ZeroMQ/ZeroMQTargets.cmake
when building the recipe as this causes following-like breakage on
sstate cache consumer hosts (with different build host specific path,
than the host that populated sstate cache)

  ninja: error: '/build/host/specific/path/to/zeromq/4.3.2-r0/recipe-sysroot/usr/lib/libsodium.so', needed by 'src/FooBar', missing and no known rule to make it

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 ...void-host-specific-path-to-libsodium.patch | 39 +++++++++++++++++++
 .../zeromq/zeromq_4.3.2.bb                    |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 meta-oe/recipes-connectivity/zeromq/files/0001-CMakeLists-txt-Avoid-host-specific-path-to-libsodium.patch

diff --git a/meta-oe/recipes-connectivity/zeromq/files/0001-CMakeLists-txt-Avoid-host-specific-path-to-libsodium.patch b/meta-oe/recipes-connectivity/zeromq/files/0001-CMakeLists-txt-Avoid-host-specific-path-to-libsodium.patch
new file mode 100644
index 000000000..eb3dee4d3
--- /dev/null
+++ b/meta-oe/recipes-connectivity/zeromq/files/0001-CMakeLists-txt-Avoid-host-specific-path-to-libsodium.patch
@@ -0,0 +1,39 @@
+From: Niko Mauno <niko.mauno@vaisala.com>
+Date: Wed Apr 22 09:00:00 2020 +0300
+Subject: CMakeLists.txt: Avoid host-specific path to libsodium
+
+Avoid propagating full build host specific path to generated
+ZeroMQTargets.cmake when building with libsodium, which changes the
+content in generated ZeroMQTargets.cmake files followingly:
+
+  -INTERFACE_LINK_LIBRARIES "-lpthread;/build/host/specific/path/to/zeromq/4.3.2-r0/recipe-sysroot/usr/lib/libsodium.so;-lrt"
+  +INTERFACE_LINK_LIBRARIES "-lpthread;-lsodium;-lrt"
+
+This change mitigates an issue stemming from reuse of build artifacts
+where the path to libsodium.so does not match exactly between two
+different build hosts.
+
+Upstream-Status: Pending
+
+Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1210,7 +1210,7 @@
+   target_link_libraries(libzmq ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+ 
+   if(SODIUM_FOUND)
+-    target_link_libraries(libzmq ${SODIUM_LIBRARIES})
++    target_link_libraries(libzmq -lsodium)
+     # On Solaris, libsodium depends on libssp
+     if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+       target_link_libraries(libzmq ssp)
+@@ -1240,7 +1240,7 @@
+   target_link_libraries(libzmq-static ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+ 
+   if(SODIUM_FOUND)
+-    target_link_libraries(libzmq-static ${SODIUM_LIBRARIES})
++    target_link_libraries(libzmq-static -lsodium)
+     # On Solaris, libsodium depends on libssp
+     if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+       target_link_libraries(libzmq-static ssp)
diff --git a/meta-oe/recipes-connectivity/zeromq/zeromq_4.3.2.bb b/meta-oe/recipes-connectivity/zeromq/zeromq_4.3.2.bb
index 49215f2cb..02a4c04fd 100644
--- a/meta-oe/recipes-connectivity/zeromq/zeromq_4.3.2.bb
+++ b/meta-oe/recipes-connectivity/zeromq/zeromq_4.3.2.bb
@@ -7,6 +7,7 @@ PACKAGECONFIG ??= "libsodium"
 PACKAGECONFIG[libsodium] = "-DWITH_LIBSODIUM=ON,-DWITH_LIBSODIUM=OFF, libsodium"
 
 SRC_URI = "http://github.com/zeromq/libzmq/releases/download/v${PV}/zeromq-${PV}.tar.gz \
+    file://0001-CMakeLists-txt-Avoid-host-specific-path-to-libsodium.patch \
     file://run-ptest \
 "
 SRC_URI[md5sum] = "2047e917c2cc93505e2579bcba67a573"
-- 
2.20.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-22 16:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22 16:35 [meta-oe][PATCH] zeromq: Fix host-specific path issue with libsodium niko.mauno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.