summaryrefslogtreecommitdiff
path: root/package/python-pyzmq/0002-replace-compile_and_run-with-compile_and_forget.patch
blob: 278e939e0e074184ac06683683c5e6bf26590e11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
detect.py: replace compile_and_run with compile_and_forget

This function is only used in setup.py to detect the availability of
sys/un.h by compiling and running a small test program. Since we're
cross-compiling we can't run the generated program, however if the
header is missing the test will fail at the compilation step so
running the test in unnecessary.

Signed-off-by: Lionel Flandrin <lionel@svkt.org>
---
 buildutils/detect.py | 16 ++++++++--------
 setup.py             |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/buildutils/detect.py b/buildutils/detect.py
index 7a6c115..9520da7 100644
--- a/buildutils/detect.py
+++ b/buildutils/detect.py
@@ -58,7 +58,7 @@ def test_compilation(cfile, compiler=None, **compiler_attrs):
     cc.link_executable(objs, efile, extra_preargs=lpreargs)
     return efile
 
-def compile_and_run(basedir, src, compiler=None, **compiler_attrs):
+def compile_and_forget(basedir, src, compiler=None, **compiler_attrs):
     if not os.path.exists(basedir):
         os.makedirs(basedir)
     cfile = pjoin(basedir, os.path.basename(src))
@@ -66,16 +66,16 @@ def compile_and_run(basedir, src, compiler=None, **compiler_attrs):
     try:
         cc = get_compiler(compiler, **compiler_attrs)
         efile = test_compilation(cfile, compiler=cc)
-        patch_lib_paths(efile, cc.library_dirs)
-        result = Popen(efile, stdout=PIPE, stderr=PIPE)
-        so, se = result.communicate()
-        # for py3k:
-        so = so.decode()
-        se = se.decode()
+        # patch_lib_paths(efile, cc.library_dirs)
+        # result = Popen(efile, stdout=PIPE, stderr=PIPE)
+        # so, se = result.communicate()
+        # # for py3k:
+        # so = so.decode()
+        # se = se.decode()
     finally:
         shutil.rmtree(basedir)
     
-    return result.returncode, so, se
+    return None
     
     
 def detect_zmq(basedir, compiler=None, **compiler_attrs):
diff --git a/setup.py b/setup.py
index c3a2879..b8b0aaf 100755
--- a/setup.py
+++ b/setup.py
@@ -54,7 +54,7 @@ from buildutils import (
     info, warn, fatal, debug, line, copy_and_patch_libzmq, localpath,
     fetch_libzmq, stage_platform_hpp,
     bundled_version, customize_mingw,
-    compile_and_run,
+    compile_and_forget,
     patch_lib_paths,
     )
 
@@ -327,7 +327,7 @@ class Configure(build_ext):
             except Exception:
                 pass
             try:
-                compile_and_run(self.tempdir,
+                compile_and_forget(self.tempdir,
                     pjoin('buildutils', 'check_sys_un.c'),
                     **minus_zmq
                 )
-- 
2.11.0