Instead of copying, symlink to correct ABI versions

Change-Id: I0ac05266e96dd64e881f0b3e746df69432446fa2
This commit is contained in:
Uwe L. Korn committed 2017-04-02 18:52:47 +02:00
1 parent cffcca31bd
commit 5259118b5f
1 file changed
+14 -6
+14 -6
View File
@@ -17,19 +17,20 @@
# specific language governing permissions and limitations
# under the License.
import glob
import os
import os.path as osp
import re
import shutil
import sys
from Cython.Distutils import build_ext as _build_ext
import Cython
import sys
import pkg_resources
from setuptools import setup, Extension
import os
from os.path import join as pjoin
from distutils.command.clean import clean as _clean
@@ -210,10 +211,17 @@ class build_ext(_build_ext):
shared_library_suffix)
# Also copy libraries with ABI/SO version suffix
libs = glob.glob(pjoin(self.build_type, lib_filename) + '*')
for lib in libs:
# Longest suffix library should be copied, all others symlinked
libs.sort(key=lambda s: -len(s))
print(libs, libs[0])
lib_filename = os.path.basename(libs[0])
shutil.move(pjoin(self.build_type, lib_filename),
pjoin(build_lib, 'pyarrow', lib_filename))
for lib in libs[1:]:
filename = os.path.basename(lib)
shutil.move(pjoin(self.build_type, filename),
pjoin(build_lib, 'pyarrow', filename))
link_name = pjoin(build_lib, 'pyarrow', filename)
if not os.path.exists(link_name):
os.symlink(lib_filename, link_name)
if self.bundle_arrow_cpp:
move_lib("arrow")