Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
79 changes: 41 additions & 38 deletions recipe/build_base.bat
Original file line number Diff line number Diff line change
Expand Up @@ -102,43 +102,44 @@ for %%x in (python%THREAD%%_D%.pdb python%VERNODOTS%%THREAD%%_D%.pdb pythonw%THR

@echo on

:: AR: classic Win prefix (DLLs/, Lib/, libs/, include/). CPython getpath
:: landmarks Lib\os.py; CF install_base.bat uses the same layout.
copy %SRC_DIR%\LICENSE %PREFIX%\LICENSE_PYTHON.txt
:: 0027 unixy Win prefix (lib\python, include\python). getpath landmarks lib\python\os.py.
mkdir %PREFIX%\lib\python
copy %SRC_DIR%\LICENSE %PREFIX%\lib\python\LICENSE_PYTHON.txt
if errorlevel 1 exit 1

:: Populate the DLLs directory
mkdir %PREFIX%\DLLs
xcopy /s /y %SRC_DIR%\PCBuild\%BUILD_PATH%\*.pyd %PREFIX%\DLLs\
:: Populate lib-dynload (was DLLs)
mkdir %PREFIX%\lib\python\lib-dynload
xcopy /s /y %SRC_DIR%\PCBuild\%BUILD_PATH%\*.pyd %PREFIX%\lib\python\lib-dynload\
if errorlevel 1 exit 1

copy /Y %SRC_DIR%\PC\icons\py.ico %PREFIX%\DLLs\
copy /Y %SRC_DIR%\PC\icons\py.ico %PREFIX%\lib\python\lib-dynload\
if errorlevel 1 exit 1
copy /Y %SRC_DIR%\PC\icons\pyc.ico %PREFIX%\DLLs\
copy /Y %SRC_DIR%\PC\icons\pyc.ico %PREFIX%\lib\python\lib-dynload\
if errorlevel 1 exit 1


:: Populate the Tools directory
mkdir %PREFIX%\Tools
xcopy /s /y /i %SRC_DIR%\Tools\i18n %PREFIX%\Tools\i18n
mkdir %PREFIX%\lib\python\Tools
xcopy /s /y /i %SRC_DIR%\Tools\i18n %PREFIX%\lib\python\Tools\i18n
if errorlevel 1 exit 1
xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\Tools\scripts
xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\lib\python\Tools\scripts
if errorlevel 1 exit 1

del %PREFIX%\Tools\scripts\README
del %PREFIX%\lib\python\Tools\scripts\README
if errorlevel 1 exit 1
del %PREFIX%\Tools\scripts\idle3
del %PREFIX%\lib\python\Tools\scripts\idle3
if errorlevel 1 exit 1

move /y %PREFIX%\Tools\scripts\pydoc3 %PREFIX%\Tools\scripts\pydoc3.py
move /y %PREFIX%\lib\python\Tools\scripts\pydoc3 %PREFIX%\lib\python\Tools\scripts\pydoc3.py
if errorlevel 1 exit 1

:: Populate the include directory
xcopy /s /y %SRC_DIR%\Include %PREFIX%\include\
mkdir %PREFIX%\include\python
xcopy /s /y %SRC_DIR%\Include %PREFIX%\include\python\
if errorlevel 1 exit 1

:: Copy generated pyconfig.h
copy /Y %SRC_DIR%\PC\pyconfig.h %PREFIX%\include\
copy /Y %SRC_DIR%\PC\pyconfig.h %PREFIX%\include\python\
if errorlevel 1 exit 1

:: Populate the Scripts directory
Expand All @@ -150,50 +151,52 @@ for %%x in (idle pydoc) do (
if errorlevel 1 exit 1
)

:: Populate the libs directory
if not exist %PREFIX%\libs mkdir %PREFIX%\libs
if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib %PREFIX%\libs\
if errorlevel 1 exit 1
if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib %PREFIX%\libs\
if errorlevel 1 exit 1
if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib %PREFIX%\libs\
if errorlevel 1 exit 1
:: Populate the libs directory (and lib, matching CF unixy layout)
for %%x in (lib libs) do (
if not exist %PREFIX%\%%x mkdir %PREFIX%\%%x
if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python%VERNODOTS%%THREAD%%_D%.lib %PREFIX%\%%x\
if errorlevel 1 exit 1
if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python3%THREAD%%_D%.lib %PREFIX%\%%x\
if errorlevel 1 exit 1
if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter%_D%.lib %PREFIX%\%%x\
if errorlevel 1 exit 1
)


:: Populate the Lib directory
del %PREFIX%\libs\libpython*.a
xcopy /s /y %SRC_DIR%\Lib %PREFIX%\Lib\
:: Populate lib\python (stdlib)
del %PREFIX%\lib\libpython*.a
xcopy /s /y %SRC_DIR%\Lib %PREFIX%\lib\python\
if errorlevel 1 exit 1

:: Copy venv[w]launcher scripts to venv\scripts\nt
:: See https://github.com/python/cpython/blob/b4a316087c32d83e375087fd35fc511bc430ee8b/Lib/venv/__init__.py#L334-L376
if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe (
@rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first?
copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\python.exe
copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\venvlauncher%THREAD%%_D%.exe
copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\python.exe
copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\venvlauncher%THREAD%%_D%.exe
) else (
echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvlauncher%THREAD%%_D%.exe does not exist"
)

if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe (
@rem We did copy pythonw.exe until 3.12 but starting with 3.13 we seem to need the latter. Should we omit the first?
copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\pythonw.exe
copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\Lib\venv\scripts\nt\venvwlauncher%THREAD%%_D%.exe
copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\pythonw.exe
copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe %PREFIX%\lib\python\venv\scripts\nt\venvwlauncher%THREAD%%_D%.exe
) else (
echo "WARNING :: %SRC_DIR%\PCbuild\%BUILD_PATH%\venvwlauncher%THREAD%%_D%.exe does not exist"
)

:: Remove test data to save space.
:: Though keep `support` as some things use that.
mkdir %PREFIX%\Lib\test_keep
mkdir %PREFIX%\lib\python\test_keep
if errorlevel 1 exit 1
move %PREFIX%\Lib\test\__init__.py %PREFIX%\Lib\test_keep\
move %PREFIX%\lib\python\test\__init__.py %PREFIX%\lib\python\test_keep\
if errorlevel 1 exit 1
move %PREFIX%\Lib\test\support %PREFIX%\Lib\test_keep\
move %PREFIX%\lib\python\test\support %PREFIX%\lib\python\test_keep\
if errorlevel 1 exit 1
rd /s /q %PREFIX%\Lib\test
rd /s /q %PREFIX%\lib\python\test
if errorlevel 1 exit 1
move %PREFIX%\Lib\test_keep %PREFIX%\Lib\test
move %PREFIX%\lib\python\test_keep %PREFIX%\lib\python\test
if errorlevel 1 exit 1

:: We need our Python to be found!
Expand All @@ -202,7 +205,7 @@ if "%EXE_T%" neq "" copy %PREFIX%\python%EXE_T%.exe %PREFIX%\python.exe

set "PYTHON=%PREFIX%\python.exe"
:: bytecode compile the standard library
%PYTHON% -Wi %PREFIX%\Lib\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\Lib
%PYTHON% -Wi %PREFIX%\lib\python\compileall.py -f -q -x "bad_coding|badsyntax|py2_" %PREFIX%\lib\python
if errorlevel 1 exit 1

:: Ensure that scripts are generated
Expand All @@ -227,7 +230,7 @@ echo "Testing import of os (no DLL needed) does not print: The specified module
if %errorlevel% neq 1 exit /b 1

echo "Testing import of %%m (DLL located via PATH needed) does not print: The specified module could not be found"
:: The names are our unvendored modules mapped to ...\DLLs\X.pyd
:: The names are our unvendored modules mapped to ...\lib\python\lib-dynload\X.pyd
:: missing: libffi, expat, zlib(-ng)

:: Also %errorlevel% will not be updated round the loop so use && to
Expand Down
13 changes: 10 additions & 3 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Clobber aggregate's python zip (python/numpy/is_freethreading/is_python_min).
# conda-build requires ALL four keys at the same length; otherwise 3.15 is not a
# subspace of aggregate python 3.10–3.14 (no rocket) and PY_VER stays 3.10.
python:
- 3.15 # [ANACONDA_ROCKET_ENABLE_PY315]
- 3.15
numpy:
- 2.5
is_freethreading:
- false
is_python_min:
- false
python_impl:
- cpython
numpy:
- 2.5 # [ANACONDA_ROCKET_ENABLE_PY315]
# Override aggregate global tk 8.6 — build/test against tk 9 from pkgs/main
tk:
- '9.0'
Expand Down
17 changes: 10 additions & 7 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = "3.15.0" %}
{% set dev = "rc1" %}
{% set dev = "rc2" %}
{% set dev_ = "" %}
{% set ver2 = '.'.join(version.split('.')[0:2]) %}
{% set ver2nd = ''.join(version.split('.')[0:2]) %}
Expand Down Expand Up @@ -61,7 +61,7 @@ source:
{% else %}
- url: https://www.python.org/ftp/python/{{ version }}/Python-{{ version }}{{ dev }}.tar.xz
# md5 from: https://www.python.org/downloads/release/python-{{ ver3nd }}/
sha256: f84dad680ab2147417d2739355c2678f0f9acffe4ae8ef77895de1454b384b07
sha256: 8d93af5eaaaea5adfd41bd786a7ba3f03f2ad1ab57c6a65e0b963deab91d5ad7
{% endif %}
patches:
- patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch
Expand All @@ -88,12 +88,16 @@ source:
- patches/0017-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch
- patches/0018-Unvendor-expat.patch
- patches/0019-Remove-unused-readelf.patch
- patches/0020-Don-t-checksharedmods-if-cross-compiling.patch
- patches/0021-Override-configure-LIBFFI.patch
- patches/0022-Unvendor-libmpdec.patch
- patches/0023-branding.patch
- patches/0024-Unvendor-zlib-ng.patch
- patches/0024-Do-not-define-pid_t-as-it-might-conflict-with-the-ac.patch
- patches/0025-Unvendor-zstd.patch
- patches/0026-xxlimited-freethreading-stable-abi-link.patch # [win and gil_type == "disabled"]
- patches/0026-Set-Py_GIL_DISABLED-in-windows-to-match-unix.patch # [win and gil_type == "disabled"]
- patches/0027-More-unixy-layout-for-windows.patch
- patches/0028-Unvendor-zlib-ng.patch
- patches/0029-xxlimited-freethreading-stable-abi-link.patch # [win and gil_type == "disabled"]

