Skip to content

Commit

Permalink
BLD: revert windows repair changes [wheel build]
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfaff committed Jun 21, 2024
1 parent a7fb234 commit 0143c4e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tools/wheels/cibw_before_build_win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ python -m pip install -r requirements/openblas.txt
python -c "import scipy_openblas32; print(scipy_openblas32.get_pkg_config())" > $PROJECT_DIR/scipy-openblas.pc

# delvewheel is the equivalent of delocate/auditwheel for windows.
python -m pip install delvewheel
python -m pip install delvewheel wheel
23 changes: 23 additions & 0 deletions tools/wheels/repair_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,27 @@ WHEEL="$1"
DEST_DIR="$2"
OPENBLAS_DIR=$(python -c"import scipy_openblas32 as sop; print(sop.get_lib_dir())")

# create a temporary directory in the destination folder and unpack the wheel
# into there
pushd $DEST_DIR
mkdir -p tmp
pushd tmp
wheel unpack $WHEEL
pushd scipy*

# To avoid DLL hell, the file name of libopenblas that's being vendored with
# the wheel has to be name-mangled. delvewheel is unable to name-mangle PYD
# containing extra data at the end of the binary, which frequently occurs when
# building with mingw.
# We therefore find each PYD in the directory structure and strip them.

for f in $(find ./scipy* -name '*.pyd'); do strip $f; done

# now repack the wheel and overwrite the original
wheel pack .
mv -fv *.whl $WHEEL

cd $DEST_DIR
rm -rf tmp

delvewheel repair --add-path $OPENBLAS_DIR --no-dll libsf_error_state.dll -w $DEST_DIR $WHEEL

0 comments on commit 0143c4e

Please sign in to comment.