Skip to content

Commit

Permalink
ci: Check DLLs against /mingw64/bin instead of C:\Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson committed May 1, 2020
1 parent 2fe8618 commit 5bf7bc2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions get_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ def main():
sout = subprocess.check_output(['ldd', args.prog]).decode('utf-8')
for line in sout.splitlines():
line = line.strip().split()
dll_name, dll_path, dll_load_addr = line[0], line[2], line[3]
dll_name, original_dll_path, dll_load_addr = line[0], line[2], line[3]
if dll_name.startswith('???'):
print('Unknown DLL?')
continue

# ldd on msys gives Unix-style paths, but mingw Python wants them Windows-style
# Use cygpath to convert the paths, because both mingw and msys Python can handle them
# Force lookup against /mingw64/bin to avoid external DLLs
dll_path = '/mingw64/bin/' + dll_name
dll_path = subprocess.check_output(['cygpath', '-w', dll_path]).decode('utf-8').strip()
if dll_path.lower().startswith('c:\\windows'):
print('Skipping system DLL %s' % dll_path)
if not os.path.exists(dll_path):
print('Skipping DLL outside /mingw64/bin: %s' % original_dll_path)
continue

dest_path = os.path.join(args.dest, dll_name)
Expand Down

0 comments on commit 5bf7bc2

Please sign in to comment.