diff --git a/recipe/install_base.bat b/recipe/install_base.bat index 2d7485a2d..92fdaeb19 100644 --- a/recipe/install_base.bat +++ b/recipe/install_base.bat @@ -51,7 +51,7 @@ if "%PY_FREETHREADING%" == "yes" ( ) :: Populate the root package directory -for %%x in (python%VERNODOTS%%THREAD%%_D%.dll python3%THREAD%%_D%.dll python%EXE_T%%_D%.exe pythonw%EXE_T%%_D%.exe) do ( +for %%x in (python%EXE_T%%_D%.exe pythonw%EXE_T%%_D%.exe) do ( if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x ( copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX% ) else ( diff --git a/recipe/install_shared.bat b/recipe/install_shared.bat new file mode 100644 index 000000000..ddbb53dde --- /dev/null +++ b/recipe/install_shared.bat @@ -0,0 +1,37 @@ +setlocal EnableDelayedExpansion +echo on + +if "%target_platform%"=="win-64" ( + set HOST_DIR=amd64 +) +if "%target_platform%"=="win-32" ( + set HOST_DIR=win32 +) +if "%target_platform%"=="win-arm64" ( + set HOST_DIR=arm64 +) + +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + set "VERNODOTS=%%i%%j" +) + +if "%PY_INTERP_DEBUG%"=="yes" ( + set _D=_d +) else ( + set _D= +) + +if "%PY_FREETHREADING%" == "yes" ( + set "THREAD=t" +) else ( + set "THREAD=" +) + +:: move python*.dll +for %%x in (python%VERNODOTS%%THREAD%%_D%.dll python3%THREAD%%_D%.dll) do ( + if exist %SRC_DIR%\PCbuild\%HOST_DIR%\%%x ( + copy /Y %SRC_DIR%\PCbuild\%HOST_DIR%\%%x %PREFIX% + ) else ( + echo "WARNING :: %SRC_DIR%\PCbuild\%HOST_DIR%\%%x does not exist" + ) +) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e83cbc50d..5d73820b5 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -4,7 +4,7 @@ {% set ver2 = '.'.join(version.split('.')[0:2]) %} {% set ver2nd = ''.join(version.split('.')[0:2]) %} {% set ver3nd = ''.join(version.split('.')[0:3]) %} -{% set build_number = 1 %} +{% set build_number = 2 %} # this makes the linter happy {% set channel_targets = channel_targets or 'conda-forge main' %} @@ -265,10 +265,13 @@ outputs: files: - tests/cmake/* - tests/cython/* + - tests/prefix-replacement/* - run_test.py commands: - echo on # [win] - set # [win] + # ensure we don't pick up python from the image by accident + - rmdir /s /q C:\hostedtoolcache\windows\Python # [win] - python -V - python3 -V # [not win] - pydoc -h @@ -308,7 +311,11 @@ outputs: - if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 # [win] - if not exist %PREFIX%\\include\\pyconfig.h exit 1 # [win] - pushd tests + - pushd prefix-replacement # [unix] + - bash build-and-test.sh # [unix] + - popd # [unix] - pushd cmake + - cmake -GNinja {{ cmake_test_args }} -DPY_VER={{ version }} -DEXTRA_COMPONENTS="Development.Embed" {{ cmake_debug }} . - cmake -GNinja {{ cmake_test_args }} -DPY_VER={{ version }} -DEXTRA_COMPONENTS="Development.Module" {{ cmake_debug }} . - popd - popd @@ -322,11 +329,7 @@ outputs: - name: libpython script: install_shared.sh # [unix] - files: # [win] - - python3.dll # [win] - - python3t.dll # [win] - - python{{ ver2nd }}.dll # [win] - - python{{ ver2nd }}t.dll # [win] + script: install_shared.bat # [win] build: number: {{ build_number }} activate_in_script: true @@ -342,20 +345,6 @@ outputs: - {{ compiler('c') }} - {{ compiler('cxx') }} test: - files: - - tests/cmake/* - - tests/prefix-replacement/* - requires: - - {{ stdlib('c') }} - - {{ compiler('c') }} - # cmake expects a C++ compiler for some reason - - {{ compiler('cxx') }} - # build-and-test.sh needs to find `Python.h`; can't do pin_subpackage - # due to the way conda-build (mis-)populates the package hashes - - python {{ version }} *_{{ PKG_BUILDNUM }}{{ debug }}_{{ abi_tag }} - - ripgrep - - cmake - - ninja commands: - VER=${PKG_VERSION%.*} # [not win] - VERABI=${VER} # [not win] @@ -376,14 +365,6 @@ outputs: - if not exist %PREFIX%\python3.dll exit 1 # [win] - if not exist %PREFIX%\python{{ ver2nd }}.dll exit 1 # [win] {% endif %} - - pushd tests - - pushd prefix-replacement # [unix] - - bash build-and-test.sh # [unix] - - popd # [unix] - - pushd cmake - - cmake -GNinja {{ cmake_test_args }} -DPY_VER={{ version }} -DEXTRA_COMPONENTS="Development.Embed" {{ cmake_debug }} . - - popd - - popd - name: libpython-static script: install_static.sh # [unix] diff --git a/recipe/tests/prefix-replacement/build-and-test.sh b/recipe/tests/prefix-replacement/build-and-test.sh index d710bde75..670d76d63 100644 --- a/recipe/tests/prefix-replacement/build-and-test.sh +++ b/recipe/tests/prefix-replacement/build-and-test.sh @@ -3,7 +3,7 @@ set -ex case ${PKG_NAME} in - libpython) + python) # see bpo44182 for why -L${CONDA_PREFIX}/lib is added ${CC} a.c $(python3-config --cflags) \ $(python3-config --embed --ldflags) \