You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2019/11/05 04:29:42 UTC
[qpid-proton] 01/02: PROTON-2126: Fix Python package building on
windows - Due to a bug in the combination of CMake and MSbuild failing to
detect cyrus-sasl on windows in the python setup.py was failing the windows
build during 'python setup.py bdist_wheel'
This is an automated email from the ASF dual-hosted git repository.
astitcher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
commit 4a69c9ce2653ece427182f83c113091924eec9a2
Author: Jiří Daněk <jd...@redhat.com>
AuthorDate: Fri Nov 1 17:14:13 2019 -0400
PROTON-2126: Fix Python package building on windows
- Due to a bug in the combination of CMake and MSbuild failing
to detect cyrus-sasl on windows in the python setup.py was failing
the windows build during 'python setup.py bdist_wheel'
---
python/setup.py.in | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/python/setup.py.in b/python/setup.py.in
index c5e1bbb..8d0445c 100644
--- a/python/setup.py.in
+++ b/python/setup.py.in
@@ -159,13 +159,21 @@ class Configure(build_ext):
# implementations will be used.
sources.append(os.path.join(proton_src, 'sasl', 'sasl.c'))
sources.append(os.path.join(proton_src, 'sasl', 'default_sasl.c'))
- if cc.has_function('sasl_client_done', includes=['sasl/sasl.h'],
- libraries=['sasl2']):
- libraries.append('sasl2')
- sources.append(os.path.join(proton_src, 'sasl', 'cyrus_sasl.c'))
+
+ # Skip the SASL detection on Windows.
+ # MSbuild scans output of Exec tasks and fails the build if it notices error-like
+ # strings there. This is a known issue with CMake and msbuild, see
+ # * https://github.com/Microsoft/msbuild/issues/2424
+ # * https://cmake.org/pipermail/cmake-developers/2015-October/026775.html
+ if cc.compiler_type!='msvc':
+ if cc.has_function('sasl_client_done', includes=['sasl/sasl.h'], libraries=['sasl2']):
+ libraries.append('sasl2')
+ sources.append(os.path.join(proton_src, 'sasl', 'cyrus_sasl.c'))
+ else:
+ log.warn("Cyrus SASL not installed - only the ANONYMOUS and PLAIN mechanisms will be supported!")
+ sources.append(os.path.join(proton_src, 'sasl', 'cyrus_stub.c'))
else:
- log.warn("Cyrus SASL not installed - only the ANONYMOUS and"
- " PLAIN mechanisms will be supported!")
+ log.warn("Windows - only the ANONYMOUS and PLAIN mechanisms will be supported!")
sources.append(os.path.join(proton_src, 'sasl', 'cyrus_stub.c'))
# Hack for Windows/msvc: We need to compile proton as C++, but it seems the only way to
@@ -175,9 +183,10 @@ class Configure(build_ext):
targets = []
target_base = os.path.join(self.build_temp, 'srcs')
try:
- os.mkdir(target_base)
- except FileExistsError:
- pass
+ # Might need to make intermediate directories use os.makedirs() not os.mkdir()
+ os.makedirs(target_base)
+ except OSError:
+ pass
for f in sources:
# We know each file ends in '.c' as we filtered on that above so just add 'pp' to end
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org