1 This patch ensures that 64-bit shared objects are in a subdirectory named |
1 This patch ensures that 64-bit shared objects are put in and found in a |
2 "64". Note that changes to the Lib/distutils/tests/test_build.py and |
2 subdirectory named "64". Note that the changes to the |
3 Lib/distutils/tests/test_install.py avoid running tests that fail due to |
3 Lib/distutils/tests/test_build_ext.py and .../test_sysconfig.py avoid running |
4 this patch. As this is Solaris-specific, it is not suitable for upstream. |
4 tests that fail due to this patch. As the patch is Solaris-specific, it is |
|
5 not suitable for upstream. |
5 |
6 |
6 --- Python-3.4.0/Lib/distutils/command/build_ext.py.~1~ 2014-03-16 19:31:29.000000000 -0700 |
7 --- Python-3.4.1/Lib/distutils/command/build_ext.py.~1~ 2014-05-18 22:19:37.000000000 -0700 |
7 +++ Python-3.4.0/Lib/distutils/command/build_ext.py 2014-03-17 13:18:10.057787061 -0700 |
8 +++ Python-3.4.1/Lib/distutils/command/build_ext.py 2014-08-05 16:07:07.494400637 -0700 |
8 @@ -668,7 +668,12 @@ |
9 @@ -668,6 +668,9 @@ |
9 ext_suffix = get_config_var('EXT_SUFFIX') |
10 ext_suffix = get_config_var('EXT_SUFFIX') |
10 if os.name == 'nt' and self.debug: |
11 if os.name == 'nt' and self.debug: |
11 return os.path.join(*ext_path) + '_d' + ext_suffix |
12 return os.path.join(*ext_path) + '_d' + ext_suffix |
12 - return os.path.join(*ext_path) + ext_suffix |
13 + if sys.maxsize == 2 ** 31 - 1: |
13 + #return os.path.join(*ext_path) + ext_suffix |
|
14 + path = os.path.join (ext_path) |
|
15 + if sys.maxsize == 2147483647: |
|
16 + return os.path.join(*ext_path) + ext_suffix |
14 + return os.path.join(*ext_path) + ext_suffix |
17 + (dirname, basename) = os.path.split(os.path.join(*ext_path)); |
15 + ext_path[-1:-1] = ["64"] |
18 + return os.path.join(dirname, "64", basename + ext_suffix) |
16 return os.path.join(*ext_path) + ext_suffix |
19 |
17 |
20 def get_export_symbols(self, ext): |
18 def get_export_symbols(self, ext): |
21 """Return the list of symbols that a shared extension has to |
19 --- Python-3.4.1/Lib/distutils/tests/test_build_ext.py.~1~ 2014-05-18 22:19:38.000000000 -0700 |
22 --- Python-3.4.0/Lib/distutils/tests/test_build_ext.py.~1~ 2014-03-16 19:31:29.000000000 -0700 |
20 +++ Python-3.4.1/Lib/distutils/tests/test_build_ext.py 2014-08-05 15:28:29.067709834 -0700 |
23 +++ Python-3.4.0/Lib/distutils/tests/test_build_ext.py 2014-03-17 13:18:10.098081226 -0700 |
21 @@ -317,7 +317,8 @@ |
24 @@ -317,7 +317,7 @@ |
|
25 ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') |
22 ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') |
26 self.assertTrue(so_file.endswith(ext_suffix)) |
23 self.assertTrue(so_file.endswith(ext_suffix)) |
27 so_dir = os.path.dirname(so_file) |
24 so_dir = os.path.dirname(so_file) |
28 - self.assertEqual(so_dir, other_tmp_dir) |
25 - self.assertEqual(so_dir, other_tmp_dir) |
29 + #self.assertEqual(so_dir, other_tmp_dir) |
26 + if sys.platform != 'sunos5': |
|
27 + self.assertEqual(so_dir, other_tmp_dir) |
30 |
28 |
31 cmd.inplace = 0 |
29 cmd.inplace = 0 |
32 cmd.compiler = None |
30 cmd.compiler = None |
33 @@ -364,7 +364,7 @@ |
31 @@ -326,7 +327,8 @@ |
|
32 self.assertTrue(os.path.exists(so_file)) |
|
33 self.assertTrue(so_file.endswith(ext_suffix)) |
|
34 so_dir = os.path.dirname(so_file) |
|
35 - self.assertEqual(so_dir, cmd.build_lib) |
|
36 + if sys.platform != 'sunos5': |
|
37 + self.assertEqual(so_dir, cmd.build_lib) |
|
38 |
|
39 # inplace = 0, cmd.package = 'bar' |
|
40 build_py = cmd.get_finalized_command('build_py') |
|
41 @@ -334,7 +336,8 @@ |
|
42 path = cmd.get_ext_fullpath('foo') |
|
43 # checking that the last directory is the build_dir |
|
44 path = os.path.split(path)[0] |
|
45 - self.assertEqual(path, cmd.build_lib) |
|
46 + if sys.platform != 'sunos5': |
|
47 + self.assertEqual(path, cmd.build_lib) |
|
48 |
|
49 # inplace = 1, cmd.package = 'bar' |
|
50 cmd.inplace = 1 |
|
51 @@ -348,7 +351,8 @@ |
|
52 # checking that the last directory is bar |
|
53 path = os.path.split(path)[0] |
|
54 lastdir = os.path.split(path)[-1] |
|
55 - self.assertEqual(lastdir, 'bar') |
|
56 + if sys.platform != 'sunos5': |
|
57 + self.assertEqual(lastdir, 'bar') |
|
58 |
|
59 def test_ext_fullpath(self): |
|
60 ext = sysconfig.get_config_var('EXT_SUFFIX') |
|
61 @@ -364,14 +368,16 @@ |
34 curdir = os.getcwd() |
62 curdir = os.getcwd() |
35 wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext) |
63 wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext) |
36 path = cmd.get_ext_fullpath('lxml.etree') |
64 path = cmd.get_ext_fullpath('lxml.etree') |
37 - self.assertEqual(wanted, path) |
65 - self.assertEqual(wanted, path) |
38 + #self.assertEqual(wanted, path) |
66 + if sys.platform != 'sunos5': |
|
67 + self.assertEqual(wanted, path) |
39 |
68 |
40 # building lxml.etree not inplace |
69 # building lxml.etree not inplace |
41 cmd.inplace = 0 |
70 cmd.inplace = 0 |
|
71 cmd.build_lib = os.path.join(curdir, 'tmpdir') |
|
72 wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + ext) |
|
73 path = cmd.get_ext_fullpath('lxml.etree') |
|
74 - self.assertEqual(wanted, path) |
|
75 + if sys.platform != 'sunos5': |
|
76 + self.assertEqual(wanted, path) |
|
77 |
|
78 # building twisted.runner.portmap not inplace |
|
79 build_py = cmd.get_finalized_command('build_py') |
|
80 @@ -380,13 +386,15 @@ |
|
81 path = cmd.get_ext_fullpath('twisted.runner.portmap') |
|
82 wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner', |
|
83 'portmap' + ext) |
|
84 - self.assertEqual(wanted, path) |
|
85 + if sys.platform != 'sunos5': |
|
86 + self.assertEqual(wanted, path) |
|
87 |
|
88 # building twisted.runner.portmap inplace |
|
89 cmd.inplace = 1 |
|
90 path = cmd.get_ext_fullpath('twisted.runner.portmap') |
|
91 wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext) |
|
92 - self.assertEqual(wanted, path) |
|
93 + if sys.platform != 'sunos5': |
|
94 + self.assertEqual(wanted, path) |
|
95 |
|
96 |
|
97 @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX') |
|
98 --- Python-3.4.1/Lib/distutils/tests/test_sysconfig.py.~1~ 2014-05-18 22:19:38.000000000 -0700 |
|
99 +++ Python-3.4.1/Lib/distutils/tests/test_sysconfig.py 2014-08-05 13:11:56.906745265 -0700 |
|
100 @@ -1,4 +1,5 @@ |
|
101 """Tests for distutils.sysconfig.""" |
|
102 +import sys |
|
103 import os |
|
104 import shutil |
|
105 import unittest |
|
106 @@ -124,6 +125,8 @@ |
|
107 |
|
108 def test_sysconfig_module(self): |
|
109 import sysconfig as global_sysconfig |
|
110 + if sys.platform == 'sunos5': |
|
111 + return |
|
112 self.assertEqual(global_sysconfig.get_config_var('CFLAGS'), |
|
113 sysconfig.get_config_var('CFLAGS')) |
|
114 self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'), |
|
115 @@ -149,8 +152,9 @@ |
|
116 import sysconfig as global_sysconfig |
|
117 if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'): |
|
118 self.skipTest('compiler flags customized') |
|
119 - self.assertEqual(global_sysconfig.get_config_var('LDSHARED'), |
|
120 - sysconfig.get_config_var('LDSHARED')) |
|
121 + if sys.platform != 'sunos5': |
|
122 + self.assertEqual(global_sysconfig.get_config_var('LDSHARED'), |
|
123 + sysconfig.get_config_var('LDSHARED')) |
|
124 self.assertEqual(global_sysconfig.get_config_var('CC'), |
|
125 sysconfig.get_config_var('CC')) |
|
126 |
|
127 --- Python-3.4.1/Lib/importlib/_bootstrap.py.~1~ 2014-05-18 22:19:38.000000000 -0700 |
|
128 +++ Python-3.4.1/Lib/importlib/_bootstrap.py 2014-08-06 08:37:18.145242823 -0700 |
|
129 @@ -2046,6 +2046,15 @@ |
|
130 is_namespace = _path_isdir(base_path) |
|
131 # Check for a file w/ a proper suffix exists. |
|
132 for suffix, loader_class in self._loaders: |
|
133 + message = 'checking {!r}: {!r}'.format(self.path, suffix) |
|
134 + _verbose_message(message, verbosity=2) |
|
135 + # If in 64-bit mode, append /64 to the path. |
|
136 + if suffix == '.so' and sys.maxsize != 2 ** 31 - 1: |
|
137 + full_path = _path_join(self.path, '64', tail_module + suffix) |
|
138 + _verbose_message('trying {}'.format(full_path), verbosity=2) |
|
139 + if _path_isfile(full_path): |
|
140 + self.path += '/64' |
|
141 + return self._get_spec(loader_class, fullname, full_path, None, target) |
|
142 full_path = _path_join(self.path, tail_module + suffix) |
|
143 _verbose_message('trying {}'.format(full_path), verbosity=2) |
|
144 if cache_module + suffix in cache: |
42 --- Python-3.4.0/Lib/sysconfig.py.~1~ 2014-03-16 19:31:30.000000000 -0700 |
145 --- Python-3.4.0/Lib/sysconfig.py.~1~ 2014-03-16 19:31:30.000000000 -0700 |
43 +++ Python-3.4.0/Lib/sysconfig.py 2014-03-17 13:18:10.099539252 -0700 |
146 +++ Python-3.4.0/Lib/sysconfig.py 2014-03-17 13:18:10.099539252 -0700 |
44 @@ -392,7 +392,11 @@ |
147 @@ -392,7 +392,11 @@ |
45 if hasattr(sys, "gettotalrefcount"): |
148 if hasattr(sys, "gettotalrefcount"): |
46 pybuilddir += '-pydebug' |
149 pybuilddir += '-pydebug' |
65 + } |
168 + } |
66 + |
169 + |
67 /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ |
170 /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ |
68 |
171 |
69 if ((!pfound || !efound) && !Py_FrozenFlag) |
172 if ((!pfound || !efound) && !Py_FrozenFlag) |
70 @@ -710,8 +714,30 @@ |
|
71 if (_rtpypath && _rtpypath[0] != '\0') { |
|
72 size_t rtpypath_len; |
|
73 rtpypath = _Py_char2wchar(_rtpypath, &rtpypath_len); |
|
74 - if (rtpypath != NULL) |
|
75 - bufsz += rtpypath_len + 1; |
|
76 + if (rtpypath != NULL) { |
|
77 + wchar_t *orig_rtpypath = rtpypath; |
|
78 + |
|
79 + /* |
|
80 + * Split the path; for each component, add that component + "/64" |
|
81 + * (if in 64-bit mode) and the component unadorned (regardless). |
|
82 + */ |
|
83 + while (1) { |
|
84 + wchar_t *delim = wcschr(rtpypath, DELIM); |
|
85 + if (delim) { |
|
86 + /* once for usual, another for usual + "/64" */ |
|
87 + bufsz += delim - rtpypath + 1; |
|
88 + if (sizeof(void *) == 8) |
|
89 + bufsz += delim - rtpypath + 1 + 3; |
|
90 + } else { |
|
91 + bufsz += wcslen(rtpypath) + 1; |
|
92 + if (sizeof(void *) == 8) |
|
93 + bufsz += wcslen(rtpypath) + 1 + 3; |
|
94 + break; |
|
95 + } |
|
96 + rtpypath = delim + 1; |
|
97 + } |
|
98 + rtpypath = orig_rtpypath; |
|
99 + } |
|
100 } |
|
101 |
|
102 defpath = _pythonpath; |
|
103 @@ -723,9 +749,19 @@ |
|
104 /* Paths are relative to prefix */ |
|
105 bufsz += prefixsz; |
|
106 |
|
107 - if (delim) |
|
108 + if (delim) { |
|
109 + if (sizeof(void *) == 8) { |
|
110 + bufsz += delim - defpath + 1 + 3; |
|
111 + if (defpath[0] != SEP) |
|
112 + bufsz += prefixsz; |
|
113 + } |
|
114 bufsz += delim - defpath + 1; |
|
115 - else { |
|
116 + } else { |
|
117 + if (sizeof(void *) == 8) { |
|
118 + bufsz += wcslen(defpath) + 1 + 3; |
|
119 + if (defpath[0] != SEP) |
|
120 + bufsz += prefixsz; |
|
121 + } |
|
122 bufsz += wcslen(defpath) + 1; |
|
123 break; |
|
124 } |
|
125 @@ -741,13 +777,38 @@ |
|
126 "Not enough memory for dynamic PYTHONPATH"); |
|
127 } |
|
128 |
|
129 + buf[0] = '\0'; |
|
130 /* Run-time value of $PYTHONPATH goes first */ |
|
131 if (rtpypath) { |
|
132 - wcscpy(buf, rtpypath); |
|
133 - wcscat(buf, delimiter); |
|
134 + wchar_t *orig_rtpypath = rtpypath; |
|
135 + |
|
136 + while (1) { |
|
137 + wchar_t *delim = wcschr(rtpypath, DELIM); |
|
138 + |
|
139 + if (delim) { |
|
140 + *delim = '\0'; |
|
141 + if (sizeof(void *) == 8) { |
|
142 + wcscat(buf, rtpypath); |
|
143 + wcscat(buf, L"/64"); |
|
144 + wcscat(buf, delimiter); |
|
145 + } |
|
146 + wcscat(buf, rtpypath); |
|
147 + wcscat(buf, delimiter); |
|
148 + *delim = DELIM; |
|
149 + } else { |
|
150 + if (sizeof(void *) == 8) { |
|
151 + wcscat(buf, rtpypath); |
|
152 + wcscat(buf, L"/64"); |
|
153 + wcscat(buf, delimiter); |
|
154 + } |
|
155 + wcscat(buf, rtpypath); |
|
156 + wcscat(buf, delimiter); |
|
157 + break; |
|
158 + } |
|
159 + rtpypath = delim + 1; |
|
160 + } |
|
161 + rtpypath = orig_rtpypath; |
|
162 } |
|
163 - else |
|
164 - buf[0] = '\0'; |
|
165 |
|
166 /* Next is the default zip path */ |
|
167 wcscat(buf, zip_path); |
|
168 @@ -766,18 +827,35 @@ |
|
169 } |
|
170 |
|
171 if (delim) { |
|
172 - size_t len = delim - defpath + 1; |
|
173 - size_t end = wcslen(buf) + len; |
|
174 - wcsncat(buf, defpath, len); |
|
175 - *(buf + end) = '\0'; |
|
176 - } |
|
177 - else { |
|
178 + *delim = '\0'; |
|
179 + if (sizeof(void *) == 8) { |
|
180 + wcscat(buf, defpath); |
|
181 + wcscat(buf, L"/64"); |
|
182 + wcscat(buf, delimiter); |
|
183 + if (defpath[0] != SEP) { |
|
184 + wcscat(buf, prefix); |
|
185 + wcscat(buf, separator); |
|
186 + } |
|
187 + } |
|
188 wcscat(buf, defpath); |
|
189 + wcscat(buf, delimiter); |
|
190 + *delim = DELIM; |
|
191 + } else { |
|
192 + if (sizeof(void *) == 8) { |
|
193 + wcscat(buf, defpath); |
|
194 + wcscat(buf, L"/64"); |
|
195 + wcscat(buf, delimiter); |
|
196 + if (defpath[0] != SEP) { |
|
197 + wcscat(buf, prefix); |
|
198 + wcscat(buf, separator); |
|
199 + } |
|
200 + } |
|
201 + wcscat(buf, defpath); |
|
202 + wcscat(buf, delimiter); |
|
203 break; |
|
204 } |
|
205 defpath = delim + 1; |
|
206 } |
|
207 - wcscat(buf, delimiter); |
|
208 |
|
209 /* Finally, on goes the directory for dynamic-load modules */ |
|
210 wcscat(buf, exec_prefix); |
|