Skip to content

Commit 9f702ca

Browse files
committed
BUG29181907: Remove libssl.so shared object in _mysqlxpb.so
1 parent 3a53205 commit 9f702ca

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/cpy_distutils.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,9 @@ def finalize_options(self):
567567
print("# Python ARCH_64BIT: {0}".format(ARCH_64BIT))
568568

569569
if self.with_mysql_capi:
570-
if os.name != "nt":
570+
if os.name == "posix":
571571
self.mysql_info = mysql_c_api_info(self.with_mysql_capi)
572-
self._copy_vendor_libraries()
572+
self._copy_vendor_libraries()
573573
self._finalize_connector_c(self.with_mysql_capi)
574574

575575
if not self.with_protobuf_include_dir:
@@ -671,7 +671,7 @@ def fix_compiler(self):
671671
if self.extra_compile_args:
672672
ext.extra_compile_args.extend(self.extra_compile_args.split())
673673
# Add extra link args
674-
if self.extra_link_args:
674+
if self.extra_link_args and ext.name == "_mysql_connector":
675675
ext.extra_link_args.extend(self.extra_link_args.split())
676676
# Add -rpath if the platform is Linux and cext is _mysql_connector
677677
if platform.system() == "Linux" and ext.name == "_mysql_connector":
@@ -727,7 +727,7 @@ def run(self):
727727
if self.extra_compile_args:
728728
ext.extra_compile_args.extend(self.extra_compile_args.split())
729729
# Add extra link args
730-
if self.extra_link_args and ext.name != "_mysqlxpb":
730+
if self.extra_link_args and ext.name == "_mysql_connector":
731731
ext.extra_link_args.extend(self.extra_link_args.split())
732732
if self.with_mysqlxpb_cext:
733733
self.run_protoc()
@@ -780,6 +780,10 @@ class BuildExtStatic(BuildExtDynamic):
780780
user_options = build_ext.user_options + CEXT_OPTIONS
781781

782782
def finalize_options(self):
783+
if self.with_mysql_capi and os.name == "posix":
784+
self.mysql_info = mysql_c_api_info(self.with_mysql_capi)
785+
self._copy_vendor_libraries()
786+
783787
install_obj = self.distribution.get_command_obj('install')
784788
install_obj.with_mysql_capi = self.with_mysql_capi
785789
install_obj.with_protobuf_include_dir = self.with_protobuf_include_dir
@@ -821,9 +825,6 @@ def finalize_options(self):
821825
self.with_protobuf_lib_dir,
822826
self.with_protoc))
823827
if self.with_mysql_capi:
824-
if os.name != "nt":
825-
self.mysql_info = mysql_c_api_info(self.with_mysql_capi)
826-
self._copy_vendor_libraries()
827828
self._finalize_connector_c(self.with_mysql_capi)
828829

829830
if self.with_mysqlxpb_cext:
@@ -959,7 +960,7 @@ def fix_compiler(self):
959960
if self.extra_compile_args:
960961
ext.extra_compile_args.extend(self.extra_compile_args.split())
961962
# Add extra link args
962-
if self.extra_link_args and ext.name != "_mysqlxpb":
963+
if self.extra_link_args and ext.name == "_mysql_connector":
963964
ext.extra_link_args.extend(self.extra_link_args.split())
964965

965966

0 commit comments

Comments
 (0)