8000 TST: Add cygwin build to CI by DWesl · Pull Request #18330 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TST: Add cygwin build to CI #18330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TST: Move the DLL checker to a separate script
Instead of trying to write it every run, just add it to the repository
and use that.  I'm not sure how Windows git handles line endings; I
suspect it changes things to \r\n, which is not what I want.  I'm on
Cygwin, not MSYS, so everything expects \n.
  • Loading branch information
DWesl committed Jul 20, 2021
commit 2d905c3114713da11cbead5588b1d4f9537c1750
28 changes: 1 addition & 27 deletions .github/workflows/cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,5 @@ jobs:
run: |
dash -c "/usr/bin/python3.7 -m pip show numpy"
dash -c "/usr/bin/python3.7 -m pip show -f numpy | grep .dll"
echo >list_dlls_dos.sh '#!/bin/dash
site_packages=$(python3.7 -m pip show numpy | \
grep Location | cut -d " " -f 2 -);
dll_list=$(for name in $(python3.7 -m pip show -f numpy | \
grep -F .dll); do echo ${site_packages}/${name}; done)
echo "Checks for existence, permissions and file type"
ls -l ${dll_list}
file ${dll_list}
echo "Dependency checks"
ldd ${dll_list} | grep -F -e " => not found" && exit 1
cygcheck ${dll_list} >cygcheck_dll_list 2>cygcheck_missing_deps
grep -F -e "cygcheck: track_down: could not find " cygcheck_missing_deps && exit 1
echo "Import tests"
mkdir -p dist/
cd dist/
for name in ${dll_list};
do
echo ${name}
ext_module=$(echo ${name} | \
sed -E \
-e "s/^\/+(home|usr).*?site-packages\/+//" \
-e "s/.cpython-3.m?-x86(_64)?-cygwin.dll$//" \
-e "s/\//./g")
python3.7 -c "import ${ext_module}"
done
'
dash -c "/bin/tr -d '\r' <list_dlls_dos.sh >list_dlls_unix.sh"
dash -c "/bin/tr -d '\r' <tools/list_installed_dll_dependencies_cygwin.sh >list_dlls_unix.sh"
dash "list_dlls_unix.sh"
38 changes: 38 additions & 0 deletions tools/list_installed_dll_dependencies_cygwin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/dash
# Check permissions and dependencies on installed DLLs
# DLLs need execute permissions to be used
# DLLs must be able to find their dependencies
# This checks both of those, then does a direct test
# The best way of checking whether a C extension module is importable
# is trying to import it. The rest is trying to give reasons why it
# isn't importing.
#
# One of the tools and the extension for shared libraries are
# Cygwin-specific, but the rest should work on most platforms with
# /bin/sh

py_ver=3.7
site_packages=$(python${py_ver} -m pip show numpy | \
grep Location | cut -d " " -f 2 -);
dll_list=$(for name in $(python${py_ver} -m pip show -f numpy | \
grep -F .dll); do echo ${site_packages}/${name}; done)
echo "Checks for existence, permissions and file type"
ls -l ${dll_list}
file ${dll_list}
echo "Dependency checks"
ldd ${dll_list} | grep -F -e " => not found" && exit 1
cygcheck ${dll_list} >cygcheck_dll_list 2>cygcheck_missing_deps
grep -F -e "cygcheck: track_down: could not find " cygcheck_missing_deps && exit 1
echo "Import tests"
mkdir -p dist/
cd dist/
for name in ${dll_list};
do
echo ${name}
ext_module=$(echo ${name} | \
sed -E \
-e "s/^\/+(home|usr).*?site-packages\/+//" \
-e "s/.cpython-3.m?-x86(_64)?-cygwin.dll$//" \
-e "s/\//./g")
python${py_ver} -c "import ${ext_module}"
done
0