build:
number: {{ build_number }}
Expand Down Expand Up @@ -287,9 +291,8 @@ outputs:
- if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 # [win]
- if not exist %PREFIX%\\Scripts\\idle.exe exit 1 # [win]
- if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 # [win]
# AR: classic Win layout (Lib/, include/, libs/). getpath looks for Lib\os.py;
# CF install_base.bat is the same — not lib\python.
- if not exist %PREFIX%\\include\\pyconfig.h exit 1 # [win]
# 0027 unixy Win layout: getpath landmarks lib\python\os.py and include\python.
- if not exist %PREFIX%\\include\\python\\pyconfig.h exit 1 # [win]
- if not exist %PREFIX%\\libs\\python{{ ver2nd }}{{ abi_suffix }}.lib exit 1 # [win]
- pushd tests
- pushd prefix-replacement # [unix]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
From 627caa150ced4ec40716cc62366c19a200f5cc0d Mon Sep 17 00:00:00 2001
From b51c74365f2f62c84d2f174c2d68e38ca4e16765 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 16 Aug 2017 11:53:55 +0100
Subject: [PATCH 01/25] Win32: Change FD_SETSIZE from 512 to 2048
Subject: [PATCH 01/27] Win32: Change FD_SETSIZE from 512 to 2048

https://github.com/ContinuumIO/anaconda-issues/issues/1241
---
Modules/selectmodule.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 2c56dbc6a5..845ff4732c 100644
index b9fb7762e3d..e6102e8c589 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -45,7 +45,7 @@
Expand All @@ -21,6 +21,3 @@ index 2c56dbc6a5..845ff4732c 100644
#endif

