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

tools: curve_keygen not built when building with cmake, ninja #4675

Open
spchamp opened this issue Apr 5, 2024 · 2 comments
Open

tools: curve_keygen not built when building with cmake, ninja #4675

spchamp opened this issue Apr 5, 2024 · 2 comments

Comments

@spchamp
Copy link

spchamp commented Apr 5, 2024

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 of the current zeromq RPM source package in OpenSUSE LEAP 15.5.

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?

#
# 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.

@spchamp
Copy link
Author

spchamp commented Apr 5, 2024

Could one add a couple of separate questions, towards clarification about the outcomes of the cmake build? I'm not an official maintainer for the openSUSE RPM or anything similar of course, just curious:

  • I'm not certain if the new fuzzers are available under the cmake build? i.e components built with the --with-fuzzing-engine option now available with configure in the autoconf/make build

  • Should the spec file for the build provide an option similar to --with-libgssapi_krb5? Or would this be enabled by default, in the build with cmake? given the gssapi_* files under cxx-sources in the root CMakeLists.txt

@spchamp
Copy link
Author

spchamp commented Apr 6, 2024

Update: The following is not an issue. I'd not in fact taken a look at the list of files from the source archive, where the manual pages are already available.

With the rpm build using cmake under openSUSE build tools, the manual pages as denoted in the original spec file are (were) missing (at the installation pathnames from the Makefile build. The files are already available without further processing, however)

[...]
[   17s] RPM build errors:                                                                                                                                             
[   17s]     File not found: /home/abuild/rpmbuild/BUILDROOT/zeromq-4.3.5-0.x86_64/usr/share/man/man3/zmq*.3.gz                                                        
[   17s]     File not found: /home/abuild/rpmbuild/BUILDROOT/zeromq-4.3.5-0.x86_64/usr/share/man/man7/zmq*.7.gz
[...]

$ find /var/tmp/build-root/pool-x86_64/home/abuild/rpmbuild/BUILDROOT/zeromq-4.3.5-0.x86_64/usr/share/man
find: ‘/var/tmp/build-root/pool-x86_64/home/abuild/rpmbuild/BUILDROOT/zeromq-4.3.5-0.x86_64/usr/share/man’: No such file or directory

$ find /var/tmp/build-root/pool-x86_64/home/abuild/rpmbuild/BUILDROOT/zeromq-4.3.5-0.x86_64/usr/include/
/var/tmp/build-root/pool-x86_64/home/abuild/rpmbuild/BUILDROOT/zeromq-4.3.5-0.x86_64/usr/include/
/var/tmp/build-root/pool-x86_64/home/abuild/rpmbuild/BUILDROOT/zeromq-4.3.5-0.x86_64/usr/include/zmq.h
/var/tmp/build-root/pool-x86_64/home/abuild/rpmbuild/BUILDROOT/zeromq-4.3.5-0.x86_64/usr/include/zmq_utils.h

The autoconf/GNU make tooclhain might be preferred at present?

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

1 participant