components/python/python34/patches/06-solaris-64-bit.patch
author John Beck <John.Beck@Oracle.COM>
Mon, 27 Apr 2015 14:08:52 -0700
changeset 4209 107a604ac200
parent 2183 5d00686e81da
child 4776 b00579b61ffc
permissions -rw-r--r--
20917217 imp.find_module() in python3.4 can't find native modules
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
     1
This patch ensures that 64-bit shared objects are put in and found in a
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
     2
subdirectory named "64".  Note that the changes to the
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
     3
Lib/distutils/tests/test_build_ext.py and .../test_sysconfig.py avoid running
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
     4
tests that fail due to this patch.  As the patch is Solaris-specific, it is
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
     5
not suitable for upstream.
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     6
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
     7
--- Python-3.4.2/Lib/distutils/command/build_ext.py.~1~	2014-09-22 05:56:59.000000000 -0700
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
     8
+++ Python-3.4.2/Lib/distutils/command/build_ext.py	2014-09-22 14:05:09.231795935 -0700
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
     9
@@ -659,6 +659,9 @@
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    10
         ext_suffix = get_config_var('EXT_SUFFIX')
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    11
         if os.name == 'nt' and self.debug:
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    12
             return os.path.join(*ext_path) + '_d' + ext_suffix
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    13
+        if sys.maxsize == 2 ** 31 - 1:
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    14
+            return os.path.join(*ext_path) + ext_suffix
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    15
+        ext_path[-1:-1] = ["64"]
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    16
         return os.path.join(*ext_path) + ext_suffix
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    17
 
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    18
     def get_export_symbols(self, ext):
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    19
--- Python-3.4.2/Lib/distutils/tests/test_build_ext.py.~1~	2014-09-22 05:56:59.000000000 -0700
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    20
+++ Python-3.4.2/Lib/distutils/tests/test_build_ext.py	2014-09-22 14:08:54.798141164 -0700
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    21
@@ -315,7 +315,8 @@
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    22
         ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    23
         self.assertTrue(so_file.endswith(ext_suffix))
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    24
         so_dir = os.path.dirname(so_file)
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    25
-        self.assertEqual(so_dir, other_tmp_dir)
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    26
+        if sys.platform != 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    27
+            self.assertEqual(so_dir, other_tmp_dir)
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    28
 
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    29
         cmd.inplace = 0
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    30
         cmd.compiler = None
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    31
@@ -324,7 +325,8 @@
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    32
         self.assertTrue(os.path.exists(so_file))
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    33
         self.assertTrue(so_file.endswith(ext_suffix))
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    34
         so_dir = os.path.dirname(so_file)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    35
-        self.assertEqual(so_dir, cmd.build_lib)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    36
+        if sys.platform != 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    37
+            self.assertEqual(so_dir, cmd.build_lib)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    38
 
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    39
         # inplace = 0, cmd.package = 'bar'
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    40
         build_py = cmd.get_finalized_command('build_py')
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    41
@@ -332,7 +334,8 @@
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    42
         path = cmd.get_ext_fullpath('foo')
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    43
         # checking that the last directory is the build_dir
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    44
         path = os.path.split(path)[0]
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    45
-        self.assertEqual(path, cmd.build_lib)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    46
+        if sys.platform != 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    47
+            self.assertEqual(path, cmd.build_lib)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    48
 
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    49
         # inplace = 1, cmd.package = 'bar'
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    50
         cmd.inplace = 1
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    51
@@ -346,7 +349,8 @@
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    52
         # checking that the last directory is bar
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    53
         path = os.path.split(path)[0]
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    54
         lastdir = os.path.split(path)[-1]
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    55
-        self.assertEqual(lastdir, 'bar')
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    56
+        if sys.platform != 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    57
+            self.assertEqual(lastdir, 'bar')
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    58
 
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    59
     def test_ext_fullpath(self):
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    60
         ext = sysconfig.get_config_var('EXT_SUFFIX')
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    61
@@ -362,14 +366,16 @@
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    62
         curdir = os.getcwd()
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    63
         wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    64
         path = cmd.get_ext_fullpath('lxml.etree')
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    65
-        self.assertEqual(wanted, path)
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    66
+        if sys.platform != 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    67
+            self.assertEqual(wanted, path)
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    68
 
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    69
         # building lxml.etree not inplace
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    70
         cmd.inplace = 0
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    71
         cmd.build_lib = os.path.join(curdir, 'tmpdir')
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    72
         wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + ext)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    73
         path = cmd.get_ext_fullpath('lxml.etree')
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    74
-        self.assertEqual(wanted, path)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    75
+        if sys.platform != 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    76
+            self.assertEqual(wanted, path)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    77
 
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    78
         # building twisted.runner.portmap not inplace
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    79
         build_py = cmd.get_finalized_command('build_py')
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    80
@@ -378,13 +384,15 @@
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    81
         path = cmd.get_ext_fullpath('twisted.runner.portmap')
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    82
         wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner',
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    83
                               'portmap' + ext)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    84
