Skip to content

Commit

Permalink
Don't accidentally link the system's libcrypto.a (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm authored Mar 13, 2023
1 parent eaedfc1 commit 238d386
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,11 @@ def run(self):
else:
print("Skip building dependencies, source not found.")

# update paths so awscrt_ext can access dependencies
self.include_dirs.append(os.path.join(dep_install_path, 'include'))
# update paths so awscrt_ext can access dependencies.
# add to the front of any list so that our dependencies are preferred
# over anything that might already be on the system (i.e. libcrypto.a)

self.include_dirs.insert(0, os.path.join(dep_install_path, 'include'))

# some platforms (ex: fedora) use /lib64 instead of just /lib
lib_dir = 'lib'
Expand All @@ -266,7 +269,7 @@ def run(self):
if is_32bit() and os.path.exists(os.path.join(dep_install_path, 'lib32')):
lib_dir = 'lib32'

self.library_dirs.append(os.path.join(dep_install_path, lib_dir))
self.library_dirs.insert(0, os.path.join(dep_install_path, lib_dir))

# continue with normal build_ext.run()
super().run()
Expand Down

0 comments on commit 238d386

Please sign in to comment.