Hello community,
here is the log from the commit of package nanomsg for openSUSE:Factory checked in at 2018-06-04 13:22:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nanomsg (Old)
and /work/SRC/openSUSE:Factory/.nanomsg.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nanomsg"
Mon Jun 4 13:22:54 2018 rev:4 rq:613901 version:1.1.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/nanomsg/nanomsg.changes 2017-11-10 14:57:37.891570073 +0100
+++ /work/SRC/openSUSE:Factory/.nanomsg.new/nanomsg.changes 2018-06-04 13:23:51.849689386 +0200
@@ -1,0 +2,16 @@
+Fri Jun 1 19:39:08 UTC 2018 - mardnh@gmx.de
+
+- Update to version 1.1.3
+ * CMake exported target, easing inclusion in larger projects
+ (see demos/CMakeLists.txt for an example)
+ * Windows no longer uses a single fixed TCP port for eventfd
+ (this should improve reliability)
+ * Fix for an assertion failure in efd_unsignal
+ * The ABI version is separate from the library version now.
+ * Fixed a crash when calling nn_term without first opening a
+ socket.
+ * Fix for building Windows tests on case-sensitive file systems.
+ * CI/CD improvements: switch to CircleCI, and use CodeCov for
+ coverage analysis.
+
+-------------------------------------------------------------------
Old:
----
nanomsg-1.1.2.tar.gz
New:
----
nanomsg-1.1.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nanomsg.spec ++++++
--- /var/tmp/diff_new_pack.QSxg8n/_old 2018-06-04 13:23:52.757656138 +0200
+++ /var/tmp/diff_new_pack.QSxg8n/_new 2018-06-04 13:23:52.761655991 +0200
@@ -1,7 +1,7 @@
#
# spec file for package nanomsg
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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
@@ -16,20 +16,19 @@
#
-%define sover 5_1_0
+%define sover 5
Name: nanomsg
-Version: 1.1.2
+Version: 1.1.3
Release: 0
Summary: Socket library providing several common communication patterns
License: MIT
Group: Development/Languages/C and C++
-Url: http://nanomsg.org/
+URL: http://nanomsg.org/
Source: https://github.com/nanomsg/nanomsg/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch1: strict.diff
BuildRequires: cmake
BuildRequires: libtool
BuildRequires: pkgconfig
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
nanomsg is a C socket library providing several common communication
@@ -67,7 +66,8 @@
%files -n libnanomsg%{sover}
%defattr(-,root,root)
-%doc RELEASING AUTHORS README.md COPYING
+%license COPYING
+%doc RELEASING AUTHORS README.md
%{_libdir}/libnanomsg.so.*
%files devel
@@ -76,5 +76,7 @@
%{_libdir}/libnanomsg.so
%{_bindir}/nanocat
%{_libdir}/pkgconfig/nanomsg.pc
+%dir %{_libdir}/cmake/nanomsg
+%{_libdir}/cmake/nanomsg/nanomsg-config*.cmake
%changelog
++++++ nanomsg-1.1.2.tar.gz -> nanomsg-1.1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/.circleci/build-and-test.sh new/nanomsg-1.1.3/.circleci/build-and-test.sh
--- old/nanomsg-1.1.2/.circleci/build-and-test.sh 1970-01-01 01:00:00.000000000 +0100
+++ new/nanomsg-1.1.3/.circleci/build-and-test.sh 2018-05-24 01:30:43.000000000 +0200
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+#
+# common build & test steps for CircleCI jobs
+#
+
+uname -a
+cmake --version
+ninja --version
+
+mkdir build
+cd build
+cmake -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Debug} -DNN_ENABLE_COVERAGE=${COVERAGE:-OFF} ..
+ninja
+env CTEST_OUTPUT_ON_FAILURE=1 ninja test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/.circleci/codecov.sh new/nanomsg-1.1.3/.circleci/codecov.sh
--- old/nanomsg-1.1.2/.circleci/codecov.sh 1970-01-01 01:00:00.000000000 +0100
+++ new/nanomsg-1.1.3/.circleci/codecov.sh 2018-05-24 01:30:43.000000000 +0200
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Copyright 2018 Garrett D'Amore
+# Copyright 2018 Capitar IT Group BV
+#
+# This software is supplied under the terms of the MIT License, a
+# copy of which should be located in the distribution where this
+# file was obtained (LICENSE.txt). A copy of the license may also be
+# found online at https://opensource.org/licenses/MIT.
+
+if [ "${COVERAGE}" != ON ]
+then
+ echo "Code coverage not enabled."
+ exit 0
+fi
+
+GCOV=${GCOV:-gcov}
+
+bash <(curl -s https://codecov.io/bash) -x ${GCOV} || echo "Codecov did not collect coverage"
+echo 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/.circleci/config.yml new/nanomsg-1.1.3/.circleci/config.yml
--- old/nanomsg-1.1.2/.circleci/config.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/nanomsg-1.1.3/.circleci/config.yml 2018-05-24 01:30:43.000000000 +0200
@@ -0,0 +1,84 @@
+#
+# CircleCI 2.0 configuration. This was borrowed from NNG, but is adjusted
+# for libnanomsg. (We don't need mbedTLS or use clang-format, for example.)
+#
+version: 2.0
+jobs:
+ "clang6 - build, test":
+ docker:
+ - image: ubuntu:16.04
+ environment:
+ CC: clang-6.0
+ CXX: clang++-6.0
+ CTEST_OUTPUT_ON_FAILURE: 1
+ steps:
+ - checkout
+ - run: apt-get update -qq
+ - run: apt-get install -y software-properties-common
+ - run: apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
+ - run: apt-get update -qq
+ - run: >
+ apt-get install -y --allow-unauthenticated
+ build-essential
+ asciidoctor
+ cmake
+ ninja-build
+ clang-6.0
+ - run: ./.circleci/build-and-test.sh
+
+ "gcc8 - build, test":
+ docker:
+ - image: ubuntu:16.04
+ environment:
+ CC: gcc-8
+ CXX: g++-8
+ GCOV: gcov-8
+ CTEST_OUTPUT_ON_FAILURE: 1
+ steps:
+ - checkout
+ - run: apt-get update -qq
+ - run: apt-get install -y software-properties-common
+ - run: add-apt-repository ppa:ubuntu-toolchain-r/test
+ - run: apt-get update -qq
+ - run: >
+ apt-get install -y --allow-unauthenticated
+ build-essential
+ asciidoctor
+ cmake
+ ninja-build
+ gcc-8
+ g++-8
+ - run: ./.circleci/build-and-test.sh
+
+ "gcc - coverage":
+ docker:
+ - image: ubuntu:16.04
+ environment:
+ CC: gcc
+ CXX: g++
+ COVERAGE: "ON"
+ GCOV: gcov
+ CTEST_OUTPUT_ON_FAILURE: 1
+ steps:
+ - checkout
+ - run: apt-get update -qq
+ - run: apt-get install -y software-properties-common
+ - run: add-apt-repository ppa:ubuntu-toolchain-r/test
+ - run: apt-get update -qq
+ - run: >
+ apt-get install -y --allow-unauthenticated
+ build-essential
+ curl
+ asciidoctor
+ cmake
+ ninja-build
+ - run: ./.circleci/build-and-test.sh
+ - run: ./.circleci/codecov.sh
+
+workflows:
+ version: 2
+ build_and_test:
+ jobs:
+ - "clang6 - build, test"
+ - "gcc8 - build, test"
+ - "gcc - coverage"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/.travis.yml new/nanomsg-1.1.3/.travis.yml
--- old/nanomsg-1.1.2/.travis.yml 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/.travis.yml 1970-01-01 01:00:00.000000000 +0100
@@ -1,39 +0,0 @@
-language: c
-sudo: false
-matrix:
- include:
- - os: linux
- compiler: gcc
- - os: linux
- compiler: clang
-# - os: osx
-# compiler: gcc
- - os: osx
- compiler: clang
-before_script:
- - gem install asciidoctor
-script:
- # Print all environment variables to aid in CI development
- - printenv
- # Print version and available CMake generators to aid in CI development
- - cmake --version
- - cmake --help
- # Perform out-of-source build
- - mkdir build
- - cd build
- # Perform CMake backend generation, build, and test
- - cmake ..
- - cmake --build . -- -j4
- - ctest --output-on-failure -C Debug -j4
-#deploy:
-# provider: releases
-# api_key:
-# secure: fVMvvlhsginfIB7gEhAoKG7xzvF6D94yl8Z+jjfHQG4YtG3SScKVeQUnpWK7NhT90uoUfPnxd5dN3ZWlApoLBSz7iVD0sT1+VGYerM0Gn3LTUj3xvTB3WAAft6YePKhQeJfduzSNqsRjQ7buKgI1SFH0Ek5xwZe4Kl/O/D2Tsw0=
-# file:
-# - nanomsg-${TRAVIS_TAG}.zip
-# - nanomsg-${TRAVIS_TAG}.tar.gz
-# - nanomsg-${TRAVIS_TAG}.tar.bz2
-# skip_cleanup: true
-# on:
-# tags: true
-# repo: nanomsg/nanomsg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/.version new/nanomsg-1.1.3/.version
--- old/nanomsg-1.1.2/.version 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/.version 2018-05-24 01:30:43.000000000 +0200
@@ -1 +1 @@
-1.1.2
+1.1.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/CMakeLists.txt new/nanomsg-1.1.3/CMakeLists.txt
--- old/nanomsg-1.1.2/CMakeLists.txt 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/CMakeLists.txt 2018-05-24 01:30:43.000000000 +0200
@@ -58,8 +58,9 @@
if ((NN_VERSION_CURRENT STREQUAL "") OR (NN_VERSION_REVISION STREQUAL "") OR (NN_VERSION_AGE STREQUAL ""))
message (FATAL_ERROR "Could not read ABI version from nn.h")
else ()
- set (NN_ABI_VERSION "${NN_VERSION_CURRENT}.${NN_VERSION_REVISION}.${NN_VERSION_AGE}")
- message (STATUS "Detected nanomsg ABI v${NN_ABI_VERSION}")
+ set (NN_ABI_VERSION "${NN_VERSION_CURRENT}")
+ set (NN_LIB_VERSION "${NN_VERSION_CURRENT}.${NN_VERSION_REVISION}.${NN_VERSION_AGE}")
+ message (STATUS "Detected nanomsg ABI v${NN_ABI_VERSION} (v${NN_LIB_VERSION})")
endif ()
# Determine package version.
@@ -97,6 +98,7 @@
option (NN_STATIC_LIB "Build static library instead of shared library." OFF)
option (NN_ENABLE_DOC "Enable building documentation." ON)
+option (NN_ENABLE_COVERAGE "Enable coverage reporting." OFF)
option (NN_ENABLE_GETADDRINFO_A "Enable/disable use of getaddrinfo_a in place of getaddrinfo." ON)
option (NN_TESTS "Build and run nanomsg tests" ON)
option (NN_TOOLS "Build nanomsg tools" ON)
@@ -105,6 +107,32 @@
# Platform checks.
+if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set(NN_WARN_FLAGS "-Wall -Wextra")
+elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ set(NN_WARN_FLAGS "-Wall -Wextra")
+elseif (CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+ set(NN_WARN_FLAGS "-Wall -Wextra")
+endif()
+
+if (NN_ENABLE_COVERAGE)
+ # NB: This only works for GCC and Clang 3.0 and newer. If your stuff
+ # is older than that, you will need to find something newer. For
+ # correct reporting, we always turn off all optimizations.
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ set(NN_COVERAGE_FLAGS "-g -O0 --coverage")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ set(NN_COVERAGE_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+ set(NN_COVERAGE_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
+ else()
+ message(FATAL_ERROR "Unable to enable coverage for your compiler.")
+ endif()
+endif()
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NN_WARN_FLAGS} ${NN_COVERAGE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NN_WARN_FLAGS} ${NN_COVERAGE_FLAGS}")
+
find_package (Threads REQUIRED)
message(STATUS "OS System is ${CMAKE_SYSTEM_NAME}")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/README.md new/nanomsg-1.1.3/README.md
--- old/nanomsg-1.1.2/README.md 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/README.md 2018-05-24 01:30:43.000000000 +0200
@@ -3,8 +3,9 @@
[![Release](https://img.shields.io/github/release/nanomsg/nanomsg.svg)](https://github.com/nanomsg/nanomsg/releases/latest)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nanomsg/nanomsg/blob/master/COPYING)
-[![Linux Status](https://img.shields.io/travis/nanomsg/nanomsg/master.svg?label=linux)](https://travis-ci.org/nanomsg/nanomsg)
+[![Linux Status](https://img.shields.io/circleci/project/github/nanomsg/nanomsg/master.svg?label=linux)](https://circleci.com/gh/nanomsg/nanomsg)
[![Windows Status](https://img.shields.io/appveyor/ci/nanomsg/nanomsg/master.svg?label=windows)](https://ci.appveyor.com/project/nanomsg/nanomsg)
+[![Coverage](https://codecov.io/gh/nanomsg/nanomsg/branch/master/graph/badge.svg?label=coverage)](https://codecov.io/gh/nanomsg/nanomsg)
[![Gitter](https://img.shields.io/badge/gitter-join-brightgreen.svg)](https://gitter.im/nanomsg/nanomsg)
The nanomsg library is a simple high-performance implementation of several
@@ -72,7 +73,7 @@
2. `cd build`
3. `cmake ..`
4. `cmake --build . --config Debug`
-5. `ctest --config Debug .`
+5. `ctest -C Debug .`
6. `cmake --build . --config Debug --target install`
*NB:* This may have to be done using an Administrator account.
@@ -99,6 +100,19 @@
When using the .LIB on Windows, you will also need to link with the
ws2_32, mswsock, and advapi32 libraries, as nanomsg depends on them.
+Support
+-------
+
+This library is considered to be in "sustaining" mode, which means that new
+feature development has ended, and bug fixes are made only when strictly
+necessary for severe issues.
+
+New development is now occuring in the [NNG](https://github.com/nanomsg/nng)
+project, which offers both protocol and API compatibility with this project.
+Please consider using NNG for new projects.
+
+Please see the file SUPPORT for more details.
+
Resources
---------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/RELEASING new/nanomsg-1.1.3/RELEASING
--- old/nanomsg-1.1.2/RELEASING 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/RELEASING 2018-05-24 01:30:43.000000000 +0200
@@ -3,7 +3,7 @@
1. Check CI
- * Travis: https://travis-ci.org/nanomsg/nanomsg
+ * CircleCI: https://circleci.com/gh/nanomsg/nanomsg/tree/master
* AppVeyor: https://ci.appveyor.com/project/nanomsg/nanomsg
2. Bump ABI version as appropriate (see the docs on versioning). This happens
@@ -19,25 +19,24 @@
6. Push the tag to the repo, e.g. git push origin 0.3-beta.
- 7. Wait a little bit for Travis CI to build, and create artifacts.
- (Travis does this automatically for tagged releases.)
+ 7. Wait a little bit for CI to build.
- 8. Also check the AppVeyor CI again just to be sure.
+ 8. Check the AppVeyor CI again just to be sure.
9. Check the github releases page - a release for the tag should have
already been created with artifacts ready to download.
-10. Upload the "download" page on the website (see gh-pages branch of the
- repo). The only thing that needs to be updated is the LATEST RELEASE
- number and date.
+10. Update the _config.yml page on the website (see gh-pages branch of the
+ repo). The only thing that needs to be updated is the "latest" and
+ "latest_date".
+
+11. In the online docs (gh-pages branch), copy the man pages (adoc format)
+ into a subdirectory of _adoc named after the version (e.g.
+ "_adoc/v1.1.3"), then run the _adoc/build.sh script. Add the resulting
+ "v1.1.3" directory, commit, and push.
-11. In online docs (gh-pages) make a new folder (e.g. v0.3) and copy the HTML
- docs (*.html from build directory) there.
-
-12. Link the docs from "documentation.html" page.
-
-13. Send the announcement about the release. These commands might be useful:
+12. Send the announcement about the release. These commands might be useful:
git log --oneline 0.2-alpha..0.3-beta | wc -l
git diff -U0 0.2-alpha..0.3-beta AUTHORS
-14. Update the topic in the chatroom accordingly.
+13. Update the topic in the Gitter chatroom accordingly.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/SUPPORT new/nanomsg-1.1.3/SUPPORT
--- old/nanomsg-1.1.2/SUPPORT 1970-01-01 01:00:00.000000000 +0100
+++ new/nanomsg-1.1.3/SUPPORT 2018-05-24 01:30:43.000000000 +0200
@@ -0,0 +1,23 @@
+SUPPORT
+=======
+
+This project ("nanomsg") or more properly "nanomsg 1.0" is now in
+"sustaining" mode.
+
+This means that generally the project maintainers will only integrate fixes
+or release new versions when severe defects are found. The reason for this
+is that new development effort has transitioned to the "NNG" project
+(see https://github.com/nanomsg/nng for more information).
+
+The possible exception to this would be for features with a specific
+commercial sponsorship, for commercial users unable to use NNG.
+
+The NNG project as of this writing has *nearly* complete compatibility
+with nanomsg (99% of apps will work with no source code changes, and
+the NNG library is also wire compatible with nanomsg, so that projects
+built with the two separate libraries can interoperate seamlessly).
+In addition it offers higher scalability, reliability, and usability.
+It also offers a number of more advanced features.
+
+Commercial support for both NNG and this project ("nanomsg") is offered
+by Staysail Systems, Inc. Contact info@staysail.tech for more information.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/demo/CMakeLists.txt new/nanomsg-1.1.3/demo/CMakeLists.txt
--- old/nanomsg-1.1.2/demo/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/nanomsg-1.1.3/demo/CMakeLists.txt 2018-05-24 01:30:43.000000000 +0200
@@ -0,0 +1,29 @@
+#
+# Demonstration CMakeLists.txt for nanomsg demos.
+#
+# This file shows how one might use nanomsg from a another project
+# that is also CMake-driven.
+#
+# Thanks for the idea goes to @maddouri.
+#
+cmake_minimum_required (VERSION 2.8.7)
+
+project(nanomsg-demo)
+
+# Call this from your own project's makefile.
+find_package(nanomsg CONFIG REQUIRED)
+
+add_executable(async_demo async_demo.c)
+target_link_libraries(async_demo nanomsg)
+
+add_executable(device_demo device_demo.c)
+target_link_libraries(device_demo nanomsg)
+
+add_executable(pthread_demo pthread_demo.c)
+target_link_libraries(pthread_demo nanomsg)
+
+add_executable(pubsub_demo pubsub_demo.c)
+target_link_libraries(pubsub_demo nanomsg)
+
+add_executable(rpc_demo rpc_demo.c)
+target_link_libraries(rpc_demo nanomsg)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/demo/README new/nanomsg-1.1.3/demo/README
--- old/nanomsg-1.1.2/demo/README 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/demo/README 2018-05-24 01:30:43.000000000 +0200
@@ -3,3 +3,6 @@
your own code.
We welcome further contributions here.
+
+These have their own CMake driven configuration if you want to build them
+all. They are not built automatically.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/doc/nn_pubsub.adoc new/nanomsg-1.1.3/doc/nn_pubsub.adoc
--- old/nanomsg-1.1.2/doc/nn_pubsub.adoc 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/doc/nn_pubsub.adoc 2018-05-24 01:30:43.000000000 +0200
@@ -71,10 +71,14 @@
int sub = nn_socket (AF_SP, NN_SUB);
int nbytes;
void *buf = NULL;
+char *addr = "inproc://example";
nn_setsockopt (sub, NN_SUB, NN_SUB_SUBSCRIBE, "foo", 3);
nn_setsockopt (sub, NN_SUB, NN_SUB_SUBSCRIBE, "bar", 3);
+nn_bind(pub, addr);
+nn_connect(sub, addr);
+
nbytes = nn_send (pub, "foo|Hello!", 10);
assert(nbytes == 10);
nbytes = nn_recv (sub, &buf, NN_MSG, 0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/src/CMakeLists.txt new/nanomsg-1.1.3/src/CMakeLists.txt
--- old/nanomsg-1.1.2/src/CMakeLists.txt 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/src/CMakeLists.txt 2018-05-24 01:30:43.000000000 +0200
@@ -337,11 +337,14 @@
if (NN_STATIC_LIB)
add_library (${PROJECT_NAME} STATIC ${NN_SOURCES})
+ target_compile_definitions (${PROJECT_NAME} PUBLIC NN_STATIC_LIB)
else ()
add_library (${PROJECT_NAME} SHARED ${NN_SOURCES})
add_definitions (-DNN_SHARED_LIB)
set_target_properties (${PROJECT_NAME} PROPERTIES
- SOVERSION "${NN_ABI_VERSION}")
+ SOVERSION "${NN_ABI_VERSION}"
+ VERSION "${NN_LIB_VERSION}"
+ )
endif ()
# Set library outputs same as top-level project binary outputs
@@ -364,11 +367,14 @@
endforeach()
endif()
configure_file (pkgconfig.in ${PROJECT_NAME}.pc @ONLY)
+target_include_directories(${PROJECT_NAME} PUBLIC $)
install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install (TARGETS ${PROJECT_NAME}
+ EXPORT ${PROJECT_NAME}-target
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
+install (EXPORT ${PROJECT_NAME}-target DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} FILE ${PROJECT_NAME}-config.cmake)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/src/aio/poller_epoll.inc new/nanomsg-1.1.3/src/aio/poller_epoll.inc
--- old/nanomsg-1.1.2/src/aio/poller_epoll.inc 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/src/aio/poller_epoll.inc 2018-05-24 01:30:43.000000000 +0200
@@ -61,7 +61,6 @@
void nn_poller_add (struct nn_poller *self, int fd,
struct nn_poller_hndl *hndl)
{
- int rc;
struct epoll_event ev;
/* Initialise the handle and add the file descriptor to the pollset. */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/src/core/global.c new/nanomsg-1.1.3/src/core/global.c
--- old/nanomsg-1.1.2/src/core/global.c 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/src/core/global.c 2018-05-24 01:30:43.000000000 +0200
@@ -168,6 +168,7 @@
int print_errors;
+ int inited;
nn_mutex_t lock;
nn_condvar_t cond;
};
@@ -306,6 +307,10 @@
{
int i;
+ if (!self.inited) {
+ return;
+ }
+
nn_mutex_lock (&self.lock);
self.flags |= NN_CTX_FLAG_TERMING;
nn_mutex_unlock (&self.lock);
@@ -323,8 +328,18 @@
nn_mutex_unlock (&self.lock);
}
+static void nn_lib_init(void)
+{
+ /* This function is executed once to initialize global locks. */
+ nn_mutex_init (&self.lock);
+ nn_condvar_init (&self.cond);
+ self.inited = 1;
+}
+
void nn_init (void)
{
+ nn_do_once (&once, nn_lib_init);
+
nn_mutex_lock (&self.lock);
/* Wait for any in progress term to complete. */
while (self.flags & NN_CTX_FLAG_TERMING) {
@@ -403,7 +418,7 @@
if (headsz + NN_CMSG_SPACE (0) > sz ||
headsz + NN_CMSG_ALIGN_ (next->cmsg_len) > sz)
return NULL;
-
+
/* Success. */
return next;
}
@@ -439,8 +454,10 @@
if ((sock = nn_alloc (sizeof (struct nn_sock), "sock")) == NULL)
return -ENOMEM;
rc = nn_sock_init (sock, socktype, s);
- if (rc < 0)
+ if (rc < 0) {
+ nn_free (sock);
return rc;
+ }
/* Adjust the global socket table. */
self.socks [s] = sock;
@@ -452,13 +469,6 @@
return -EINVAL;
}
-static void nn_lib_init(void)
-{
- /* This function is executed once to initialize global locks. */
- nn_mutex_init (&self.lock);
- nn_condvar_init (&self.cond);
-}
-
int nn_socket (int domain, int protocol)
{
int rc;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/src/transports/inproc/sinproc.c new/nanomsg-1.1.3/src/transports/inproc/sinproc.c
--- old/nanomsg-1.1.2/src/transports/inproc/sinproc.c 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/src/transports/inproc/sinproc.c 2018-05-24 01:30:43.000000000 +0200
@@ -236,6 +236,8 @@
self->state = NN_SINPROC_STATE_STOPPING;
}
return;
+ default:
+ break;
}
case NN_SINPROC_SRC_PEER:
switch (type) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/src/transports/ipc/sipc.c new/nanomsg-1.1.3/src/transports/ipc/sipc.c
--- old/nanomsg-1.1.2/src/transports/ipc/sipc.c 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/src/transports/ipc/sipc.c 2018-05-24 01:30:43.000000000 +0200
@@ -375,6 +375,7 @@
default:
nn_assert (0);
+ return;
}
case NN_USOCK_SHUTDOWN:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/src/transports/utils/streamhdr.c new/nanomsg-1.1.3/src/transports/utils/streamhdr.c
--- old/nanomsg-1.1.2/src/transports/utils/streamhdr.c 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/src/transports/utils/streamhdr.c 2018-05-24 01:30:43.000000000 +0200
@@ -237,6 +237,7 @@
return;
default:
nn_assert (0);
+ return;
}
case NN_STREAMHDR_SRC_TIMER:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/src/utils/atomic.c new/nanomsg-1.1.3/src/utils/atomic.c
--- old/nanomsg-1.1.2/src/utils/atomic.c 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/src/utils/atomic.c 2018-05-24 01:30:43.000000000 +0200
@@ -22,6 +22,7 @@
#include "atomic.h"
#include "err.h"
+#include "attr.h"
void nn_atomic_init (struct nn_atomic *self, uint32_t n)
{
@@ -31,12 +32,16 @@
#endif
}
+#if defined NN_ATOMIC_MUTEX
void nn_atomic_term (struct nn_atomic *self)
{
-#if defined NN_ATOMIC_MUTEX
nn_mutex_term (&self->sync);
-#endif
}
+#else
+void nn_atomic_term (NN_UNUSED struct nn_atomic *self)
+{
+}
+#endif
uint32_t nn_atomic_inc (struct nn_atomic *self, uint32_t n)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/src/utils/efd_win.inc new/nanomsg-1.1.3/src/utils/efd_win.inc
--- old/nanomsg-1.1.2/src/utils/efd_win.inc 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/src/utils/efd_win.inc 2018-05-24 01:30:43.000000000 +0200
@@ -1,7 +1,8 @@
/*
Copyright (c) 2012-2013 Martin Sustrik All rights reserved.
Copyright 2017 Garrett D'Amore
- Copyright 2017 Capitar IT Group BV
+ Copyright 2018 Staysail Systems, Inc.
+ Copyright 2018 Capitar IT Group BV
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -34,50 +35,15 @@
int nn_efd_init (struct nn_efd *self)
{
- SECURITY_ATTRIBUTES sa = {0};
- SECURITY_DESCRIPTOR sd;
- BOOL brc;
- HANDLE sync;
- DWORD dwrc;
SOCKET listener;
int rc;
struct sockaddr_in addr;
- int addrlen;
- BOOL reuseaddr;
+ socklen_t addrlen;
+ int one;
BOOL nodelay;
u_long nonblock;
int i;
- /* Make the following critical section accessible to everyone. */
- sa.nLength = sizeof (sa);
- sa.bInheritHandle = FALSE;
- brc = InitializeSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);
- win_assert (brc);
- brc = SetSecurityDescriptorDacl(&sd, TRUE, (PACL) NULL, FALSE);
- win_assert (brc);
- sa.lpSecurityDescriptor = &sd;
-
- /* This function has to be enclosed in a system-wide critical section
- so that two instances of the library don't accidentally create an efd
- crossing the process boundary. */
- sync = CreateMutex (&sa, FALSE, "Global\\nanomsg-port-mutex");
- win_assert (sync != NULL);
-
- /* Enter the critical section. If we cannot get the object in 10 seconds
- then something is seriously wrong. Just bail. */
- dwrc = WaitForSingleObject (sync, 10000);
- switch (dwrc) {
- case WAIT_ABANDONED:
- case WAIT_OBJECT_0:
- break;
- case WAIT_TIMEOUT:
- rc = ETIMEDOUT;
- goto wsafail3;
- default:
- rc = nn_err_wsa_to_posix (WSAGetLastError ());
- goto wsafail3;
- }
-
/* Unfortunately, on Windows the only way to send signal to a file
descriptor (SOCKET) is to create a full-blown TCP connecting on top of
the loopback interface. */
@@ -86,102 +52,69 @@
/* Create listening socket. */
listener = socket (AF_INET, SOCK_STREAM, 0);
- if (nn_slow (listener == SOCKET_ERROR))
+ if (listener == SOCKET_ERROR)
goto wsafail;
- brc = SetHandleInformation ((HANDLE) listener, HANDLE_FLAG_INHERIT, 0);
- win_assert (brc);
- /* This prevents subsequent attempts to create a signaler to fail bacause
- of "TCP port in use" problem. */
- reuseaddr = 1;
- rc = setsockopt (listener, SOL_SOCKET, SO_REUSEADDR,
- (char*) &reuseaddr, sizeof (reuseaddr));
- if (nn_slow (rc == SOCKET_ERROR))
+ one = 1;
+ rc = setsockopt (listener, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
+ (char*) &one, sizeof (one));
+ if (rc == SOCKET_ERROR)
goto wsafail;
/* Bind the listening socket to the local port. */
memset (&addr, 0, sizeof (addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
- addr.sin_port = htons (NN_EFD_PORT);
+ addr.sin_port = 0;
+
rc = bind (listener, (const struct sockaddr*) &addr, sizeof (addr));
- if (nn_slow (rc == SOCKET_ERROR))
+ if (rc == SOCKET_ERROR)
+ goto wsafail;
+
+ /* Get the port we bound to (will be ephemeral.) */
+ addrlen = sizeof (addr);
+ rc = getsockname (listener, (struct sockaddr *) &addr, &addrlen);
+ if (rc == SOCKET_ERROR)
goto wsafail;
/* Start listening for the incomming connections. In normal case we are
going to accept just a single connection, so backlog buffer of size
1 is sufficient. */
rc = listen (listener, 1);
- if (nn_slow (rc == SOCKET_ERROR))
+ if (rc == SOCKET_ERROR)
goto wsafail;
/* The following code is in the loop, because windows sometimes delays
WSAEADDRINUSE error to the `connect` call. But retrying the connection
works like a charm. Still we want to limit number of retries */
- for(i = 0; i < NN_EFD_RETRIES; ++i) {
- /* Create the writer socket. */
- self->w = socket (AF_INET, SOCK_STREAM, 0);
- if (nn_slow (listener == SOCKET_ERROR))
- goto wsafail;
- brc = SetHandleInformation ((HANDLE) self->w, HANDLE_FLAG_INHERIT, 0);
- win_assert (brc);
-
- /* Set TCP_NODELAY on the writer socket to make efd as fast as possible.
- There's only one byte going to be written, so batching would not make
- sense anyway. */
- nodelay = 1;
- rc = setsockopt (self->w, IPPROTO_TCP, TCP_NODELAY, (char*) &nodelay,
- sizeof (nodelay));
- if (nn_slow (rc == SOCKET_ERROR))
- goto wsafail;
-
- /* Connect the writer socket to the listener socket. */
- rc = connect (self->w, (struct sockaddr*) &addr, sizeof (addr));
- if (nn_slow (rc == SOCKET_ERROR)) {
- rc = nn_err_wsa_to_posix (WSAGetLastError ());
- if (rc == EADDRINUSE) {
- rc = closesocket (self->w);
- if (nn_slow (rc == INVALID_SOCKET))
- goto wsafail;
- continue;
- }
- goto wsafail2;
- }
- break;
- }
- if (i == NN_EFD_RETRIES)
- goto wsafail2;
-
- for (;;) {
-
- /* Accept new incoming connection. */
- addrlen = sizeof (addr);
- self->r = accept (listener, (struct sockaddr*) &addr, &addrlen);
- if (nn_slow (self->r == INVALID_SOCKET || addrlen != sizeof (addr)))
- goto wsafail2;
+ /* Create the writer socket. */
+ self->w = socket (AF_INET, SOCK_STREAM, 0);
+ if (listener == SOCKET_ERROR)
+ goto wsafail;
- /* Check that the connection actually comes from the localhost. */
- if (nn_fast (addr.sin_addr.s_addr == htonl (INADDR_LOOPBACK)))
- break;
+ /* Set TCP_NODELAY on the writer socket to make efd as fast as possible.
+ There's only one byte going to be written, so batching would not make
+ sense anyway. */
+ nodelay = 1;
+ rc = setsockopt (self->w, IPPROTO_TCP, TCP_NODELAY, (char*) &nodelay,
+ sizeof (nodelay));
+ if (nn_slow (rc == SOCKET_ERROR))
+ goto wsafail;
- /* If not so, close the connection and try again. */
- rc = closesocket (self->r);
- if (nn_slow (rc == INVALID_SOCKET))
- goto wsafail;
- }
+ /* Connect the writer socket to the listener socket. */
+ rc = connect (self->w, (struct sockaddr*) &addr, sizeof (addr));
+ if (rc == SOCKET_ERROR)
+ goto wsafail;
- /* Listener socket can be closed now as no more connections for this efd
- are going to be established anyway. */
- rc = closesocket (listener);
- if (nn_slow (rc == INVALID_SOCKET))
+ /* Accept new incoming connection. */
+ addrlen = sizeof (addr);
+ self->r = accept (listener, (struct sockaddr*) &addr, &addrlen);
+ if (self->r == INVALID_SOCKET)
goto wsafail;
- /* Leave the critical section. */
- brc = ReleaseMutex (sync);
- win_assert (brc != 0);
- brc = CloseHandle (sync);
- win_assert (brc != 0);
+ /* Close the listener, we don't need it anymore. */
+ (void) closesocket (listener);
/* Make the receiving socket non-blocking. */
nonblock = 1;
@@ -192,12 +125,6 @@
wsafail:
rc = nn_err_wsa_to_posix (WSAGetLastError ());
-wsafail2:
- brc = ReleaseMutex (sync);
- win_assert (brc != 0);
-wsafail3:
- brc = CloseHandle (sync);
- win_assert (brc != 0);
return -rc;
}
@@ -263,7 +190,7 @@
if (rc == SOCKET_ERROR && WSAGetLastError () == WSAEWOULDBLOCK)
rc = 0;
wsa_assert (rc != SOCKET_ERROR);
- if (nn_fast (rc < sizeof (buf)))
+ if ((rc == SOCKET_ERROR) || (rc < sizeof (buf)))
break;
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/tests/bug777.c new/nanomsg-1.1.3/tests/bug777.c
--- old/nanomsg-1.1.2/tests/bug777.c 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/tests/bug777.c 2018-05-24 01:30:43.000000000 +0200
@@ -25,7 +25,7 @@
#include "testutil.h"
-int main (int argc, const char *argv[])
+int main (NN_UNUSED int argc, const NN_UNUSED char *argv[])
{
int sb;
int sc1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/tests/ipc_stress.c new/nanomsg-1.1.3/tests/ipc_stress.c
--- old/nanomsg-1.1.2/tests/ipc_stress.c 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/tests/ipc_stress.c 2018-05-24 01:30:43.000000000 +0200
@@ -95,7 +95,7 @@
bytes = nn_send (cli_sock, msg, sz_msg, 0);
/* This would better be handled via semaphore or condvar. */
nn_sleep (100);
- nn_assert (bytes == sz_msg);
+ nn_assert ((size_t)bytes == sz_msg);
nn_close (cli_sock);
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nanomsg-1.1.2/tests/win_sec_attr.c new/nanomsg-1.1.3/tests/win_sec_attr.c
--- old/nanomsg-1.1.2/tests/win_sec_attr.c 2017-11-07 01:06:34.000000000 +0100
+++ new/nanomsg-1.1.3/tests/win_sec_attr.c 2018-05-24 01:30:43.000000000 +0200
@@ -29,9 +29,9 @@
#include "testutil.h"
-#include
-#include
-#include
+#include
+#include
+#include
/* Windows only. Custom SECURITY_ATTRIBUTES on a socket. */