← All tasks
cppzeromq/libzmq #4675Not a task: already works

tools: curve_keygen not built when building with cmake, ninja

envgap__zeromq__libzmq-4675

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
b91a6201307b72beb522300366aad763d19b1456
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

zeromq/libzmq #4675 · read the original issue
# Issue description



When building with cmake using the ninja builder, the `curve_keygen` tool is not compiled or installed.



This tool is built when using the autoconf toolchain and GNU Make.



# Environment



* libzmq versions: 4.3.5 and latest (2a75ef0)

* OS: openSUSE Leap 15.5 



# Minimal test code / Steps to reproduce the issue



spec file for an RPM build using cmake and ninja, tentatively to be contributed as a patch for [a user branch](https://build.opensuse.org/package/show/home:spchamp/zeromq)  of the [current zeromq RPM source package in OpenSUSE LEAP 15.5](https://build.opensuse.org/package/show/SUSE:SLE-15:Update/zeromq). 



This would provide something of an update to the latest ZeroMQ release, for OpenSUSE LEAP 15.5. This uses cmake for the build, while the official RPM uses the traditional autoconf and GNU make toolchain.



Supplemental to the 'pgm' option in the OpenSUSE base RPM, this also adds a 'drafts' option for the RPM build with openSUSE build tools. It might be  similar to the spec file in the libzmq source tree?



```rpm

#

# spec file for package zeromq

#

# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.

#

# All modifications and additions to the file contributed by third parties

# remain the property of their copyright owners, unless otherwise agreed

# upon. The license for this file, and modifications and additions to the

# file, is the same license as for the pristine package itself (unless the

# license for the pristine package is not an Open Source License, in which

# case the license is the MIT License). An "Open Source License" is a

# license that conforms to the Open Source Definition (Version 1.9)

# published by the Open Source Initiative.



# Please submit bugfixes or comments via https://bugs.opensuse.org/

#





%define lib_name libzmq5

%define __builder ninja

%ifarch %{ix86} x86_64

%bcond_without pgm

%else

%bcond_with pgm

%endif

%bcond_with drafts

Name:           zeromq

Version:        4.3.5

Release:        0

Summary:        Lightweight messaging kernel

License:        LGPL-3.0-or-later

Group:          Productivity/Networking/Web/Servers

URL:            http://www.zeromq.org/

Source:         https://github.com/zeromq/libzmq/releases/download/v%{version}/zeromq-%{version}.tar.gz

Source99:       baselibs.conf

BuildRequires:  cmake

BuildRequires:  ninja

BuildRequires:  asciidoc

BuildRequires:  gcc12-c++

BuildRequires:  libbsd-devel

BuildRequires:  libgnutls-devel

BuildRequires:  libunwind-devel

BuildRequires:  pkgconfig

BuildRequires:  xmlto

%if 0%{?suse_version} && 0%{?suse_version} <= 1110

BuildRequires:  libsodium-devel

BuildRequires:  libuuid-devel

%else

BuildRequires:  pkgconfig(libsodium)

BuildRequires:  pkgconfig(uuid)

%endif

%if %{with pgm}

BuildRequires:  openpgm-devel >= 5.1

BuildRequires:  python

%if 0%{?suse_version} && 0%{?suse_version} <= 1110

BuildRequires:  glib2-devel >= 2.8

%else

BuildRequires:  pkgconfig(glib-2.0) >= 2.8

%endif

%endif  # with pgm



%description

The ZeroMQ messaging kernel is a library extending the standard

socket interfaces with an abstraction of asynchronous message queues,

multiple messaging patterns, message filtering (subscriptions) and

seamless access to multiple transport protocols.



%package -n %{lib_name}

Summary:        Shared Library for ZeroMQ

Group:          Productivity/Networking/Web/Servers

Recommends:     %{name}-tools = %{version}



%description -n %{lib_name}

The ZeroMQ messaging kernel is a library extending the standard

socket interfaces with an abstraction of asynchronous message queues,

multiple messaging patterns, message filtering (subscriptions) and

seamless access to multiple transport protocols.



This package holds the shared library part of the ZeroMQ package.



%package tools

Summary:        Tools to work with ZeroMQ

# Conflict old libraries as we collide with them

Group:          Productivity/Networking/Web/Servers

Conflicts:      libzmq1

Conflicts:      libzmq2

Conflicts:      libzmq3



%description tools

The ZeroMQ messaging kernel is a library extending the standard

socket interfaces with an abstraction of asynchronous message queues,

multiple messaging patterns, message filtering (subscriptions) and

seamless access to multiple transport protocols.



This package contains the utilities to work with ZeroMQ library.



%package devel

Summary:        Development files for ZeroMQ

Group:          Development/Languages/C and C++

Requires:       %{lib_name} = %{version}

Provides:       libzmq-devel = %{version}



%description devel

The ZeroMQ messaging kernel is a library extending the standard

socket interfaces with an abstraction of asynchronous message queues,

multiple messaging patterns, message filtering (subscriptions) and

seamless access to multiple transport protocols.



This package holds the development files for ZeroMQ.



%prep

%autosetup -p1



%build

%cmake \

%if %{with drafts}

  -DENABLE_DRAFTS=ON \

%endif

%if %{with pgm}

  -DWITH_OPENPGM=ON \

%endif

  -DWITH_LIBSODIUM=ON \

  -DENABLE_CURVE=ON \

  -DCMAKE_CXX_COMPILER=g++-12 \

  -DCMAKE_C_COMPILER=gcc-12 



%install

%cmake_install

find %{buildroot} -type f -name "*.la" -delete -print



%check

%ctest -j %{jobs} --test-dir tests



%post -n %{lib_name} -p /sbin/ldconfig

%postun -n %{lib_name} -p /sbin/ldconfig



%files -n %{lib_name}

%license LICENSE

%{_libdir}/libzmq.so.*



%files tools

%license LICENSE

%{_bindir}/curve_keygen

%{_bindir}/inproc_lat

%{_bindir}/inproc_thr

%{_bindir}/local_lat

%{_bindir}/local_thr

%{_bindir}/proxy_thr

%{_bindir}/remote_lat

%{_bindir}/remote_thr 



%files devel

%doc AUTHORS ChangeLog NEWS

%license LICENSE

%{_includedir}/zmq*

%{_libdir}/libzmq.so

%{_libdir}/cmake/ZeroMQ/*

%{_libdir}/pkgconfig/libzmq.pc

%{_mandir}/man3/zmq*.3%{?ext_man}

%{_mandir}/man7/zmq*.7%{?ext_man}



%changelog



```





# What's the actual result? (include assertion message & call stack if applicable)



The `%{_bindir}/curve_keygen` tool is not built or installed, when using the cmake build defs and ninja.



Of course, it would be possible to build this manually with a post-cmake compiler in the RPM spec file.



Otherwise:

- The other bin/ tools are built successfully, i.e the such as `{inproc, local, remote}_{lat, thr}` and `proxy_thr`

- With and without the additional `drafts` build option enabled for the RPM build,  the build works out though. 

- With the drafts option enabled in the RPM build, it can also be used with the drafts support in pyzmq.



# What's the expected result?



Ideally, the `%{_bindir}/curve_keygen` runtime tool would be built and installed with the cmake build, similar to the build with GNU Make



I'll try to build this with the GNU Make builder in cmake. I'm not certain if that would use autoconf toolchain however.



Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]