#if defined(HAVE_POLL_H)
--
2.51.0

25 changes: 11 additions & 14 deletions recipe/patches/0002-Win32-Do-not-download-externals.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
From 679fdc73eded852c9d17ab4cc811d52a25735af9 Mon Sep 17 00:00:00 2001
From dbc1c91f800e11a162eb14c42c806564802ba167 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Thu, 7 Sep 2017 11:35:47 +0100
Subject: [PATCH 02/25] Win32: Do not download externals
Subject: [PATCH 02/27] Win32: Do not download externals

---
PCbuild/build.bat | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PCbuild/build.bat b/PCbuild/build.bat
index 9d2f032f5a..f062963991 100644
index 9d2f032f5a9..faad274fc9d 100644
--- a/PCbuild/build.bat
+++ b/PCbuild/build.bat
@@ -118,7 +118,7 @@ if "%IncludeSSL%"=="" set IncludeSSL=true
if "%IncludeTkinter%"=="" set IncludeTkinter=true
if "%UseJIT%" NEQ "true" set IncludeLLVM=false

-if "%IncludeExternals%"=="true" call "%dir%get_externals.bat"
+rem if "%IncludeExternals%"=="true" call "%dir%get_externals.bat"
@@ -112,7 +112,7 @@ if "%~1"=="--no-ctypes" (set IncludeCTypes=false) & shift & goto CheckOpts
if "%~1"=="--no-ssl" (set IncludeSSL=false) & shift & goto CheckOpts
if "%~1"=="--no-tkinter" (set IncludeTkinter=false) & shift & goto CheckOpts

