diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index 3dcf9383d..00cdd8c15 100644 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -16,9 +16,8 @@ jobs: free_disk_space: skip pagefile_size: 0 resize_partitions: false - store_build_artifacts: true + store_build_artifacts: false tools_install_dir: ~/miniforge3 - CONFIG_SHORT: osx_64_build_typedebugchannel_targetscon_h5e478946 osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes: CONFIG: osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes UPLOAD_PACKAGES: 'True' @@ -27,9 +26,8 @@ jobs: free_disk_space: skip pagefile_size: 0 resize_partitions: false - store_build_artifacts: true + store_build_artifacts: false tools_install_dir: ~/miniforge3 - CONFIG_SHORT: osx_64_build_typedebugchannel_targetscon_h116d3356 osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno: CONFIG: osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno UPLOAD_PACKAGES: 'True' @@ -38,9 +36,8 @@ jobs: free_disk_space: skip pagefile_size: 0 resize_partitions: false - store_build_artifacts: true + store_build_artifacts: false tools_install_dir: ~/miniforge3 - CONFIG_SHORT: osx_64_build_typereleasechannel_targetsc_h425d4db0 osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes: CONFIG: osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes UPLOAD_PACKAGES: 'True' @@ -49,9 +46,8 @@ jobs: free_disk_space: skip pagefile_size: 0 resize_partitions: false - store_build_artifacts: true + store_build_artifacts: false tools_install_dir: ~/miniforge3 - CONFIG_SHORT: osx_64_build_typereleasechannel_targetsc_haa8f77b8 osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno: CONFIG: osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno UPLOAD_PACKAGES: 'True' @@ -60,9 +56,8 @@ jobs: free_disk_space: skip pagefile_size: 0 resize_partitions: false - store_build_artifacts: true + store_build_artifacts: false tools_install_dir: ~/miniforge3 - CONFIG_SHORT: osx_arm64_build_typedebugchannel_targets_h4a1f0d05 osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes: CONFIG: osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes UPLOAD_PACKAGES: 'True' @@ -71,9 +66,8 @@ jobs: free_disk_space: skip pagefile_size: 0 resize_partitions: false - store_build_artifacts: true + store_build_artifacts: false tools_install_dir: ~/miniforge3 - CONFIG_SHORT: osx_arm64_build_typedebugchannel_targets_h49dbe0c1 osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno: CONFIG: osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno UPLOAD_PACKAGES: 'True' @@ -82,9 +76,8 @@ jobs: free_disk_space: skip pagefile_size: 0 resize_partitions: false - store_build_artifacts: true + store_build_artifacts: false tools_install_dir: ~/miniforge3 - CONFIG_SHORT: osx_arm64_build_typereleasechannel_targe_h0d9a29af osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes: CONFIG: osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes UPLOAD_PACKAGES: 'True' @@ -93,9 +86,8 @@ jobs: free_disk_space: skip pagefile_size: 0 resize_partitions: false - store_build_artifacts: true + store_build_artifacts: false tools_install_dir: ~/miniforge3 - CONFIG_SHORT: osx_arm64_build_typereleasechannel_targe_h92a1d5a6 timeoutInMinutes: 360 variables: {} @@ -122,34 +114,3 @@ jobs: BINSTAR_TOKEN: $(BINSTAR_TOKEN) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) - - - script: | - export ARTIFACT_STAGING_DIR="$(Build.ArtifactStagingDirectory)" - # Archive everything in CONDA_BLD_PATH except environments - export BLD_ARTIFACT_PREFIX=conda_artifacts - export CI=azure - export CI_RUN_ID=$(build.BuildNumber).$(system.JobAttempt) - export CONDA_BLD_PATH=$(build_workspace_dir) - export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) - export MINIFORGE_HOME=$(tools_install_dir) - if [[ "$AGENT_JOBSTATUS" == "Failed" ]]; then - # Archive the CONDA_BLD_PATH environments only when the job fails - export ENV_ARTIFACT_PREFIX=conda_envs - fi - ./.scripts/create_conda_build_artifacts.sh - displayName: Prepare conda build artifacts - condition: and(succeededOrFailed(), eq(variables.store_build_artifacts, true)) - - - task: PublishPipelineArtifact@1 - displayName: Store conda build artifacts - condition: not(eq(variables.BLD_ARTIFACT_PATH, '')) - inputs: - targetPath: $(BLD_ARTIFACT_PATH) - artifactName: $(BLD_ARTIFACT_NAME) - - - task: PublishPipelineArtifact@1 - displayName: Store conda build environment artifacts - condition: not(eq(variables.ENV_ARTIFACT_PATH, '')) - inputs: - targetPath: $(ENV_ARTIFACT_PATH) - artifactName: $(ENV_ARTIFACT_NAME) diff --git a/.ci_support/linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml b/.ci_support/linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml index cf5587f6c..5100d60f7 100644 --- a/.ci_support/linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml +++ b/.ci_support/linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma10 expat: @@ -55,3 +55,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml b/.ci_support/linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml index 9ca1da4fe..2b5a95f60 100644 --- a/.ci_support/linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml +++ b/.ci_support/linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma10 expat: @@ -55,3 +55,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml b/.ci_support/linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml index 6bac31546..b4c74c44c 100644 --- a/.ci_support/linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml +++ b/.ci_support/linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma10 expat: @@ -55,3 +55,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml b/.ci_support/linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml index a825efb24..286e411e8 100644 --- a/.ci_support/linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml +++ b/.ci_support/linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma10 expat: @@ -55,3 +55,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml b/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml index 24262b5db..5ebfde0e1 100644 --- a/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml +++ b/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-aarch64:alma10 expat: @@ -55,3 +55,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml b/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml index 2122423ce..c40d48605 100644 --- a/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml +++ b/.ci_support/linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-aarch64:alma10 expat: @@ -55,3 +55,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml b/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml index 820f1e69d..82070edf0 100644 --- a/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml +++ b/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-aarch64:alma10 expat: @@ -55,3 +55,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml b/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml index a4227a4d3..b831cd859 100644 --- a/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml +++ b/.ci_support/linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-aarch64:alma10 expat: @@ -55,3 +55,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml b/.ci_support/linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml index 8b521600f..f5eb7e681 100644 --- a/.ci_support/linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml +++ b/.ci_support/linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma10 expat: @@ -53,3 +53,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml b/.ci_support/linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml index ddf949f64..43607e9db 100644 --- a/.ci_support/linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml +++ b/.ci_support/linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma10 expat: @@ -53,3 +53,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml b/.ci_support/linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml index 1d3b90e59..514514722 100644 --- a/.ci_support/linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml +++ b/.ci_support/linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma10 expat: @@ -53,3 +53,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml b/.ci_support/linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml index e1b5a1f92..84630badb 100644 --- a/.ci_support/linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml +++ b/.ci_support/linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '14' +- '15' c_stdlib: - sysroot c_stdlib_version: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '14' +- '15' docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma10 expat: @@ -53,3 +53,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml b/.ci_support/osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml index bcec8ca6d..d92956d1a 100644 --- a/.ci_support/osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml +++ b/.ci_support/osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml @@ -9,7 +9,7 @@ bzip2: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -21,7 +21,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' expat: - '2' freethreading: @@ -57,3 +57,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml b/.ci_support/osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml index 13190f471..36e4915c8 100644 --- a/.ci_support/osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml +++ b/.ci_support/osx_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml @@ -9,7 +9,7 @@ bzip2: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -21,7 +21,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' expat: - '2' freethreading: @@ -57,3 +57,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml b/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml index dae08a3b6..69fb4dec0 100644 --- a/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml +++ b/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml @@ -9,7 +9,7 @@ bzip2: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -21,7 +21,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' expat: - '2' freethreading: @@ -57,3 +57,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml b/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml index 26873db33..3cd9cd297 100644 --- a/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml +++ b/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml @@ -9,7 +9,7 @@ bzip2: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -21,7 +21,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' expat: - '2' freethreading: @@ -57,3 +57,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml b/.ci_support/osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml index 93629d639..9cc4d30d8 100644 --- a/.ci_support/osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml +++ b/.ci_support/osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno.yaml @@ -9,7 +9,7 @@ bzip2: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -21,7 +21,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' expat: - '2' freethreading: @@ -57,3 +57,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml b/.ci_support/osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml index fcc8db27d..11517bb5a 100644 --- a/.ci_support/osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml +++ b/.ci_support/osx_arm64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes.yaml @@ -9,7 +9,7 @@ bzip2: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -21,7 +21,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' expat: - '2' freethreading: @@ -57,3 +57,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml b/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml index 4d1f9c4f8..1b978bd28 100644 --- a/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml +++ b/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml @@ -9,7 +9,7 @@ bzip2: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -21,7 +21,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' expat: - '2' freethreading: @@ -57,3 +57,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml b/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml index 7c10c009f..e168b26d8 100644 --- a/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml +++ b/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml @@ -9,7 +9,7 @@ bzip2: c_compiler: - clang c_compiler_version: -- '19' +- '21' c_stdlib: - macosx_deployment_target c_stdlib_version: @@ -21,7 +21,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '19' +- '21' expat: - '2' freethreading: @@ -57,3 +57,5 @@ zip_keys: - cxx_compiler_version zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/win_64_freethreadingno.yaml b/.ci_support/win_64_freethreadingno.yaml index ef4e30c1a..d4f030119 100644 --- a/.ci_support/win_64_freethreadingno.yaml +++ b/.ci_support/win_64_freethreadingno.yaml @@ -39,3 +39,5 @@ zip_keys: - channel_targets zlib: - '1' +zstd: +- '1.5' diff --git a/.ci_support/win_64_freethreadingyes.yaml b/.ci_support/win_64_freethreadingyes.yaml index c3cfa0a28..21d8cda29 100644 --- a/.ci_support/win_64_freethreadingyes.yaml +++ b/.ci_support/win_64_freethreadingyes.yaml @@ -39,3 +39,5 @@ zip_keys: - channel_targets zlib: - '1' +zstd: +- '1.5' diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index 0116f118c..3212c77e5 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -23,9 +23,8 @@ jobs: matrix: include: - CONFIG: linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno - CONFIG_SHORT: linux_64_build_typedebugchannel_targetsc_h10d856d4 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -36,9 +35,8 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: linux_64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes - CONFIG_SHORT: linux_64_build_typedebugchannel_targetsc_hf83d9e2d DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -49,9 +47,8 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno - CONFIG_SHORT: linux_64_build_typereleasechannel_target_h01f3c156 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -62,9 +59,8 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes - CONFIG_SHORT: linux_64_build_typereleasechannel_target_hf5ff4d16 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -75,9 +71,8 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno - CONFIG_SHORT: linux_aarch64_build_typedebugchannel_tar_hd2db0a21 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -88,9 +83,8 @@ jobs: runs_on: ['ubuntu-24.04-arm'] tools_install_dir: ~/miniforge3 - CONFIG: linux_aarch64_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes - CONFIG_SHORT: linux_aarch64_build_typedebugchannel_tar_h51de9693 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -101,9 +95,8 @@ jobs: runs_on: ['ubuntu-24.04-arm'] tools_install_dir: ~/miniforge3 - CONFIG: linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno - CONFIG_SHORT: linux_aarch64_build_typereleasechannel_t_hccc48f4a DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -114,9 +107,8 @@ jobs: runs_on: ['ubuntu-24.04-arm'] tools_install_dir: ~/miniforge3 - CONFIG: linux_aarch64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes - CONFIG_SHORT: linux_aarch64_build_typereleasechannel_t_h78d2c7f5 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -127,9 +119,8 @@ jobs: runs_on: ['ubuntu-24.04-arm'] tools_install_dir: ~/miniforge3 - CONFIG: linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingno - CONFIG_SHORT: linux_ppc64le_build_typedebugchannel_tar_hac8bb296 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -140,9 +131,8 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: linux_ppc64le_build_typedebugchannel_targetsconda-forge_python_debugfreethreadingyes - CONFIG_SHORT: linux_ppc64le_build_typedebugchannel_tar_hb74ed675 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -153,9 +143,8 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingno - CONFIG_SHORT: linux_ppc64le_build_typereleasechannel_t_h5454d1d5 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -166,9 +155,8 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: linux_ppc64le_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes - CONFIG_SHORT: linux_ppc64le_build_typereleasechannel_t_hed84b2c3 DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_workspace_dir: build_artifacts docker_run_args: @@ -179,8 +167,7 @@ jobs: runs_on: ['ubuntu-latest'] tools_install_dir: ~/miniforge3 - CONFIG: win_64_freethreadingno - CONFIG_SHORT: win_64_freethreadingno - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_platform: win-64 build_workspace_dir: D:\\bld\\ @@ -192,8 +179,7 @@ jobs: runs_on: ['windows-2022'] tools_install_dir: D:\Miniforge - CONFIG: win_64_freethreadingyes - CONFIG_SHORT: win_64_freethreadingyes - STORE_BUILD_ARTIFACTS: True + STORE_BUILD_ARTIFACTS: False UPLOAD_PACKAGES: True build_platform: win-64 build_workspace_dir: D:\\bld\\ @@ -299,80 +285,4 @@ jobs: RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: 'true' BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} - STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} - - - name: Determine build outcome - # this is to merge the status of the linux/osx/win builds into - # something we can easily reuse during artefact generation - id: determine-status - if: ${{ always() }} - shell: bash - env: - OS: ${{ matrix.os }} - run: | - if [[ "$OS" == "ubuntu" ]]; then - STATUS=${{ steps.build-linux.outcome }} - elif [[ "$OS" == "macos" ]]; then - STATUS=${{ steps.build-macos.outcome }} - elif [[ "$OS" == "windows" ]]; then - STATUS=${{ steps.build-windows.outcome }} - fi - if [ -z "$STATUS" ]; then - # steps that never ran will have empty status - STATUS="cancelled" - fi - echo "status=$STATUS" >> $GITHUB_OUTPUT - - - name: Prepare conda build artifacts - continue-on-error: true - id: prepare-artifacts - shell: bash - # we do not want to trigger artefact creation if the build was cancelled - if: ${{ always() && steps.determine-status.outputs.status != 'cancelled' && matrix.STORE_BUILD_ARTIFACTS }} - env: - CI: github_actions - CONDA_BLD_PATH: ${{ matrix.build_workspace_dir }} - CONFIG: ${{ matrix.CONFIG }} - CONFIG_SHORT: ${{ matrix.CONFIG_SHORT }} - JOB_STATUS: ${{ steps.determine-status.outputs.status }} - OS: ${{ matrix.os }} - run: | - export ARTIFACT_STAGING_DIR="$GITHUB_WORKSPACE" - export CI_RUN_ID=$GITHUB_RUN_ID - export CONDA_BLD_PATH="${CONDA_BLD_PATH/#~/${HOME}}" - export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" - export MINIFORGE_HOME="${MINIFORGE_HOME/#~/${HOME}}" - # Archive everything in CONDA_BLD_PATH except environments - # Archive the CONDA_BLD_PATH environments only when the job fails - # Use different prefix for successful and failed build artifacts - # so random failures don't prevent rebuilds from creating artifacts. - if [ $JOB_STATUS == "failure" ]; then - export BLD_ARTIFACT_PREFIX="conda_artifacts" - export ENV_ARTIFACT_PREFIX="conda_envs" - else - export BLD_ARTIFACT_PREFIX="conda_pkgs" - fi - if [ $OS == "windows" ]; then - pwsh -Command ". '.scripts/create_conda_build_artifacts.bat'" - else - ./.scripts/create_conda_build_artifacts.sh - fi - - - name: Store conda build artifacts - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - if: ${{ always() && steps.prepare-artifacts.outcome == 'success' }} - with: - name: ${{ steps.prepare-artifacts.outputs.BLD_ARTIFACT_NAME }} - path: ${{ steps.prepare-artifacts.outputs.BLD_ARTIFACT_PATH }} - retention-days: 14 - continue-on-error: true - - - name: Store conda build environment artifacts - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - # only relevant if build failed, see above - if: ${{ always() && steps.determine-status.outputs.status == 'failure' && steps.prepare-artifacts.outcome == 'success' }} - with: - name: ${{ steps.prepare-artifacts.outputs.ENV_ARTIFACT_NAME }} - path: ${{ steps.prepare-artifacts.outputs.ENV_ARTIFACT_PATH }} - retention-days: 14 - continue-on-error: true \ No newline at end of file + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} \ No newline at end of file diff --git a/.scripts/create_conda_build_artifacts.bat b/.scripts/create_conda_build_artifacts.bat deleted file mode 100755 index 705dc461b..000000000 --- a/.scripts/create_conda_build_artifacts.bat +++ /dev/null @@ -1,78 +0,0 @@ -setlocal enableextensions enabledelayedexpansion - -rem INPUTS (environment variables that need to be set before calling this script): -rem -rem CI (azure/github_actions/UNSET) -rem CI_RUN_ID (unique identifier for the CI job run) -rem CONDA_BLD_PATH (path to the conda-bld directory) -rem CONFIG (build matrix configuration string) -rem CONFIG_SHORT (uniquely-shortened configuration string) -rem FEEDSTOCK_NAME -rem Optional: -rem ARTIFACT_STAGING_DIR (use working directory if unset) -rem BLD_ARTIFACT_PREFIX (prefix for the conda build artifact name, skip if unset) -rem ENV_ARTIFACT_PREFIX (prefix for the conda build environments artifact name, skip if unset) - -rem OUTPUTS -rem -rem BLD_ARTIFACT_NAME -rem BLD_ARTIFACT_PATH -rem ENV_ARTIFACT_NAME -rem ENV_ARTIFACT_PATH - -rem Check that the conda-build directory exists -if not exist %CONDA_BLD_PATH% ( - echo conda-build directory does not exist - exit 1 -) - -if not defined ARTIFACT_STAGING_DIR ( - rem Set staging dir to the working dir - set ARTIFACT_STAGING_DIR=%cd% -) - -rem Set a unique ID for the artifact(s), specialized for this particular job run -set ARTIFACT_UNIQUE_ID=%CI_RUN_ID%_%CONFIG% -if not "%ARTIFACT_UNIQUE_ID%" == "%ARTIFACT_UNIQUE_ID:~0,80%" ( - set ARTIFACT_UNIQUE_ID=%CI_RUN_ID%_%CONFIG_SHORT% -) - -rem Make the build artifact zip -if defined BLD_ARTIFACT_PREFIX ( - set BLD_ARTIFACT_NAME=%BLD_ARTIFACT_PREFIX%_%ARTIFACT_UNIQUE_ID% - echo BLD_ARTIFACT_NAME: !BLD_ARTIFACT_NAME! - - set "BLD_ARTIFACT_PATH=%ARTIFACT_STAGING_DIR%\%FEEDSTOCK_NAME%_%BLD_ARTIFACT_PREFIX%_%ARCHIVE_UNIQUE_ID%.zip" - 7z a "!BLD_ARTIFACT_PATH!" "%CONDA_BLD_PATH%" -xr^^!.git/ -xr^^!_*_env*/ -xr^^!*_cache/ -bb - if errorlevel 1 exit 1 - echo BLD_ARTIFACT_PATH: !BLD_ARTIFACT_PATH! - - if "%CI%" == "azure" ( - echo ##vso[task.setVariable variable=BLD_ARTIFACT_NAME]!BLD_ARTIFACT_NAME! - echo ##vso[task.setVariable variable=BLD_ARTIFACT_PATH]!BLD_ARTIFACT_PATH! - ) - if "%CI%" == "github_actions" ( - echo BLD_ARTIFACT_NAME=!BLD_ARTIFACT_NAME!>> !GITHUB_OUTPUT! - echo BLD_ARTIFACT_PATH=!BLD_ARTIFACT_PATH!>> !GITHUB_OUTPUT! - ) -) - -rem Make the environments artifact zip -if defined ENV_ARTIFACT_PREFIX ( - set ENV_ARTIFACT_NAME=!ENV_ARTIFACT_PREFIX!_%ARTIFACT_UNIQUE_ID% - echo ENV_ARTIFACT_NAME: !ENV_ARTIFACT_NAME! - - set "ENV_ARTIFACT_PATH=%ARTIFACT_STAGING_DIR%\%FEEDSTOCK_NAME%_%ENV_ARTIFACT_PREFIX%_%ARCHIVE_UNIQUE_ID%.zip" - 7z a "!ENV_ARTIFACT_PATH!" -r "%CONDA_BLD_PATH%"/_*_env*/ -bb - if errorlevel 1 exit 1 - echo ENV_ARTIFACT_PATH: !ENV_ARTIFACT_PATH! - - if "%CI%" == "azure" ( - echo ##vso[task.setVariable variable=ENV_ARTIFACT_NAME]!ENV_ARTIFACT_NAME! - echo ##vso[task.setVariable variable=ENV_ARTIFACT_PATH]!ENV_ARTIFACT_PATH! - ) - if "%CI%" == "github_actions" ( - echo ENV_ARTIFACT_NAME=!ENV_ARTIFACT_NAME!>> !GITHUB_OUTPUT! - echo ENV_ARTIFACT_PATH=!ENV_ARTIFACT_PATH!>> !GITHUB_OUTPUT! - ) -) diff --git a/.scripts/create_conda_build_artifacts.sh b/.scripts/create_conda_build_artifacts.sh deleted file mode 100755 index 91095c05d..000000000 --- a/.scripts/create_conda_build_artifacts.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env bash - -# INPUTS (environment variables that need to be set before calling this script): -# -# CI (azure/github_actions/UNSET) -# CI_RUN_ID (unique identifier for the CI job run) -# CONDA_BLD_PATH (path to the conda-bld directory) -# CONFIG (build matrix configuration string) -# CONFIG_SHORT (uniquely-shortened configuration string) -# FEEDSTOCK_NAME -# Optional: -# ARTIFACT_STAGING_DIR (use working directory if unset) -# BLD_ARTIFACT_PREFIX (prefix for the conda build artifact name, skip if unset) -# ENV_ARTIFACT_PREFIX (prefix for the conda build environments artifact name, skip if unset) - -# OUTPUTS -# -# BLD_ARTIFACT_NAME -# BLD_ARTIFACT_PATH -# ENV_ARTIFACT_NAME -# ENV_ARTIFACT_PATH - -source .scripts/logging_utils.sh - -# DON'T do set -x, because it results in double echo-ing pipeline commands -# and that might end up inserting extraneous quotation marks in output variables -set -e - -# Check that the conda-build directory exists -if [ ! -d "$CONDA_BLD_PATH" ]; then - echo "conda-build directory does not exist" - exit 1 -fi - -# Set staging dir to the working dir, in Windows style if applicable -if [[ -z "${ARTIFACT_STAGING_DIR}" ]]; then - if pwd -W; then - ARTIFACT_STAGING_DIR=$(pwd -W) - else - ARTIFACT_STAGING_DIR=$PWD - fi -fi -echo "ARTIFACT_STAGING_DIR: $ARTIFACT_STAGING_DIR" - -FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) -if [ -z ${FEEDSTOCK_NAME} ]; then - export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) -fi - -# Set a unique ID for the artifact(s), specialized for this particular job run -ARTIFACT_UNIQUE_ID="${CI_RUN_ID}_${CONFIG}" -if [[ ${#ARTIFACT_UNIQUE_ID} -gt 80 ]]; then - ARTIFACT_UNIQUE_ID="${CI_RUN_ID}_${CONFIG_SHORT}" -fi -echo "ARTIFACT_UNIQUE_ID: $ARTIFACT_UNIQUE_ID" - -# Set a descriptive ID for the archive(s), specialized for this particular job run -ARCHIVE_UNIQUE_ID="${CI_RUN_ID}_${CONFIG}" - -# Make the build artifact zip -if [[ ! -z "$BLD_ARTIFACT_PREFIX" ]]; then - export BLD_ARTIFACT_NAME="${BLD_ARTIFACT_PREFIX}_${ARTIFACT_UNIQUE_ID}" - export BLD_ARTIFACT_PATH="${ARTIFACT_STAGING_DIR}/${FEEDSTOCK_NAME}_${BLD_ARTIFACT_PREFIX}_${ARCHIVE_UNIQUE_ID}.zip" - - ( startgroup "Archive conda build directory" ) 2> /dev/null - - # Try 7z and fall back to zip if it fails (for cross-platform use) - if ! 7z a "$BLD_ARTIFACT_PATH" "$CONDA_BLD_PATH" '-xr!.git/' '-xr!_*_env*/' '-xr!*_cache/' -bb; then - pushd "$CONDA_BLD_PATH" - zip -r -y -T "$BLD_ARTIFACT_PATH" . -x '*.git/*' '*_*_env*/*' '*_cache/*' - popd - fi - - ( endgroup "Archive conda build directory" ) 2> /dev/null - - echo "BLD_ARTIFACT_NAME: $BLD_ARTIFACT_NAME" - echo "BLD_ARTIFACT_PATH: $BLD_ARTIFACT_PATH" - - if [[ "$CI" == "azure" ]]; then - echo "##vso[task.setVariable variable=BLD_ARTIFACT_NAME]$BLD_ARTIFACT_NAME" - echo "##vso[task.setVariable variable=BLD_ARTIFACT_PATH]$BLD_ARTIFACT_PATH" - elif [[ "$CI" == "github_actions" ]]; then - echo "BLD_ARTIFACT_NAME=$BLD_ARTIFACT_NAME" >> $GITHUB_OUTPUT - echo "BLD_ARTIFACT_PATH=$BLD_ARTIFACT_PATH" >> $GITHUB_OUTPUT - fi -fi - -# Make the environments artifact zip -if [[ ! -z "$ENV_ARTIFACT_PREFIX" ]]; then - export ENV_ARTIFACT_NAME="${ENV_ARTIFACT_PREFIX}_${ARTIFACT_UNIQUE_ID}" - export ENV_ARTIFACT_PATH="${ARTIFACT_STAGING_DIR}/${FEEDSTOCK_NAME}_${ENV_ARTIFACT_PREFIX}_${ARCHIVE_UNIQUE_ID}.zip" - - ( startgroup "Archive conda build environments" ) 2> /dev/null - - # Try 7z and fall back to zip if it fails (for cross-platform use) - if ! 7z a "$ENV_ARTIFACT_PATH" -r "$CONDA_BLD_PATH"/'_*_env*/' -bb; then - pushd "$CONDA_BLD_PATH" - zip -r -y -T "$ENV_ARTIFACT_PATH" . -i '*_*_env*/*' - popd - fi - - ( endgroup "Archive conda build environments" ) 2> /dev/null - - echo "ENV_ARTIFACT_NAME: $ENV_ARTIFACT_NAME" - echo "ENV_ARTIFACT_PATH: $ENV_ARTIFACT_PATH" - - if [[ "$CI" == "azure" ]]; then - echo "##vso[task.setVariable variable=ENV_ARTIFACT_NAME]$ENV_ARTIFACT_NAME" - echo "##vso[task.setVariable variable=ENV_ARTIFACT_PATH]$ENV_ARTIFACT_PATH" - elif [[ "$CI" == "github_actions" ]]; then - echo "ENV_ARTIFACT_NAME=$ENV_ARTIFACT_NAME" >> $GITHUB_OUTPUT - echo "ENV_ARTIFACT_PATH=$ENV_ARTIFACT_PATH" >> $GITHUB_OUTPUT - fi -fi diff --git a/README.md b/README.md index 5566e09c5..1756faa73 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ Current release info | Name | Downloads | Version | Platforms | | --- | --- | --- | --- | | [![Conda Recipe](https://img.shields.io/badge/recipe-cpython-green.svg)](https://anaconda.org/conda-forge/cpython) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/cpython.svg)](https://anaconda.org/conda-forge/cpython) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/cpython.svg)](https://anaconda.org/conda-forge/cpython) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/cpython.svg)](https://anaconda.org/conda-forge/cpython) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-libpython-green.svg)](https://anaconda.org/conda-forge/libpython) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libpython.svg)](https://anaconda.org/conda-forge/libpython) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libpython.svg)](https://anaconda.org/conda-forge/libpython) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libpython.svg)](https://anaconda.org/conda-forge/libpython) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libpython--static-green.svg)](https://anaconda.org/conda-forge/libpython-static) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libpython-static.svg)](https://anaconda.org/conda-forge/libpython-static) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libpython-static.svg)](https://anaconda.org/conda-forge/libpython-static) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libpython-static.svg)](https://anaconda.org/conda-forge/libpython-static) | | [![Conda Recipe](https://img.shields.io/badge/recipe-python-green.svg)](https://anaconda.org/conda-forge/python) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/python.svg)](https://anaconda.org/conda-forge/python) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/python.svg)](https://anaconda.org/conda-forge/python) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/python.svg)](https://anaconda.org/conda-forge/python) | | [![Conda Recipe](https://img.shields.io/badge/recipe-python--freethreading-green.svg)](https://anaconda.org/conda-forge/python-freethreading) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/python-freethreading.svg)](https://anaconda.org/conda-forge/python-freethreading) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/python-freethreading.svg)](https://anaconda.org/conda-forge/python-freethreading) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/python-freethreading.svg)](https://anaconda.org/conda-forge/python-freethreading) | @@ -144,10 +145,10 @@ Current release info Installing python ================= -Installing `python` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with: +Installing `python` from the `conda-forge/label/python_debug` channel can be achieved by adding `conda-forge/label/python_debug` to your channels with: ``` -conda config --add channels conda-forge +conda config --add channels conda-forge/label/python_debug conda config --set channel_priority strict ``` @@ -158,7 +159,7 @@ How to use With conda ``` -conda install cpython libpython-static python python-freethreading python-gil python-jit +conda install cpython libpython libpython-static python python-freethreading python-gil python-jit ``` @@ -167,7 +168,7 @@ conda install cpython libpython-static python python-freethreading python-gil py With mamba ``` -mamba install cpython libpython-static python python-freethreading python-gil python-jit +mamba install cpython libpython libpython-static python python-freethreading python-gil python-jit ``` @@ -177,9 +178,9 @@ mamba install cpython libpython-static python python-freethreading python-gil py ``` # for adding to your local project -pixi add cpython libpython-static python python-freethreading python-gil python-jit +pixi add cpython libpython libpython-static python python-freethreading python-gil python-jit # for installing globally -pixi global install cpython libpython-static python python-freethreading python-gil python-jit +pixi global install cpython libpython libpython-static python python-freethreading python-gil python-jit ``` @@ -193,7 +194,7 @@ It is possible to list all of the versions of `cpython` available on your platfo With conda ``` -conda search cpython --channel conda-forge +conda search cpython --channel conda-forge/label/python_debug ``` @@ -202,7 +203,7 @@ conda search cpython --channel conda-forge With mamba ``` -mamba search cpython --channel conda-forge +mamba search cpython --channel conda-forge/label/python_debug ``` @@ -211,7 +212,7 @@ mamba search cpython --channel conda-forge With pixi ``` -pixi search cpython --channel conda-forge +pixi search cpython --channel conda-forge/label/python_debug ``` @@ -221,13 +222,13 @@ pixi search cpython --channel conda-forge ``` # Search all versions available on your platform: -mamba repoquery search cpython --channel conda-forge +mamba repoquery search cpython --channel conda-forge/label/python_debug # List packages depending on `cpython`: -mamba repoquery whoneeds cpython --channel conda-forge +mamba repoquery whoneeds cpython --channel conda-forge/label/python_debug # List dependencies of `cpython`: -mamba repoquery depends cpython --channel conda-forge +mamba repoquery depends cpython --channel conda-forge/label/python_debug ``` diff --git a/conda-forge.yml b/conda-forge.yml index 401841630..f7085af10 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -17,6 +17,3 @@ provider: linux_aarch64: default osx_arm64: default test: native_and_emulated -workflow_settings: - store_build_artifacts: - - value: true diff --git a/recipe/bld.bat b/recipe/bld.bat new file mode 100644 index 000000000..d7a54c3b8 --- /dev/null +++ b/recipe/bld.bat @@ -0,0 +1,69 @@ +setlocal EnableDelayedExpansion +echo on + +set LLVM_ROOT=%BUILD_PREFIX%\Library + +:: Compile python, extensions and external libraries +if "%ARCH%"=="64" ( + set PLATFORM=x64 + set VC_PATH=x64 + set BUILD_PATH=amd64 +) else ( + set PLATFORM=Win32 + set VC_PATH=x86 + set BUILD_PATH=win32 +) + +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + set "VERNODOTS=%%i%%j" +) + +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + set "VER=%%i.%%j" +) + +:: Make sure the "python" value in conda_build_config.yaml is up to date. +for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( + if NOT "%PY_VER%"=="%%i.%%j" exit 1 +) + +for /f "usebackq delims=" %%i in (`conda list -p %PREFIX% sqlite --no-show-channel-urls --json ^| findstr "version"`) do set SQLITE3_VERSION_LINE=%%i +for /f "tokens=2 delims==/ " %%i IN ('echo %SQLITE3_VERSION_LINE%') do (set SQLITE3_VERSION=%%~i) +echo SQLITE3_VERSION detected as %SQLITE3_VERSION% + +if "%PY_INTERP_DEBUG%"=="yes" ( + set CONFIG=-d + set _D=_d +) else ( + set CONFIG= + set _D= +) + + +if "%DEBUG_C%"=="yes" ( + set PGO= +) else ( + set PGO=--pgo +) + +if "%PY_FREETHREADING%" == "yes" ( + set "FREETHREADING=--disable-gil" + set "THREAD=t" + set "EXE_T=%VER%t" +) else ( + set "FREETHREADING=" + set "THREAD=" + set "EXE_T=" +) + +:: AP doesn't support PGO atm? +set PGO= + +cd PCbuild + +:: Twice because: +:: error : importlib_zipimport.h updated. You will need to rebuild pythoncore to see the changes. +call build.bat %PGO% %CONFIG% %FREETHREADING% --experimental-jit-off -m -e -v -p %PLATFORM% +call build.bat %PGO% %CONFIG% %FREETHREADING% --experimental-jit-off -m -e -v -p %PLATFORM% +if errorlevel 1 exit 1 +cd .. diff --git a/recipe/build_base.sh b/recipe/build.sh similarity index 58% rename from recipe/build_base.sh rename to recipe/build.sh index 1e50db2dc..9878d60b9 100644 --- a/recipe/build_base.sh +++ b/recipe/build.sh @@ -152,8 +152,8 @@ if [[ "${CONDA_BUILD_CROSS_COMPILATION}" == "1" ]]; then CPP="${CC_FOR_BUILD} -E" \ CFLAGS="-O2 -I${BUILD_PREFIX}/include" \ CPPFLAGS="-O2 -I${BUILD_PREFIX}/include" \ - LDFLAGS=${LDFLAGS//${PREFIX}/${BUILD_PREFIX}} \ - PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig \ + LDFLAGS=${LDFLAGS//${PREFIX}/${BUILD_PREFIX}} \ + PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig \ AR="$(${CC_FOR_BUILD} --print-prog-name=ar)" \ RANLIB="$(${CC_FOR_BUILD} --print-prog-name=ranlib)" \ LD="$(${CC_FOR_BUILD} --print-prog-name=ld)" && \ @@ -330,29 +330,16 @@ pushd ${_buildd_static} ${_DISABLE_SHARED} "${_PROFILE_TASK[@]}" popd -if [[ "${CI}" == "travis" ]]; then - # Travis has issues with long logs - make -j${CPU_COUNT} -C ${_buildd_static} \ - EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ - ${_MAKE_TARGET} "${_PROFILE_TASK[@]}" 2>&1 >make-static.log -else - make -j${CPU_COUNT} -C ${_buildd_static} \ - EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ - ${_MAKE_TARGET} "${_PROFILE_TASK[@]}" 2>&1 | tee make-static.log -fi +make -j${CPU_COUNT} -C ${_buildd_static} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ + ${_MAKE_TARGET} "${_PROFILE_TASK[@]}" 2>&1 | tee make-static.log if rg "Failed to build these modules" make-static.log; then echo "(static) :: Failed to build some modules, check the log" exit 1 fi -if [[ "${CI}" == "travis" ]]; then - # Travis has issues with long logs - make -j${CPU_COUNT} -C ${_buildd_shared} \ - EXTRA_CFLAGS="${EXTRA_CFLAGS}" 2>&1 >make-shared.log -else - make -j${CPU_COUNT} -C ${_buildd_shared} \ - EXTRA_CFLAGS="${EXTRA_CFLAGS}" 2>&1 | tee make-shared.log -fi +make -j${CPU_COUNT} -C ${_buildd_shared} \ + EXTRA_CFLAGS="${EXTRA_CFLAGS}" 2>&1 | tee make-shared.log if rg "Failed to build these modules" make-shared.log; then echo "(shared) :: Failed to build some modules, check the log" exit 1 @@ -362,180 +349,3 @@ fi make -j${CPU_COUNT} -C ${_buildd_shared} \ EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ LIBRARY=libpython${VERABI_NO_DBG}-pic.a libpython${VERABI_NO_DBG}-pic.a - -make -C ${_buildd_static} install - -declare -a _FLAGS_REPLACE=() -if [[ ${_OPTIMIZED} == yes ]]; then - _FLAGS_REPLACE+=(-O3) - _FLAGS_REPLACE+=(-O2) - _FLAGS_REPLACE+=("-fprofile-use") - _FLAGS_REPLACE+=("") - _FLAGS_REPLACE+=("-fprofile-correction") - _FLAGS_REPLACE+=("") - _FLAGS_REPLACE+=("-L.") - _FLAGS_REPLACE+=("") - for _LTO_CFLAG in "${LTO_CFLAGS[@]}"; do - _FLAGS_REPLACE+=(${_LTO_CFLAG}) - _FLAGS_REPLACE+=("") - done -fi -# Install the shared library (for people who embed Python only, e.g. GDB). -# Linking module extensions to this on Linux is redundant (but harmless). -# Linking module extensions to this on Darwin is harmful (multiply defined symbols). -shopt -s extglob -cp -pf ${_buildd_shared}/libpython*${SHLIB_EXT}!(.lto) ${PREFIX}/lib/ -shopt -u extglob -if [[ ${target_platform} =~ .*linux.* ]]; then - ln -sf ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT}.1.0 ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} -fi - -SYSCONFIG=$(find ${_buildd_static}/$(cat ${_buildd_static}/pybuilddir.txt) -name "_sysconfigdata*.py" -print0) -cat ${SYSCONFIG} | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \ - "${_FLAGS_REPLACE[@]}" \ - > ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) -MAKEFILE=$(find ${PREFIX}/lib/python${VERABI_NO_DBG}/ -path "*config-*/Makefile" -print0) -cp ${MAKEFILE} /tmp/Makefile-$$ -cat /tmp/Makefile-$$ | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \ - "${_FLAGS_REPLACE[@]}" \ - > ${MAKEFILE} -# Check to see that our differences took. -# echo diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) -# diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) - -# Python installs python${VER}m and python${VER}, one as a hardlink to the other. conda-build breaks these -# by copying. Since the executable may be static it may be very large so change one to be a symlink -# of the other. In this case, python${VER}m will be the symlink. -if [[ -f ${PREFIX}/bin/python${VER}m ]]; then - rm -f ${PREFIX}/bin/python${VER}m - ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python${VER}m -fi -ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python -ln -s ${PREFIX}/bin/pydoc${VER} ${PREFIX}/bin/pydoc -# Workaround for https://github.com/conda/conda/issues/10969 -ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python3.1 - -# Remove test data to save space -# Though keep `support` as some things use that. -# TODO :: Make a subpackage for this once we implement multi-level testing. -pushd ${PREFIX}/lib/python${VERABI_NO_DBG} - mkdir test_keep - mv test/__init__.py test/support test/test_support* test/test_script_helper* test_keep/ - rm -rf test */test - mv test_keep test -popd - -# Size reductions: -pushd ${PREFIX} - if [[ -f lib/libpython${VERABI}.a ]]; then - chmod +w lib/libpython${VERABI}.a - ${STRIP} -S lib/libpython${VERABI}.a - fi - CONFIG_LIBPYTHON=$(find lib/python${VERABI_NO_DBG}/config-${VERABI}* -name "libpython${VERABI}.a") - if [[ -f lib/libpython${VERABI}.a ]] && [[ -f ${CONFIG_LIBPYTHON} ]]; then - chmod +w ${CONFIG_LIBPYTHON} - rm ${CONFIG_LIBPYTHON} - fi -popd - -# Copy sysconfig that gets recorded to a non-default name -# using the new compilers with python will require setting _PYTHON_SYSCONFIGDATA_NAME -# to the name of this file (minus the .py extension) -pushd "${PREFIX}"/lib/python${VERABI_NO_DBG} - # On Python 3.5 _sysconfigdata.py was getting copied in here and compiled for some reason. - # This breaks our attempt to find the right one as recorded_name. - find lib-dynload -name "_sysconfigdata*.py*" -exec rm {} \; - recorded_name=$(find . -name "_sysconfigdata*.py") - our_compilers_name=_sysconfigdata_$(echo ${HOST} | sed -e 's/[.-]/_/g').py - # So we can see if anything has significantly diverged by looking in a built package. - cp ${recorded_name} ${recorded_name}.orig - cp ${recorded_name} sysconfigfile - # fdebug-prefix-map for python work dir is useless for extensions - sed -i.bak "s@-fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/python-$PKG_VERSION@@g" sysconfigfile - sed -i.bak "s@-fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix@@g" sysconfigfile - # Append the conda-forge zoneinfo to the end - sed -i.bak "s@zoneinfo'@zoneinfo:$PREFIX/share/tzinfo'@g" sysconfigfile - # Remove osx sysroot as it depends on the build machine - # be sure CONDA_BUILD_SYSROOT has value, as other we will remove here instead spaces - if [[ "${target_platform}" == osx-* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then - sed -i.bak "s@-isysroot @@g" sysconfigfile - sed -i.bak "s@$CONDA_BUILD_SYSROOT @@g" sysconfigfile - fi - # Remove unfilled config option - sed -i.bak "s/@SGI_ABI@//g" sysconfigfile - sed -i.bak "s@$BUILD_PREFIX/bin/${HOST}-llvm-ar@${HOST}-ar@g" sysconfigfile - # Remove GNULD=yes to make sure new-dtags are not used - sed -i.bak "s/'GNULD': 'yes'/'GNULD': 'no'/g" sysconfigfile - cp sysconfigfile ${our_compilers_name} - - # For system gcc remove the triple - sed -i.bak "s@$HOST-c++@g++@g" sysconfigfile - sed -i.bak "s@$HOST-@@g" sysconfigfile - if [[ "$target_platform" == linux* ]]; then - # For linux, make sure the system gcc uses our linker - sed -i.bak "s@-pthread@-pthread -B $PREFIX/share/python_compiler_compat@g" sysconfigfile - fi - # Don't set -march and -mtune for system gcc - sed -i.bak "s@-march=[^( |\\\"|\\\')]*@@g" sysconfigfile - sed -i.bak "s@-mtune=[^( |\\\"|\\\')]*@@g" sysconfigfile - # Remove these flags that older compilers and linkers may not know - for flag in "-fstack-protector-strong" "-ffunction-sections" "-pipe" "-fno-plt" \ - "-ftree-vectorize" "-Wl,--sort-common" "-Wl,--as-needed" "-Wl,-z,relro" \ - "-Wl,-z,now" "-Wl,--disable-new-dtags" "-Wl,--gc-sections" "-Wl,-O2" \ - "-fPIE" "-ftree-vectorize" "-mssse3" "-Wl,-pie" "-Wl,-dead_strip_dylibs" \ - "-Wl,-headerpad_max_install_names"; do - sed -i.bak "s@$flag@@g" sysconfigfile - done - # Cleanup some extra spaces from above - sed -i.bak "s@' [ ]*@'@g" sysconfigfile - cp sysconfigfile $recorded_name - echo "========================sysconfig===========================" - cat $recorded_name - echo "============================================================" - - rm sysconfigfile - rm sysconfigfile.bak -popd - -if [[ ${HOST} =~ .*linux.* ]]; then - mkdir -p ${PREFIX}/share/python_compiler_compat - ln -s ${PREFIX}/bin/${HOST}-ld ${PREFIX}/share/python_compiler_compat/ld - echo "Files in this folder are to enhance backwards compatibility of anaconda software with older compilers." > ${PREFIX}/share/python_compiler_compat/README - echo "See: https://github.com/conda/conda/issues/6030 for more information." >> ${PREFIX}/share/python_compiler_compat/README -fi - -python -c "import compileall,os;compileall.compile_dir(os.environ['PREFIX'])" -rm ${PREFIX}/lib/libpython${VERABI}.a - -if [[ ${PY_INTERP_DEBUG} == yes ]]; then - rm ${PREFIX}/bin/python${VER} - ln -s ${PREFIX}/bin/python${VERABI} ${PREFIX}/bin/python${VER} - ln -s ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} ${PREFIX}/lib/libpython${VERABI_NO_DBG}${SHLIB_EXT} - ln -s ${PREFIX}/include/python${VERABI} ${PREFIX}/include/python${VER} -fi - -if [[ "$target_platform" == linux-* ]]; then - rm ${PREFIX}/include/uuid.h -fi - -# Workaround for https://github.com/conda/conda/issues/14053 -# Older conda versions install noarch: python packages in wrong places. -# For example python3.1 because older conda assumed python minor version -# will have only one digit. noarhc pkgs for freethreading builds are supposed -# to be installed into /lib/python3.13t/site-packages, but conda -# installs them to /lib/python3.13/site-packages. -# The workaround is to add all these wrong paths to sys.path using -# a pth file so that cpython and other tools like pip know about these -# locations to check when importing packages and uninstalling packages. -# When installing packages, pip will use the correct location -# /lib/python3.13t/site-packages. -# Note that these directories are not added to sys.path if they do not exist. -SP_DIR="${PREFIX}/lib/python${PY_VER}${THREAD}/site-packages" -if [[ ${PY_FREETHREADING} == yes ]]; then - echo "${PREFIX}/lib/python${PY_VER}/site-packages" >> $SP_DIR/conda-site.pth -fi -# Workaround for https://github.com/conda/conda/issues/10969 -echo "${PREFIX}/lib/python3.1/site-packages" >> $SP_DIR/conda-site.pth -# A python version independent directory that ABI3 and noarch packages can use. -# This is unused at the moment, but keeping it here for experimentation. -echo "${PREFIX}/lib/python/site-packages" >> $SP_DIR/conda-site.pth diff --git a/recipe/build_static.bat b/recipe/build_static.bat deleted file mode 100644 index e69de29bb..000000000 diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index b598257ea..15f3be949 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,11 +1,8 @@ -MACOSX_SDK_VERSION: # [osx and x86_64] - - 11.0 # [osx and x86_64] - # Override Python `zip_keys` python: - 3.13 numpy: - - 1.16 + - 2 python_impl: - cpython is_python_min: diff --git a/recipe/build_base.bat b/recipe/install_base.bat similarity index 86% rename from recipe/build_base.bat rename to recipe/install_base.bat index 0db4b77ca..bad166690 100644 --- a/recipe/build_base.bat +++ b/recipe/install_base.bat @@ -22,52 +22,20 @@ for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( set "VER=%%i.%%j" ) -:: Make sure the "python" value in conda_build_config.yaml is up to date. -for /F "tokens=1,2 delims=." %%i in ("%PKG_VERSION%") do ( - if NOT "%PY_VER%"=="%%i.%%j" exit 1 -) - -for /f "usebackq delims=" %%i in (`conda list -p %PREFIX% sqlite --no-show-channel-urls --json ^| findstr "version"`) do set SQLITE3_VERSION_LINE=%%i -for /f "tokens=2 delims==/ " %%i IN ('echo %SQLITE3_VERSION_LINE%') do (set SQLITE3_VERSION=%%~i) -echo SQLITE3_VERSION detected as %SQLITE3_VERSION% - if "%PY_INTERP_DEBUG%"=="yes" ( - set CONFIG=-d set _D=_d ) else ( - set CONFIG= set _D= ) - -if "%DEBUG_C%"=="yes" ( - set PGO= -) else ( - set PGO=--pgo -) - if "%PY_FREETHREADING%" == "yes" ( - set "FREETHREADING=--disable-gil" set "THREAD=t" set "EXE_T=%VER%t" ) else ( - set "FREETHREADING=" set "THREAD=" set "EXE_T=" ) -:: AP doesn't support PGO atm? -set PGO= - -cd PCbuild - -:: Twice because: -:: error : importlib_zipimport.h updated. You will need to rebuild pythoncore to see the changes. -call build.bat %PGO% %CONFIG% %FREETHREADING% --experimental-jit-off -m -e -v -p %PLATFORM% -call build.bat %PGO% %CONFIG% %FREETHREADING% --experimental-jit-off -m -e -v -p %PLATFORM% -if errorlevel 1 exit 1 -cd .. - :: 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 ( if exist %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x ( diff --git a/recipe/install_base.sh b/recipe/install_base.sh new file mode 100644 index 000000000..8a63fda18 --- /dev/null +++ b/recipe/install_base.sh @@ -0,0 +1,203 @@ +#!/bin/bash +set -ex + +if [[ ! -d ${SRC_DIR}/python-bin ]]; then + # Need an up-to-date python to build python. + # python 3.10 in miniforge is too old. + CONDA_SUBDIR=$build_platform conda create -p ${SRC_DIR}/python-bin python -c conda-forge --override-channels --yes --quiet + export PATH=${SRC_DIR}/python-bin/bin:${PATH} +fi + +VER=${PKG_VERSION%.*} + +_buildd_static=build-static +_buildd_shared=build-shared + +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + DBG=d +else + DBG= +fi + +if [[ ${PY_FREETHREADING} == yes ]]; then + # This Python will not be usable with non-free threading Python modules. + THREAD=t +else + THREAD= +fi + +VERABI=${VER}${THREAD}${DBG} +VERABI_NO_DBG=${VER}${THREAD} + +# This is the mechanism by which we fall back to default gcc, but having it defined here +# would probably break the build by using incorrect settings and/or importing files that +# do not yet exist. +unset _PYTHON_SYSCONFIGDATA_NAME +unset _CONDA_PYTHON_SYSCONFIGDATA_NAME + +make -C ${_buildd_static} install + +declare -a _FLAGS_REPLACE=() +if [[ ${_OPTIMIZED} == yes ]]; then + _FLAGS_REPLACE+=(-O3) + _FLAGS_REPLACE+=(-O2) + _FLAGS_REPLACE+=("-fprofile-use") + _FLAGS_REPLACE+=("") + _FLAGS_REPLACE+=("-fprofile-correction") + _FLAGS_REPLACE+=("") + _FLAGS_REPLACE+=("-L.") + _FLAGS_REPLACE+=("") + for _LTO_CFLAG in "${LTO_CFLAGS[@]}"; do + _FLAGS_REPLACE+=(${_LTO_CFLAG}) + _FLAGS_REPLACE+=("") + done +fi + +SYSCONFIG=$(find ${_buildd_static}/$(cat ${_buildd_static}/pybuilddir.txt) -name "_sysconfigdata*.py" -print0) +cat ${SYSCONFIG} | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \ + "${_FLAGS_REPLACE[@]}" \ + > ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) +MAKEFILE=$(find ${PREFIX}/lib/python${VERABI_NO_DBG}/ -path "*config-*/Makefile" -print0) +cp ${MAKEFILE} /tmp/Makefile-$$ +cat /tmp/Makefile-$$ | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \ + "${_FLAGS_REPLACE[@]}" \ + > ${MAKEFILE} +# Check to see that our differences took. +# echo diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) +# diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) + +# Python installs python${VER}m and python${VER}, one as a hardlink to the other. conda-build breaks these +# by copying. Since the executable may be static it may be very large so change one to be a symlink +# of the other. In this case, python${VER}m will be the symlink. +if [[ -f ${PREFIX}/bin/python${VER}m ]]; then + rm -f ${PREFIX}/bin/python${VER}m + ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python${VER}m +fi +ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python +ln -s ${PREFIX}/bin/pydoc${VER} ${PREFIX}/bin/pydoc +# Workaround for https://github.com/conda/conda/issues/10969 +ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python3.1 + +# Remove test data to save space +# Though keep `support` as some things use that. +# TODO :: Make a subpackage for this once we implement multi-level testing. +pushd ${PREFIX}/lib/python${VERABI_NO_DBG} + mkdir test_keep + mv test/__init__.py test/support test/test_support* test/test_script_helper* test_keep/ + rm -rf test */test + mv test_keep test +popd + +# Size reductions: +pushd ${PREFIX} + if [[ -f lib/libpython${VERABI}.a ]]; then + chmod +w lib/libpython${VERABI}.a + ${STRIP} -S lib/libpython${VERABI}.a + fi + CONFIG_LIBPYTHON=$(find lib/python${VERABI_NO_DBG}/config-${VERABI}* -name "libpython${VERABI}.a") + if [[ -f lib/libpython${VERABI}.a ]] && [[ -f ${CONFIG_LIBPYTHON} ]]; then + chmod +w ${CONFIG_LIBPYTHON} + rm ${CONFIG_LIBPYTHON} + fi +popd + +# Copy sysconfig that gets recorded to a non-default name +# using the new compilers with python will require setting _PYTHON_SYSCONFIGDATA_NAME +# to the name of this file (minus the .py extension) +pushd "${PREFIX}"/lib/python${VERABI_NO_DBG} + # On Python 3.5 _sysconfigdata.py was getting copied in here and compiled for some reason. + # This breaks our attempt to find the right one as recorded_name. + find lib-dynload -name "_sysconfigdata*.py*" -exec rm {} \; + recorded_name=$(find . -name "_sysconfigdata*.py") + our_compilers_name=_sysconfigdata_$(echo ${HOST} | sed -e 's/[.-]/_/g').py + # So we can see if anything has significantly diverged by looking in a built package. + cp ${recorded_name} ${recorded_name}.orig + cp ${recorded_name} sysconfigfile + # fdebug-prefix-map for python work dir is useless for extensions + sed -i.bak "s@-fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/python-$PKG_VERSION@@g" sysconfigfile + sed -i.bak "s@-fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix@@g" sysconfigfile + # Append the conda-forge zoneinfo to the end + sed -i.bak "s@zoneinfo'@zoneinfo:$PREFIX/share/tzinfo'@g" sysconfigfile + # Remove osx sysroot as it depends on the build machine + # be sure CONDA_BUILD_SYSROOT has value, as other we will remove here instead spaces + if [[ "${target_platform}" == osx-* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then + sed -i.bak "s@-isysroot @@g" sysconfigfile + sed -i.bak "s@$CONDA_BUILD_SYSROOT @@g" sysconfigfile + fi + # Remove unfilled config option + sed -i.bak "s/@SGI_ABI@//g" sysconfigfile + sed -i.bak "s@$BUILD_PREFIX/bin/${HOST}-llvm-ar@${HOST}-ar@g" sysconfigfile + # Remove GNULD=yes to make sure new-dtags are not used + sed -i.bak "s/'GNULD': 'yes'/'GNULD': 'no'/g" sysconfigfile + cp sysconfigfile ${our_compilers_name} + + # For system gcc remove the triple + sed -i.bak "s@$HOST-c++@g++@g" sysconfigfile + sed -i.bak "s@$HOST-@@g" sysconfigfile + if [[ "$target_platform" == linux* ]]; then + # For linux, make sure the system gcc uses our linker + sed -i.bak "s@-pthread@-pthread -B $PREFIX/share/python_compiler_compat@g" sysconfigfile + fi + # Don't set -march and -mtune for system gcc + sed -i.bak "s@-march=[^( |\\\"|\\\')]*@@g" sysconfigfile + sed -i.bak "s@-mtune=[^( |\\\"|\\\')]*@@g" sysconfigfile + # Remove these flags that older compilers and linkers may not know + for flag in "-fstack-protector-strong" "-ffunction-sections" "-pipe" "-fno-plt" \ + "-ftree-vectorize" "-Wl,--sort-common" "-Wl,--as-needed" "-Wl,-z,relro" \ + "-Wl,-z,now" "-Wl,--disable-new-dtags" "-Wl,--gc-sections" "-Wl,-O2" \ + "-fPIE" "-ftree-vectorize" "-mssse3" "-Wl,-pie" "-Wl,-dead_strip_dylibs" \ + "-Wl,-headerpad_max_install_names"; do + sed -i.bak "s@$flag@@g" sysconfigfile + done + # Cleanup some extra spaces from above + sed -i.bak "s@' [ ]*@'@g" sysconfigfile + cp sysconfigfile $recorded_name + echo "========================sysconfig===========================" + cat $recorded_name + echo "============================================================" + + rm sysconfigfile + rm sysconfigfile.bak +popd + +if [[ ${HOST} =~ .*linux.* ]]; then + mkdir -p ${PREFIX}/share/python_compiler_compat + ln -s ${PREFIX}/bin/${HOST}-ld ${PREFIX}/share/python_compiler_compat/ld + echo "Files in this folder are to enhance backwards compatibility of anaconda software with older compilers." > ${PREFIX}/share/python_compiler_compat/README + echo "See: https://github.com/conda/conda/issues/6030 for more information." >> ${PREFIX}/share/python_compiler_compat/README +fi + +python -c "import compileall,os;compileall.compile_dir(os.environ['PREFIX'])" +rm ${PREFIX}/lib/libpython${VERABI}.a + +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + rm ${PREFIX}/bin/python${VER} + ln -s ${PREFIX}/bin/python${VERABI} ${PREFIX}/bin/python${VER} + ln -s ${PREFIX}/include/python${VERABI} ${PREFIX}/include/python${VER} +fi + +if [[ "$target_platform" == linux-* ]]; then + rm ${PREFIX}/include/uuid.h +fi + +# Workaround for https://github.com/conda/conda/issues/14053 +# Older conda versions install noarch: python packages in wrong places. +# For example python3.1 because older conda assumed python minor version +# will have only one digit. noarhc pkgs for freethreading builds are supposed +# to be installed into /lib/python3.13t/site-packages, but conda +# installs them to /lib/python3.13/site-packages. +# The workaround is to add all these wrong paths to sys.path using +# a pth file so that cpython and other tools like pip know about these +# locations to check when importing packages and uninstalling packages. +# When installing packages, pip will use the correct location +# /lib/python3.13t/site-packages. +# Note that these directories are not added to sys.path if they do not exist. +SP_DIR="${PREFIX}/lib/python${PY_VER}${THREAD}/site-packages" +if [[ ${PY_FREETHREADING} == yes ]]; then + echo "${PREFIX}/lib/python${PY_VER}/site-packages" >> $SP_DIR/conda-site.pth +fi +# Workaround for https://github.com/conda/conda/issues/10969 +echo "${PREFIX}/lib/python3.1/site-packages" >> $SP_DIR/conda-site.pth +# A python version independent directory that ABI3 and noarch packages can use. +# This is unused at the moment, but keeping it here for experimentation. +echo "${PREFIX}/lib/python/site-packages" >> $SP_DIR/conda-site.pth diff --git a/recipe/install_shared.sh b/recipe/install_shared.sh new file mode 100644 index 000000000..b04c6fe81 --- /dev/null +++ b/recipe/install_shared.sh @@ -0,0 +1,45 @@ +#!/bin/bash +set -ex + +_buildd_shared=build-shared +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + DBG=d +else + DBG= +fi +if [[ ${PY_FREETHREADING} == yes ]]; then + # This Python will not be usable with non-free threading Python modules. + THREAD=t +else + THREAD= +fi + +VER=${PKG_VERSION%.*} +ABIFLAGS=${DBG}${THREAD} +VERABI=${VER}${THREAD}${DBG} +VERABI_NO_DBG=${VER}${THREAD} + +# Install the shared library (for people who embed Python only, e.g. GDB). +# Linking module extensions to this on Linux is redundant (but harmless). +# Linking module extensions to this on Darwin is harmful (multiply defined symbols). +shopt -s extglob +cp -pf ${_buildd_shared}/libpython*${SHLIB_EXT}!(.lto) ${PREFIX}/lib/ +shopt -u extglob +if [[ ${target_platform} =~ .*linux.* ]]; then + ln -sf ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT}.1.0 ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} +fi +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + ln -s ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} ${PREFIX}/lib/libpython${VERABI_NO_DBG}${SHLIB_EXT} +fi + +# create libpython3.dylib; linux builds only add this in release mode, do the same on osx +if [[ "$target_platform" == osx-* && ${PY_INTERP_DEBUG} == no ]]; then + awk -F',' '$1 == "func" || $1 == "data" { print "_" $2 }' Doc/data/stable_abi.dat > stable_abi_exports.txt + + $CC -dynamiclib \ + -install_name @rpath/libpython3.dylib \ + -compatibility_version 3.0 -current_version ${PY_VER}.0 \ + -Wl,-reexport_library,${PREFIX}/lib/libpython${VERABI}.dylib \ + -Wl,-exported_symbols_list,stable_abi_exports.txt \ + -o ${PREFIX}/lib/libpython3.dylib +fi diff --git a/recipe/build_static.sh b/recipe/install_static.sh similarity index 100% rename from recipe/build_static.sh rename to recipe/install_static.sh diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 3a0161dd9..733e27b35 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -39,6 +39,24 @@ {% set site_packages_path = "lib/python" + ver2 + "/site-packages" %} {% endif %} +# CMake needs to be told that the debug/freethreading ABI is fine; the option takes a 4-tuple, +# Python_FIND_ABI=;;;; for details see +# https://cmake.org/cmake/help/latest/module/FindPython.html#hints +{% set cmake_test_args=" -DPython_FIND_ABI=\"" ~ ("ON" if build_type == "debug" else "OFF") ~ ";ANY;ANY;" ~ ("ON" if freethreading == "yes" else "OFF") ~ "\"" %} +{% if unix %} + # for CMake invocations during testing, we need to avoid accidentally picking up python versions from + # the image, but we don't want to use `${CMAKE_ARGS}` from the compiler activation, because that contains + # `CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER`; while that's useful for building (i.e. don't look in `host:`, + # because we want to use binaries from `build:`), we want the exact opposite when running tests. + {% set cmake_test_args=cmake_test_args ~ " -DCMAKE_POLICY_DEFAULT_CMP0094=NEW -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=ONLY -DCMAKE_FIND_ROOT_PATH=${PREFIX}" %} +{% endif %} + +# extremely noisy; only use if needing to debug how CMake finds our libraries +{% set cmake_debug = "" %} +{% if False %} + {% set cmake_debug = "--debug-find --trace --debug-output --debug-trycompile" %} +{% endif %} + package: name: python-split version: {{ version }}{{ dev }} @@ -80,17 +98,64 @@ source: build: number: {{ build_number }} + python_site_packages_path: {{ site_packages_path }} + script_env: + - PY_INTERP_DEBUG={{ py_interp_debug }} + - PY_FREETHREADING={{ freethreading }} requirements: build: - - patch # [not win] - - m2-patch # [win] - - m2-gcc-libs # [win] + - {{ stdlib('c') }} + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - libtool # [unix] + - make # [unix] + - pkg-config # [unix] + - ld_impl_{{ target_platform }} # [linux] + - binutils_impl_{{ target_platform }} # [linux] + - clang-18 # [unix] + - clang 18.* # [win] + # configure script looks for llvm-ar for lto + - llvm-tools # [osx] + - llvm-tools-18 # [unix] + - llvm-tools 18.* # [win] + - bzip2 # [build_platform != target_platform] + - expat # [build_platform != target_platform] + - libffi # [build_platform != target_platform] + - liblzma-devel # [build_platform != target_platform] + - libmpdec-devel # [build_platform != target_platform] + - libsqlite # [build_platform != target_platform] + - libuuid # [build_platform != target_platform and linux] + - libxcrypt # [build_platform != target_platform and linux] + - ncurses # [build_platform != target_platform and unix] + - openssl # [build_platform != target_platform] + - readline # [build_platform != target_platform and unix] + - tk # [build_platform != target_platform] + - zlib # [build_platform != target_platform] + - zstd # [build_platform != target_platform] + host: + - ld_impl_{{ target_platform }} >=2.36 # [linux] + - bzip2 + - expat + - libffi + - liblzma-devel + - libmpdec-devel + - libsqlite + - libuuid # [linux] + - ncurses # [unix] + - openssl + - readline # [unix] + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 # [unix] + - xorg-xorgproto # [unix] + - zlib + - zstd outputs: - name: python - script: build_base.sh # [unix] - script: build_base.bat # [win] + script: install_base.sh # [unix] + script: install_base.bat # [win] build: number: {{ build_number }} activate_in_script: true @@ -146,33 +211,12 @@ outputs: - '**/api-ms-win-core-path-l1-1-0.dll' # [win] requirements: build: - - {{ compiler('c') }} - {{ stdlib('c') }} + - {{ compiler('c') }} - {{ compiler('cxx') }} - make # [not win] - - libtool # [unix] - - pkg-config # [not win] - # configure script looks for llvm-ar for lto - - llvm-tools # [osx] - - ld_impl_{{ target_platform }} # [linux] - - binutils_impl_{{ target_platform }} # [linux] - - clang-18 # [not win] - - llvm-tools-18 # [not win] - - clang 18.* # [win] - - llvm-tools 18.* # [win] - - bzip2 # [build_platform != target_platform] - - libsqlite # [build_platform != target_platform] - - liblzma-devel # [build_platform != target_platform] - - zlib # [build_platform != target_platform] - - openssl # [build_platform != target_platform] - - readline # [not win and build_platform != target_platform] - - tk # [build_platform != target_platform] - - ncurses # [unix and build_platform != target_platform] - - libffi # [build_platform != target_platform] - - libuuid # [linux and build_platform != target_platform] - - libxcrypt # [linux and build_platform != target_platform] - - expat # [build_platform != target_platform] host: + - {{ pin_subpackage('libpython', exact=True) }} - bzip2 - libsqlite - liblzma-devel @@ -190,6 +234,7 @@ outputs: - libmpdec-devel - expat run: + - {{ pin_subpackage('libpython', exact=True) }} - ld_impl_{{ target_platform }} >=2.36.1 # [linux] - tzdata {% if dev != '' %} @@ -204,16 +249,18 @@ outputs: - ripgrep - cmake - ninja + # Pin to the openssl version used during the build to check whether + # we load the conda-forge version. + - openssl {{ openssl }} + - {{ stdlib('c') }} - {{ compiler('c') }} # Tried to use enable_language(C) to avoid needing this. It does not work. - {{ compiler('cxx') }} - - {{ stdlib('c') }} # For tkinter, but we expect from system - xorg-libx11 # [unix] files: - tests/cmake/* - tests/cython/* - - tests/prefix-replacement/* - run_test.py commands: - echo on # [win] @@ -239,8 +286,8 @@ outputs: - _CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_conda_linux_gnu python -c "import sysconfig; print(sysconfig.get_config_var('CC'))" # [linux64] # check for unreplaced @ symbols in sysconfig files, excluding e.g. '"$@".lto' - for f in ${CONDA_PREFIX}/lib/python*/_sysconfig*.py; do echo "Checking $f:"; if [[ `rg @[^@]*@ $f` ]]; then echo "FAILED ON $f"; cat $f; exit 1; fi; done # [linux64 or osx] - - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.a # [unix] - - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.nolto.a # [unix] + - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.a # [unix] + - test ! -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}.nolto.a # [unix] {% if freethreading == "yes" %} - if not exist %PREFIX%\\libs\\python3t.lib exit 1 # [win] - if not exist %PREFIX%\\libs\\python{{ ver2nd }}t.lib exit 1 # [win] @@ -257,14 +304,8 @@ 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 -{% if freethreading == "no" %} - # TODO: use the new FindPython3 which supports freethreading - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . -{% endif %} + - cmake -GNinja {{ cmake_test_args }} -DPY_VER={{ version }} -DEXTRA_COMPONENTS="Development.Module" {{ cmake_debug }} . - popd - popd - python run_test.py @@ -275,9 +316,74 @@ outputs: # Test for wide character supported via ncursesw - TERM=xterm >/dev/null python -c "import curses; scr = curses.initscr(); curses.unget_wch('x'); assert 'x' == scr.get_wch()" # [unix] + - name: libpython + script: install_shared.sh # [unix] + files: # [win] + - python3.dll # [win] + - python3t.dll # [win] + - python{{ ver2nd }}.dll # [win] + - python{{ ver2nd }}t.dll # [win] + build: + number: {{ build_number }} + activate_in_script: true + ignore_run_exports: + - python_abi + script_env: + - PY_INTERP_DEBUG={{ py_interp_debug }} + - PY_FREETHREADING={{ freethreading }} + string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ debug }}_{{ abi_tag }} + requirements: + build: + - {{ stdlib('c') }} + - {{ 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] +{% if freethreading == "yes" %} + - VERABI=${VERABI}t # [not win] +{% endif %} + - VERABI_NO_DBG=${VERABI} # [not win] +{% if py_interp_debug == "yes" %} + - VERABI=${VERABI}d # [not win] +{% endif %} + - test -f ${PREFIX}/lib/libpython${VERABI}.so # [linux] + - test -f ${PREFIX}/lib/libpython${VERABI}.dylib # [osx] + - test -f ${PREFIX}/lib/libpython3.so # [linux and build_type == "release"] + - test -f ${PREFIX}/lib/libpython3.dylib # [osx and build_type == "release"] + {% if freethreading == "yes" %} + - if not exist %PREFIX%\python3t.dll exit 1 # [win] + - if not exist %PREFIX%\python{{ ver2nd }}t.dll exit 1 # [win] + {% else %} + - 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: build_static.sh # [unix] - script: build_static.bat # [win] + script: install_static.sh # [unix] build: number: {{ build_number }} activate_in_script: true @@ -298,10 +404,16 @@ outputs: - {{ pin_subpackage('python', exact=True) }} test: files: + - tests/cmake/* - tests/prefix-replacement/* requires: - {{ stdlib('c') }} - {{ compiler('c') }} + # cmake expects a C++ compiler for some reason + - {{ compiler('cxx') }} + - ripgrep + - cmake + - ninja commands: - VER=${PKG_VERSION%.*} # [not win] - VERABI=${VER} # [not win] @@ -315,9 +427,14 @@ outputs: - test -f ${PREFIX}/lib/libpython${VERABI}.a # [unix] - test -f ${PREFIX}/lib/libpython${VERABI_NO_DBG}.nolto.a # [unix] - test -f ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-darwin/libpython${VERABI}.a # [osx] - - pushd tests/prefix-replacement # [unix] - - bash build-and-test.sh # [unix] - - popd # [unix] + - 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: cpython build: diff --git a/recipe/run_test.py b/recipe/run_test.py index 50b64868e..6c63c815e 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -101,8 +101,8 @@ import ssl print('OPENSSL_VERSION:', ssl.OPENSSL_VERSION) -CONDA_OPENSSL_VERSION = os.getenv('openssl').split(".")[0] -assert CONDA_OPENSSL_VERSION in ssl.OPENSSL_VERSION +CONDA_OPENSSL_VERSION = os.getenv('openssl') +assert CONDA_OPENSSL_VERSION in ssl.OPENSSL_VERSION, f"{CONDA_OPENSSL_VERSION} not found in {ssl.OPENSSL_VERSION}" # See https://github.com/conda-forge/python-feedstock/issues/718 for context: assert sys.hash_info.algorithm.startswith("siphash") diff --git a/recipe/tests/cmake/CMakeLists.txt b/recipe/tests/cmake/CMakeLists.txt index a13e20ae1..f3e41560c 100644 --- a/recipe/tests/cmake/CMakeLists.txt +++ b/recipe/tests/cmake/CMakeLists.txt @@ -1,16 +1,10 @@ -# https://martinopilia.com/posts/2018/09/15/building-python-extension.html -# FindPythonInterp and FindPythonLibs are deprecated since cmake 3.12 -# These can be replaced by find_package(Python ${PY_VER} REQUIRED) -# But these are still used by other packages, so we keep them. +# https://scikit-build-core.readthedocs.io/en/latest/guide/cmakelists.html#finding-python cmake_minimum_required(VERSION 3.10) enable_language(C) project(mymath) -option(PY_VER, "Python version to use") +option(PY_VER "Python version to use") +option(EXTRA_COMPONENTS "Additional Python components to check for") -find_package(PythonInterp ${PY_VER} REQUIRED) -# PATHS $ENV{CONDA_PREFIX} - -# This goes after, since it uses PythonInterp as hint -find_package(PythonLibs ${PY_VER} REQUIRED) +find_package(Python ${PY_VER} COMPONENTS Interpreter ${EXTRA_COMPONENTS} REQUIRED) diff --git a/recipe/tests/prefix-replacement/build-and-test.sh b/recipe/tests/prefix-replacement/build-and-test.sh index 633b741a3..d710bde75 100644 --- a/recipe/tests/prefix-replacement/build-and-test.sh +++ b/recipe/tests/prefix-replacement/build-and-test.sh @@ -2,46 +2,47 @@ set -ex -if [[ "$PKG_NAME" == "libpython-static" ]]; then - # see bpo44182 for why -L${CONDA_PREFIX}/lib is added - ${CC} a.c $(python3-config --cflags) $(python3-config --embed --ldflags) -L${CONDA_PREFIX}/lib -o ${CONDA_PREFIX}/bin/embedded-python-static - if [[ "$target_platform" == linux-* ]]; then - if ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then - echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." - fi - elif [[ "$target_platform" == osx-* ]]; then - if ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then - echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." - fi - fi - ${CONDA_PREFIX}/bin/embedded-python-static - - # I thought this would prefer the shared library for Python. I was wrong: - # EMBED_LDFLAGS=$(python3-config --ldflags) - # re='^(.*)(-lpython[^ ]*)(.*)$' - # if [[ ${EMBED_LDFLAGS} =~ $re ]]; then - # EMBED_LDFLAGS="${BASH_REMATCH[1]} ${BASH_REMATCH[3]} -Wl,-Bdynamic ${BASH_REMATCH[2]}" - # fi - # ${CC} a.c $(python3-config --cflags) ${EMBED_LDFLAGS} -o ${CONDA_PREFIX}/bin/embedded-python-shared +case ${PKG_NAME} in + libpython) + # see bpo44182 for why -L${CONDA_PREFIX}/lib is added + ${CC} a.c $(python3-config --cflags) \ + $(python3-config --embed --ldflags) \ + -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib \ + -o ${CONDA_PREFIX}/bin/embedded-python-shared - # Brute-force way of linking to the shared library, sorry! - rm -rf ${CONDA_PREFIX}/lib/libpython*.a -fi + if [[ "$target_platform" == linux-* ]]; then + if ! ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi + elif [[ "$target_platform" == osx-* ]]; then + if ! ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then + echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." + fi + fi + ${CONDA_PREFIX}/bin/embedded-python-shared + ;; -${CC} a.c $(python3-config --cflags) \ - $(python3-config --embed --ldflags) \ - -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib \ - -o ${CONDA_PREFIX}/bin/embedded-python-shared + libpython-static) + ${CC} a.c $(python3-config --cflags) \ + $(python3-config --embed --ldflags) \ + -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib \ + -o ${CONDA_PREFIX}/bin/embedded-python-static + if [[ "$target_platform" == linux-* ]]; then + if ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + elif [[ "$target_platform" == osx-* ]]; then + if ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-static | rg libpython; then + echo "ERROR :: Embedded python linked to shared python library. It is expected to link to the static library." + fi + fi + ${CONDA_PREFIX}/bin/embedded-python-static + ;; -if [[ "$target_platform" == linux-* ]]; then - if ! ${READELF} -d ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then - echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." - fi -elif [[ "$target_platform" == osx-* ]]; then - if ! ${OTOOL} -l ${CONDA_PREFIX}/bin/embedded-python-shared | rg libpython; then - echo "ERROR :: Embedded python linked to static python library. We tried to force it to use the shared library." - fi -fi -${CONDA_PREFIX}/bin/embedded-python-shared + *) + # invalid package + exit 1 + ;; +esac set +x