-        self.assertEqual(wanted, path)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    85
+        if sys.platform != 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    86
+            self.assertEqual(wanted, path)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    87
 
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    88
         # building twisted.runner.portmap inplace
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    89
         cmd.inplace = 1
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    90
         path = cmd.get_ext_fullpath('twisted.runner.portmap')
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    91
         wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    92
-        self.assertEqual(wanted, path)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    93
+        if sys.platform != 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    94
+            self.assertEqual(wanted, path)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    95
 
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    96
 
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
    97
     @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX')
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    98
--- Python-3.4.2/Lib/distutils/tests/test_sysconfig.py.~1~	2014-09-22 05:56:59.000000000 -0700
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
    99
+++ Python-3.4.2/Lib/distutils/tests/test_sysconfig.py	2014-09-22 14:10:18.427824361 -0700
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   100
@@ -1,4 +1,5 @@
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   101
 """Tests for distutils.sysconfig."""
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   102
+import sys
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   103
 import os
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   104
 import shutil
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
   105
 import subprocess
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
   106
@@ -127,6 +128,8 @@
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   107
 
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   108
     def test_sysconfig_module(self):
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   109
         import sysconfig as global_sysconfig
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   110
+        if sys.platform == 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   111
+            return
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   112
         self.assertEqual(global_sysconfig.get_config_var('CFLAGS'),
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   113
                          sysconfig.get_config_var('CFLAGS'))
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   114
         self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'),
2183
5d00686e81da 19782913 update Python to 3.4.2
John Beck <John.Beck@Oracle.COM>
parents: 2168
diff changeset
   115
@@ -152,8 +155,9 @@
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   116
         import sysconfig as global_sysconfig
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   117
         if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'):
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   118
             self.skipTest('compiler flags customized')
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   119
-        self.assertEqual(global_sysconfig.get_config_var('LDSHARED'),
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   120
-                         sysconfig.get_config_var('LDSHARED'))
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   121
+        if sys.platform != 'sunos5':
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   122
+            self.assertEqual(global_sysconfig.get_config_var('LDSHARED'),
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   123
+                             sysconfig.get_config_var('LDSHARED'))
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   124
         self.assertEqual(global_sysconfig.get_config_var('CC'),
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   125
                          sysconfig.get_config_var('CC'))
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   126
 
4209
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   127
--- Python-3.4.3/Lib/imp.py.~1~	2015-02-25 03:27:44.000000000 -0800
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   128
+++ Python-3.4.3/Lib/imp.py	2015-04-27 11:24:24.814046529 -0700
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   129
@@ -287,7 +287,13 @@
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   130
                 return None, package_directory, ('', '', PKG_DIRECTORY)
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   131
         for suffix, mode, type_ in get_suffixes():
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   132
             file_name = name + suffix
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   133
-            file_path = os.path.join(entry, file_name)
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   134
+            # If in 64-bit mode, append /64 to the path for .so files
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   135
+            # (if not already there).
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   136
+            if type_ == C_EXTENSION and sys.maxsize != 2**31 - 1 and \
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   137
+               entry[-3:] != '/64':
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   138
+                file_path = os.path.join(entry, "64", file_name)
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   139
+            else:
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   140
+                file_path = os.path.join(entry, file_name)
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   141
             if os.path.isfile(file_path):
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   142
                 break