if /I "%target%"=="Clean" set clean=true
if /I "%target%"=="CleanAll" set clean=true
--
2.51.0

-if "%IncludeExternals%"=="" set IncludeExternals=true
+@rem if "%IncludeExternals%"=="" set IncludeExternals=true
if "%IncludeCTypes%"=="" set IncludeCTypes=true
if "%IncludeSSL%"=="" set IncludeSSL=true
if "%IncludeTkinter%"=="" set IncludeTkinter=true
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 32a92008fe83a0f9484ad0df5162485dfb7a637b Mon Sep 17 00:00:00 2001
From 028de8f3d29a0aec65b80d36c00faf975268c9c0 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Tue, 5 Dec 2017 22:47:59 +0000
Subject: [PATCH 03/25] Fix find_library so that it looks in sys.prefix/lib
Subject: [PATCH 03/27] Fix find_library so that it looks in sys.prefix/lib
first

---
Expand All @@ -10,7 +10,7 @@ Subject: [PATCH 03/25] Fix find_library so that it looks in sys.prefix/lib
2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/Lib/ctypes/macholib/dyld.py b/Lib/ctypes/macholib/dyld.py
index 583c47daff..ab9b01c87e 100644
index 583c47daff3..ab9b01c87e2 100644
--- a/Lib/ctypes/macholib/dyld.py
+++ b/Lib/ctypes/macholib/dyld.py
@@ -93,6 +93,10 @@ def dyld_executable_path_search(name, executable_path=None):
Expand All @@ -25,7 +25,7 @@ index 583c47daff..ab9b01c87e 100644
yield os.path.join(executable_path, name[len('@executable_path/'):])

diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 35ac5b6bfd..09c3e1703d 100644
index 015c62b31a1..e08c9520576 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -136,7 +136,8 @@ def dllist():
Expand All @@ -38,7 +38,7 @@ index 35ac5b6bfd..09c3e1703d 100644
'%s.dylib' % name,
'%s.framework/%s' % (name, name)]
for name in possible:
@@ -437,10 +438,30 @@ def _findLib_ld(name):
@@ -436,10 +437,30 @@ def _findLib_ld(name):
pass # result will be None
return result

Expand All @@ -47,7 +47,7 @@ index 35ac5b6bfd..09c3e1703d 100644
+ return None
+ for fullname in (name, "lib%s.so" % (name)):
+ path = os.path.join(sys.prefix, 'lib', fullname)
+ if os.path.exists(path):
+ if os.path.exists(path) and not os.path.isdir(path):
+ return path
+ return None
+
Expand All @@ -71,6 +71,3 @@ index 35ac5b6bfd..09c3e1703d 100644


# On platforms which provide dl_iterate_phdr(), dllist() is implemented
--
2.51.0

Loading