[qpid-proton] branch main updated: PROTON-2355: Definitively fix CMake 2.8.12 incompatibility w/ generexp in add_library (#306)

2021-04-02 Thread jdanek
This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/main by this push:
 new c3b2c05  PROTON-2355: Definitively fix CMake 2.8.12 incompatibility w/ 
generexp in add_library (#306)
c3b2c05 is described below

commit c3b2c058f43ef0b7b1195753682055e6dc53a5bb
Author: Jiri Daněk 
AuthorDate: Sat Apr 3 01:57:24 2021 +0200

PROTON-2355: Definitively fix CMake 2.8.12 incompatibility w/ generexp in 
add_library (#306)
---
 c/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt
index a7ecf2f..62c0447 100644
--- a/c/CMakeLists.txt
+++ b/c/CMakeLists.txt
@@ -433,6 +433,7 @@ if (qpid-proton-proactor)
 COMPILE_FLAGS "${LTO}"
 LINK_FLAGS "${CATCH_UNDEFINED} ${LINK_LTO}")
   target_compile_definitions(qpid-proton-proactor-objects PRIVATE 
qpid_proton_proactor_EXPORTS)
+  set(TARGET_OBJECTS_qpid-proton-proactor-objects 
"$")
 
   # Can't use target_link_libraries() because cmake 2.8.12 doesn't allow 
object libraries as the first param
   # otherwise for cmake 3.9 and on this would be:
@@ -467,7 +468,7 @@ set(qpid-proton-noncore-src
 add_library (qpid-proton SHARED
   $
   $
-  $<$:$>
+  ${TARGET_OBJECTS_qpid-proton-proactor-objects}
   ${qpid-proton-noncore-src})
 target_link_libraries (qpid-proton LINK_PRIVATE ${SSL_LIB} ${SASL_LIB} 
${TIME_LIB} ${PLATFORM_LIBS} ${PROACTOR_LIBS})
 set_target_properties (qpid-proton

-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-dispatch] branch main updated: DISPATCH-2025 Compile using C11 language version (#1090)

2021-04-02 Thread jdanek
This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/main by this push:
 new 43f3810  DISPATCH-2025 Compile using C11 language version (#1090)
43f3810 is described below

commit 43f381002e385f7026dd5b94a405f9627ecaf7cc
Author: Jiri Daněk 
AuthorDate: Sat Apr 3 00:07:28 2021 +0200

DISPATCH-2025 Compile using C11 language version (#1090)
---
 CMakeLists.txt   | 91 +++-
 tests/CMakeLists.txt |  4 +-
 tests/c_unittests/CMakeLists.txt |  2 +-
 3 files changed, 54 insertions(+), 43 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 232e225..d8d4d0a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,11 +20,46 @@
 cmake_minimum_required(VERSION 2.8.12)
 project(qpid-dispatch C CXX)
 
+# This effectively checks for cmake version 3.1 or later
+if (DEFINED CMAKE_C_COMPILE_FEATURES)
+set(CMAKE_C_STANDARD 11)
+set(CMAKE_C_STANDARD_REQUIRED ON)
+set(CMAKE_C_EXTENSIONS ON) # gnu11
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+else()
+set(C_STANDARD_GNU "-std=gnu11")
+set(C_STANDARD_Clang "-std=gnu11")
+set(C_STANDARD_SunPro "-std=c11")
+
+set(C_STANDARD_FLAGS ${C_STANDARD_${CMAKE_C_COMPILER_ID}})
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_STANDARD_FLAGS}")
+
+set(CXX_STANDARD_FLAGS "-std=c++11")
+endif()
+
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
 set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
 set(CMAKE_MACOSX_RPATH TRUE)
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=1850174 GCC 4.8 claims to 
support atomics, but it's missing stdatomic.h
+include(CheckIncludeFile)
+check_include_file("stdatomic.h" HAVE_STDATOMIC_H)
+if (NOT HAVE_STDATOMIC_H)
+add_definitions(-D__STDC_NO_ATOMICS__)
+endif()
+
+# Set warning compile flags
+set(C_WARNING_GNU -Wall -Wextra -Werror -Wpedantic -pedantic-errors 
-Wno-empty-body -Wno-implicit-fallthrough -Wno-unused-parameter 
-Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-sign-compare 
-Wno-type-limits)
+set(C_WARNING_Clang -Wall -Wextra -Werror -Wpedantic -Wno-unused-parameter 
-Wno-ignored-qualifiers -Wno-missing-field-initializers -Wno-sign-compare 
-Wno-gnu-statement-expression)
+set(C_WARNING_SunPro -errwarn=%all)
+
+set(C_WARNING_FLAGS ${C_WARNING_${CMAKE_C_COMPILER_ID}})
+add_compile_options(${C_WARNING_FLAGS})
+
 # Set default build type. Must use FORCE because project() sets default to ""
 if (NOT CMAKE_BUILD_TYPE)
   set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
@@ -90,7 +125,7 @@ CMAKE_DEPENDENT_OPTION(USE_LIBWEBSOCKETS "Use libwebsockets 
for WebSocket suppor
 set(SKIP_DELETE_HTTP_LISTENER "True")
 if (LIBWEBSOCKETS_FOUND AND LIBWEBSOCKETS_VERSION_STRING)
   # This is a fix for DISPATCH-1513. libwebsockets versions 3.2.0 introduces a 
new flag called LWS_SERVER_OPTION_ALLOW_HTTP_ON_HTTPS_LISTENER
-  # The new flag allows (as the flag says) HTTP pver HTTPS listeners. Since 
this flag is not available before lws 3.2.0 we need
+  # The new flag allows (as the flag says) HTTP over HTTPS listeners. Since 
this flag is not available before lws 3.2.0 we need
   # to selectively comment out a test.
   set(TEST_OPTION_ALLOW_HTTP_ON_HTTPS_LISTENER "#")
   set(LWS_VERSION_WITH_SSL_FIX "3.2.0")
@@ -161,12 +196,6 @@ endif()
 
 set(QPID_DISPATCH_CONFDIR ${SYSCONF_INSTALL_DIR}/qpid-dispatch)
 
-if (NOT COMMAND add_compile_options)
-  macro (add_compile_options option)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${option}")
-  endmacro (add_compile_options)
-endif (NOT COMMAND add_compile_options)
-
 # Set up runtime checks (valgrind, sanitizers etc.)
 include(cmake/RuntimeChecks.cmake)
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SANITIZE_FLAGS}")
@@ -208,38 +237,22 @@ if(QD_ENABLE_ASSERTIONS)
 endif()
 endif()
 
-if (NOT CMAKE_SYSTEM_NAME STREQUAL SunOS)
- add_compile_options(-Werror)
- add_compile_options(-Wall)
- include(CheckCCompilerFlag)
- check_c_compiler_flag(-Wpedantic HAS_PEDANTIC_FLAG)
- if (HAS_PEDANTIC_FLAG)
-add_compile_options(-Wpedantic)
- endif(HAS_PEDANTIC_FLAG)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
- if (CMAKE_BUILD_TYPE MATCHES "Coverage")
-   set (CMAKE_C_FLAGS_COVERAGE "-g -O0 --coverage")
-   set (CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage")
-   set (CMAKE_MODULE_LINKER_FLAGS_COVERAGE "--coverage")
-   set (CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage")
-   mark_as_advanced(
- CMAKE_C_FLAGS_COVERAGE
- CMAKE_EXE_LINKER_FLAGS_COVERAGE
- CMAKE_MODULE_LINKER_FLAGS_COVERAGE
- CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
-   make_directory(${CMAKE_BINARY_DIR}/coverage_results)
-   add_custom_target(coverage
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/coverage_results
- COMMAND 

[qpid-proton] branch main updated (22ff802 -> 69339de)

2021-04-02 Thread cliffjansen
This is an automated email from the ASF dual-hosted git repository.

cliffjansen pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git.


from 22ff802  PROTON-2354: Better fix for some 'macOS' test failures
 add 69339de  PROTON-2344: fix Python BlockingConnection resource leaks, 
memory and socket fds

No new revisions were added by this update.

Summary of changes:
 python/proton/_utils.py | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-proton] 01/01: PROTON-2344: fix Python BlockingConnection resource leaks, memory and socket fds

2021-04-02 Thread cliffjansen
This is an automated email from the ASF dual-hosted git repository.

cliffjansen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 69339dedbb2ec8d6f934e7de08d021e525312c03
Author: Cliff Jansen 
AuthorDate: Fri Apr 2 11:46:39 2021 -0700

PROTON-2344: fix Python BlockingConnection resource leaks, memory and 
socket fds
---
 python/proton/_utils.py | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/python/proton/_utils.py b/python/proton/_utils.py
index 52bdfc2..275f12b 100644
--- a/python/proton/_utils.py
+++ b/python/proton/_utils.py
@@ -440,12 +440,16 @@ class BlockingConnection(Handler):
 self.conn.close()
 self.wait(lambda: not (self.conn.state & 
Endpoint.REMOTE_ACTIVE),
   msg="Closing connection")
+if self.conn.transport:
+# Close tail to force transport cleanup without 
waiting/hanging for peer close frame.
+self.conn.transport.close_tail()
 finally:
 self.conn.free()
 # Nothing left to block on.  Allow reactor to clean up.
 self.run()
-self.conn = None
-self.container.global_handler = None  # break circular ref: 
container to cadapter.on_error
+if self.conn:
+self.conn.handler = None  # break cyclical reference
+self.conn = None
 self.container.stop_events()
 self.container = None
 
@@ -502,9 +506,6 @@ class BlockingConnection(Handler):
 raise Timeout(txt)
 finally:
 self.container.timeout = container_timeout
-if self.disconnected or self._is_closed():
-self.container.stop()
-self.conn.handler = None  # break cyclical reference
 if self.disconnected and not self._is_closed():
 raise ConnectionException(
 "Connection %s disconnected: %s" % (self.url, 
self.disconnected))
@@ -534,7 +535,8 @@ class BlockingConnection(Handler):
 self.on_transport_closed(event)
 
 def on_transport_closed(self, event):
-self.disconnected = event.transport.condition or "unknown"
+if not self.closing:
+self.disconnected = event.transport.condition or "unknown"
 
 
 class AtomicCount(object):

-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-proton] branch master created (now 69339de)

2021-04-02 Thread cliffjansen
This is an automated email from the ASF dual-hosted git repository.

cliffjansen pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git.


  at 69339de  PROTON-2344: fix Python BlockingConnection resource leaks, 
memory and socket fds

This branch includes the following new commits:

 new 69339de  PROTON-2344: fix Python BlockingConnection resource leaks, 
memory and socket fds

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org