Debian Codegraph @

tools/list_installed_dll_dependencies_cygwin.sh

raw
1 #!/bin/dash
2 # Check permissions and dependencies on installed DLLs
3 # DLLs need execute permissions to be used
4 # DLLs must be able to find their dependencies
5 # This checks both of those, then does a direct test
6 # The best way of checking whether a C extension module is importable
7 # is trying to import it. The rest is trying to give reasons why it
8 # isn't importing.
9 #
10 # One of the tools and the extension for shared libraries are
11 # Cygwin-specific, but the rest should work on most platforms with
12 # /bin/sh
13
14 py_ver=${1}
15 dll_list=`/bin/dash tools/list_numpy_dlls.sh ${py_ver}`
16 echo "Checks for existence, permissions and file type"
17 /usr/bin/timeout 10m /usr/bin/ls -l ${dll_list}
18 /usr/bin/timeout 10m /usr/bin/file ${dll_list}
19 echo "Dependency checks"
20 /usr/bin/timeout 10m /usr/bin/ldd ${dll_list} | grep -F -e " => not found" && exit 1
21 /usr/bin/timeout 10m /usr/bin/cygcheck ${dll_list} >cygcheck_dll_list 2>cygcheck_missing_deps
22 grep -F -e "cygcheck: track_down: could not find " cygcheck_missing_deps && exit 1
23 echo "Import tests"
24 mkdir -p dist/
25 cd dist/
26 for name in ${dll_list};
27 do
28 echo ${name}
29 ext_module=`echo ${name} | \
30 sed -E \
31 -e "s/^\/+(home|usr).*?site-packages\/+//" \
32 -e "s/.cpython-3.m?-x86(_64)?-cygwin.dll$//" \
33 -e "s/\//./g"`
34 /usr/bin/timeout 2m /usr/bin/python${py_ver} -c "import ${ext_module}"
35 done