Skip to content

Commit fca4a5e

Browse files
committed
remove out of date comments and debug code
1 parent 6684ba4 commit fca4a5e

File tree

3 files changed

+17
-48
lines changed

3 files changed

+17
-48
lines changed

bin/repair_mingw_wheel.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
rem
2-
rem This batch file serves the purpose of taking Windows style path arguments
3-
rem converting them to environment variables and calling msys2 This is because
4-
rem otherwise in CI msys2 -c will mangle the paths turning e.g. C:\a\b into
5-
rem C:ab.
2+
rem This batch file serves the purpose of taking Windows style path arguments,
3+
rem converting them to environment variables and calling msys2. This is needed
4+
rem because otherwise in CI msys2 -c will mangle the paths turning e.g. C:\a\b
5+
rem into C:ab.
66
rem
77

88
set tempfile=tmpfile.deleteme

bin/repair_mingw_wheel.sh

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ set -o errexit
1111

1212
# We cannot use ordinary command line arguments in CI because msys2 -c mangles
1313
# them. Instead we have a batch file to receive the arguments and convert them
14-
# into environment variables. When running locally this script could be run
15-
# directly giving the parameters as command line arguments.
14+
# into environment variables before calling this script. When running locally
15+
# this script could be run directly giving the parameters as command line
16+
# arguments instead.
1617

1718
if [[ -z "${WHEELHOUSE}" ]]; then
1819
WHEELNAME=$1
@@ -27,16 +28,8 @@ echo WHEELNAME=$WHEELNAME
2728
wheeldir=$(dirname $WHEELNAME)
2829
echo $wheeldir
2930

30-
# Uncomment this to run cibuildwheel locally on Windows:
31-
# export PATH=$PATH:/c/msys64/usr/bin:/c/msys64/mingw64/bin
32-
33-
# VER should be set be e.g. 310 for Python 3.10
34-
#VER=`python -c 'import sys; print("%s%s" % sys.version_info[:2])'`
35-
#echo VER=${VER}
36-
#
37-
#WHEELNAME=python_flint-0.3.0-cp${VER}-cp${VER}-win_amd64.whl
38-
39-
# delvewheel requires DLLs created by mingw64 to be stripped
31+
# delvewheel requires DLLs created by mingw64 to be stripped. This strips the
32+
# DLLs for GMP etc that will have been build previously.
4033
strip .local/bin/*.dll .local/lib/*.dll
4134

4235
# Make sure to leave the wheel in the same directory
@@ -49,7 +42,9 @@ pushd $wheeldir
4942
wheel pack python_flint-*
5043
popd
5144

52-
# Make the wheel relocatable
45+
# Make the wheel relocatable. This will fail with an error message about
46+
# --no-mangle if strip has not been applied to all mingw64-created .dll and
47+
# .pyd files that are needed for the wheel.
5348
delvewheel repair $WHEELNAME \
5449
-w $WHEELHOUSE \
5550
--add-path .local/bin:.local/lib/

setup.py

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,21 @@
1515
#
1616
if os.getenv('PYTHON_FLINT_MINGW64'):
1717
libraries = ["arb", "flint", "mpfr", "gmp"]
18-
#
19-
# Add the libpythonXXX.a file to Python installation
20-
#
21-
22-
# e.g. finding the shared libs (dll/so) our python process loaded so far ...
23-
#import psutil, os
24-
#p = psutil.Process( os.getpid() )
25-
#for dll in p.memory_maps():
26-
# print(dll.path)
27-
28-
#PYTHONDIR = os.path.dirname(sys.executable)
29-
#PYTHONDIR = r'C:\Users\runneradmin\AppData\Local\pypa\cibuildwheel\Cache\nuget-cpython\python.3.9.13\tools'
30-
#VER = '%s%s' % sys.version_info[:2]
31-
#commands = f"""
32-
#msys2 -c ls
33-
#msys2 -c gendef python{VER}.dll
34-
#msys2 -c ls
35-
#msys2 -c dlltool --dllname python{VER}.dll --def python{VER}.def --output-lib libpython{VER}.a
36-
#msys2 -c mv libpython{VER}.a libs
37-
#msys2 -c echo "$C_INCLUDE_DIR"
38-
#"""
39-
#for cmd in commands.strip().splitlines():
40-
#print(cmd.split())
41-
#check_call(cmd.split(), cwd=PYTHONDIR)
42-
#print(__file__)
4318
includedir = os.path.join(os.path.dirname(__file__), '.local', 'include')
4419
librarydir1 = os.path.join(os.path.dirname(__file__), '.local', 'bin')
4520
librarydir2 = os.path.join(os.path.dirname(__file__), '.local', 'lib')
4621
librarydirs = [librarydir1, librarydir2]
47-
#print(includedir)
4822
default_include_dirs += [includedir]
49-
#print(os.listdir(includedir))
50-
#print(os.listdir(librarydir1))
51-
#print(os.listdir(librarydir2))
5223
default_lib_dirs += librarydirs
24+
# Add gcc to the PATH in GitHub Actions when this setup.py is called by
25+
# cibuildwheel.
5326
os.environ['PATH'] += r';C:\msys64\mingw64\bin'
54-
#print(default_lib_dirs)
5527
elif os.getenv('PYTHON_FLINT_MINGW64_TMP'):
28+
# This would be used to build under Windows against these libraries if
29+
# they have been installed somewhere other than .local
5630
libraries = ["arb", "flint", "mpfr", "gmp"]
5731
else:
58-
# For the MSVC toolchain with mpir instead of gmp
32+
# For the MSVC toolchain link with mpir instead of gmp
5933
libraries = ["arb", "flint", "mpir", "mpfr", "pthreads"]
6034
else:
6135
libraries = ["arb", "flint"]

0 commit comments

Comments
 (0)