107a604ac200 20917217 imp.find_module() in python3.4 can't find native modules
John Beck <John.Beck@Oracle.COM>
parents: 2183
diff changeset
   143
         else:
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   144
--- Python-3.4.1/Lib/importlib/_bootstrap.py.~1~	2014-05-18 22:19:38.000000000 -0700
2060
a9ad5cd0ec29 19492342 Python 3.4 should be built --with-pymalloc
John Beck <John.Beck@Oracle.COM>
parents: 2033
diff changeset
   145
+++ Python-3.4.1/Lib/importlib/_bootstrap.py	2014-08-27 08:46:00.145242823 -0700
2168
416ecfb814c9 19877230 importing native module causes python 3.4 to fail further imports from .py files
John Beck <John.Beck@Oracle.COM>
parents: 2060
diff changeset
   146
@@ -2046,6 +2046,14 @@
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   147
                 is_namespace = _path_isdir(base_path)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   148
         # Check for a file w/ a proper suffix exists.
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   149
         for suffix, loader_class in self._loaders:
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   150
+            message = 'checking {!r}: {!r}'.format(self.path, suffix)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   151
+            _verbose_message(message, verbosity=2)
2060
a9ad5cd0ec29 19492342 Python 3.4 should be built --with-pymalloc
John Beck <John.Beck@Oracle.COM>
parents: 2033
diff changeset
   152
+            # If in 64-bit mode, append /64 to the path for .so files.
a9ad5cd0ec29 19492342 Python 3.4 should be built --with-pymalloc
John Beck <John.Beck@Oracle.COM>
parents: 2033
diff changeset
   153
+            if suffix.endswith('.so') and sys.maxsize != 2 ** 31 - 1:
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   154
+                full_path = _path_join(self.path, '64', tail_module + suffix)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   155
+                _verbose_message('trying {}'.format(full_path), verbosity=2)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   156
+                if _path_isfile(full_path):
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   157
+                    return self._get_spec(loader_class, fullname, full_path, None, target)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   158
             full_path = _path_join(self.path, tail_module + suffix)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   159
             _verbose_message('trying {}'.format(full_path), verbosity=2)
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   160
             if cache_module + suffix in cache:
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   161
--- Python-3.4.0/Lib/sysconfig.py.~1~	2014-03-16 19:31:30.000000000 -0700
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   162
+++ Python-3.4.0/Lib/sysconfig.py	2014-03-17 13:18:10.099539252 -0700
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   163
@@ -392,7 +392,11 @@
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   164
     if hasattr(sys, "gettotalrefcount"):
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   165
         pybuilddir += '-pydebug'
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   166
     os.makedirs(pybuilddir, exist_ok=True)
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   167
-    destfile = os.path.join(pybuilddir, name + '.py')
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   168
+    if sys.maxsize == 2147483647:
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   169
+        destfile = os.path.join(pybuilddir, name + '.py')
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   170
+    else:
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   171
+        os.makedirs(pybuilddir + '/64', exist_ok=True)
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   172
+        destfile = os.path.join(pybuilddir + '/64', name + '.py')
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   173
 
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   174
     with open(destfile, 'w', encoding='utf8') as f:
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   175
         f.write('# system configuration generated and used by'
2033
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   176
--- Python-3.4.0/Modules/getpath.c.~1~ 2014-03-16 19:31:31.000000000 -0700
fe424cca0a17 19339814 Python 3.4 needs tweak to find shared objects under vendor-packages
John Beck <John.Beck@Oracle.COM>
parents: 1907
diff changeset
   177
+++ Python-3.4.0/Modules/getpath.c     2014-04-25 15:02:02.837613851 -0700
1907
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   178
@@ -697,6 +697,10 @@
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   179
         wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   180
         joinpath(exec_prefix, L"lib/lib-dynload");
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   181
     }
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   182
+    if (sizeof(void *) == 8 && wcslen(exec_prefix) + 3 <= MAXPATHLEN) {
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   183
+        wcscat(exec_prefix, L"/64");
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   184
+    }
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   185
+
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   186
     /* If we found EXEC_PREFIX do *not* reduce it!  (Yet.) */
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   187
 
446472de62e9 PSARC 2014/151 Python 3.4
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
   188
     if ((!pfound || !efound) && !Py_FrozenFlag)