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 53c8548d6..0f53d9b4c 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 @@ -1,5 +1,3 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' MACOSX_SDK_VERSION: - '11.0' build_type: 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 90e346d70..aaa11910b 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 @@ -1,5 +1,3 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' MACOSX_SDK_VERSION: - '11.0' build_type: 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 eafd3c5c2..78aa874c5 100644 --- a/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml +++ b/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml @@ -1,5 +1,3 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' MACOSX_SDK_VERSION: - '11.0' build_type: 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 375254106..3919c826b 100644 --- a/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml +++ b/.ci_support/osx_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml @@ -1,5 +1,3 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' MACOSX_SDK_VERSION: - '11.0' build_type: 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 d478a9687..39342566a 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 @@ -1,5 +1,3 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' MACOSX_SDK_VERSION: - '11.0' build_type: 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 4de2bb1b6..c1e4581fe 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 @@ -1,5 +1,3 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' MACOSX_SDK_VERSION: - '11.0' build_type: 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 6a27cf528..c3655d647 100644 --- a/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml +++ b/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno.yaml @@ -1,5 +1,3 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' MACOSX_SDK_VERSION: - '11.0' build_type: 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 40032eca1..f9b22c690 100644 --- a/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml +++ b/.ci_support/osx_arm64_build_typereleasechannel_targetsconda-forge_mainfreethreadingyes.yaml @@ -1,5 +1,3 @@ -MACOSX_DEPLOYMENT_TARGET: -- '11.0' MACOSX_SDK_VERSION: - '11.0' build_type: diff --git a/.gitattributes b/.gitattributes index 85ccb8f4f..79144109a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,18 +8,11 @@ bld.bat text eol=crlf # github helper pieces to make some files not show up in diffs automatically .azure-pipelines/* linguist-generated=true -.circleci/* linguist-generated=true .ci_support/README linguist-generated=true -.drone/* linguist-generated=true -.drone.yml linguist-generated=true .github/* linguist-generated=true -.travis/* linguist-generated=true -.appveyor.yml linguist-generated=true .gitattributes linguist-generated=true .gitignore linguist-generated=true -.travis.yml linguist-generated=true .scripts/* linguist-generated=true -.woodpecker.yml linguist-generated=true /LICENSE.txt linguist-generated=true /README.md linguist-generated=true azure-pipelines.yml linguist-generated=true diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index da447dcc0..203d608a4 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -272,6 +272,8 @@ jobs: run: | if [[ "$(uname -m)" == "x86_64" ]]; then docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + elif [[ "$(uname -m)" == "aarch64" ]]; then + docker run --rm --privileged --entrypoint /opt/docker/bin/register-binfmt ${{ matrix.DOCKER_IMAGE }} aarch64 fi - name: Build on Linux diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 28dfd13df..76c2b336a 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -9,17 +9,23 @@ set -xeuo pipefail export FEEDSTOCK_ROOT="${FEEDSTOCK_ROOT:-/home/conda/feedstock_root}" +# ensure absolute path +FEEDSTOCK_ROOT=$(cd "${FEEDSTOCK_ROOT}"; pwd) source ${FEEDSTOCK_ROOT}/.scripts/logging_utils.sh ( endgroup "Start Docker" ) 2> /dev/null -( startgroup "Configuring conda" ) 2> /dev/null +( startgroup "Configuring build environment" ) 2> /dev/null +MINIFORGE_HOME=/opt/conda export PYTHONUNBUFFERED=1 export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" +# ensure absolute path +RECIPE_ROOT=$(cd "${RECIPE_ROOT}"; pwd) export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" +export PIXI_CACHE_DIR="${MINIFORGE_HOME}" export RATTLER_CACHE_DIR="${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache" cat >~/.condarc < /opt/conda/conda-meta/history -micromamba install --root-prefix ~/.conda --prefix /opt/conda \ - --yes --override-channels --channel conda-forge --strict-channel-priority \ + +( endgroup "Configuring build environment" ) 2> /dev/null + +( startgroup "Provisioning base env with micromamba" ) 2> /dev/null + +MAMBA_ROOT_PREFIX=~/.conda +MICROMAMBA_EXE=micromamba + +echo Creating environment +mv "${MINIFORGE_HOME}"/conda-meta/history "${MINIFORGE_HOME}"/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S) +echo > "${MINIFORGE_HOME}"/conda-meta/history +"${MICROMAMBA_EXE}" install --yes --root-prefix "${MAMBA_ROOT_PREFIX}" --prefix "${MINIFORGE_HOME}" \ + --override-channels --channel conda-forge --strict-channel-priority \ pip python=3.14 conda-build conda-forge-ci-setup=4 "conda-build>=26.3" + +( endgroup "Provisioning base env with micromamba" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 -# set up the condarc + + +# Set basic configuration +echo Setting up configuration setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" +# Linux-specific setup +echo Running build setup source run_conda_forge_build_setup -# make the build number clobber -make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" - if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${HOST_PLATFORM}" != linux-* ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" fi @@ -57,7 +78,8 @@ fi ( endgroup "Configuring conda" ) 2> /dev/null if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then - cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" + echo Copying feedstock license + cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" fi if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then @@ -69,48 +91,49 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # - none vs. --target-platform CONDA_SUBDIR="${BUILD_PLATFORM}" conda debug \ "${RECIPE_ROOT}" \ - -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + -m "${CONFIG_FILE}" \ ${EXTRA_CB_OPTIONS:-} \ ${BUILD_OUTPUT_ID:+--output-id "${BUILD_OUTPUT_ID}"} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" # Drop into an interactive shell /bin/bash -else - # differences between conda-build vs. rattler-build - # - recipe is positional vs. --recipe "${RECIPE_ROOT}" - # - --suppress-variables vs. none - # - --clobber-file vs. none - # - none vs. --target-platform - # - --extra-meta a=b c=d vs. --extra-meta a=b --extra-meta c=d - CONDA_SUBDIR="${BUILD_PLATFORM}" conda-build \ - "${RECIPE_ROOT}" \ - -m "${CI_SUPPORT}/${CONFIG}.yaml" \ - ${EXTRA_CB_OPTIONS:-} \ - --suppress-variables \ - --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ - --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" - ( startgroup "Inspecting artifacts" ) 2> /dev/null +fi - # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 - command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir "${RECIPE_ROOT}" -m "${CONFIG_FILE}" || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" +# Build the recipe +echo Building recipe - ( endgroup "Inspecting artifacts" ) 2> /dev/null - ( startgroup "Validating outputs" ) 2> /dev/null +# differences between conda-build vs. rattler-build +# - recipe is positional vs. --recipe "${RECIPE_ROOT}" +# - --suppress-variables vs. none +# - --clobber-file vs. none +# - none vs. --target-platform +# - --extra-meta a=b c=d vs. --extra-meta a=b --extra-meta c=d - validate_recipe_outputs "${FEEDSTOCK_NAME}" +CONDA_SUBDIR="${BUILD_PLATFORM}" conda-build \ + "${RECIPE_ROOT}" \ + -m "${CONFIG_FILE}" \ + ${EXTRA_CB_OPTIONS:-} \ + --suppress-variables \ + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ + --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" - ( endgroup "Validating outputs" ) 2> /dev/null +( startgroup "Inspecting artifacts" ) 2> /dev/null - ( startgroup "Uploading packages" ) 2> /dev/null +# inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 +command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir "${RECIPE_ROOT}" -m "${CONFIG_FILE}" || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" - if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then - upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" - fi +( endgroup "Inspecting artifacts" ) 2> /dev/null +( startgroup "Validating outputs" ) 2> /dev/null +validate_recipe_outputs "${FEEDSTOCK_NAME}" +( endgroup "Validating outputs" ) 2> /dev/null +if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then + ( startgroup "Uploading packages" ) 2> /dev/null + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" ( endgroup "Uploading packages" ) 2> /dev/null fi -( startgroup "Final checks" ) 2> /dev/null +( startgroup "Leaving the Docker container" ) 2> /dev/null touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh index aff009f0c..c39888ea7 100755 --- a/.scripts/logging_utils.sh +++ b/.scripts/logging_utils.sh @@ -10,9 +10,6 @@ function startgroup { case ${CI:-} in azure ) echo "##[group]$1";; - travis ) - echo "$1" - echo -en 'travis_fold:start:'"${1// /}"'\r';; github_actions ) echo "::group::$1";; * ) @@ -27,8 +24,6 @@ function endgroup { case ${CI:-} in azure ) echo "##[endgroup]";; - travis ) - echo -en 'travis_fold:end:'"${1// /}"'\r';; github_actions ) echo "::endgroup::";; esac diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 17d983f11..4715f5df4 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -84,9 +84,9 @@ VOLUME_SUFFIX=",z" # Podman-specific handling if [ "${DOCKER_EXECUTABLE}" = "podman" ]; then - # Fix file permissions for rootless podman builds - podman unshare chown -R ${HOST_USER_ID}:${HOST_USER_ID} "${ARTIFACTS}" - podman unshare chown -R ${HOST_USER_ID}:${HOST_USER_ID} "${RECIPE_ROOT}" + # Fix file permissions for rootless podman builds. In addition to `recipe/` + # and `build_artifacts`, `.scripts` also needs to be available in the container. + podman unshare chown -R ${HOST_USER_ID}:${HOST_USER_ID} "${FEEDSTOCK_ROOT}" # Add SELinux label only if enforcing if command -v getenforce &>/dev/null && [ "$(getenforce)" = "Enforcing" ]; then @@ -143,4 +143,4 @@ ${DOCKER_EXECUTABLE} run ${DOCKER_RUN_ARGS} \ test -f "$DONE_CANARY" # This closes the last group opened in `build_steps.sh` -( endgroup "Final checks" ) 2> /dev/null +( endgroup "Leaving the Docker container" ) 2> /dev/null diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index aff5569d0..9a08751fe 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -1,139 +1,178 @@ #!/usr/bin/env bash +# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +# benefit from the improvement. + # -*- mode: jinja-shell -*- -source .scripts/logging_utils.sh +set -xeuo pipefail +export FEEDSTOCK_ROOT=${PWD} +source ${FEEDSTOCK_ROOT}/.scripts/logging_utils.sh + -set -xe +( startgroup "Configuring build environment" ) 2> /dev/null MINIFORGE_HOME="${MINIFORGE_HOME:-${HOME}/miniforge3}" MINIFORGE_HOME="${MINIFORGE_HOME%/}" # remove trailing slash export CONDA_BLD_PATH="${CONDA_BLD_PATH:-${MINIFORGE_HOME}/conda-bld}" +export RECIPE_ROOT="recipe" +# ensure absolute path +RECIPE_ROOT=$(cd "${RECIPE_ROOT}"; pwd) +export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" +export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" +export PIXI_CACHE_DIR="${MINIFORGE_HOME}" +export RATTLER_CACHE_DIR="${CONDA_BLD_PATH}/pkg_cache" + +( endgroup "Configuring build environment" ) 2> /dev/null + +arch=$(uname -m) +if [[ "${arch}" == "x86_64" ]]; then + arch="64" +fi ( startgroup "Provisioning base env with micromamba" ) 2> /dev/null -MICROMAMBA_VERSION="1.5.10-0" -if [[ "$(uname -m)" == "arm64" ]]; then - osx_arch="osx-arm64" -else - osx_arch="osx-64" -fi -MICROMAMBA_URL="https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${osx_arch}" + MAMBA_ROOT_PREFIX="${MINIFORGE_HOME}-micromamba-$(date +%s)" +MICROMAMBA_VERSION="2.9.0-0" +MICROMAMBA_URL="https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-osx-${arch}" +MICROMAMBA_TMPDIR=$(mktemp -d) +MICROMAMBA_EXE=${MICROMAMBA_TMPDIR}/micromamba + echo "Downloading micromamba ${MICROMAMBA_VERSION}" -micromamba_exe="$(mktemp -d)/micromamba" -curl -L -o "${micromamba_exe}" "${MICROMAMBA_URL}" -chmod +x "${micromamba_exe}" -echo "Creating environment" -"${micromamba_exe}" create --yes --root-prefix "${MAMBA_ROOT_PREFIX}" --prefix "${MINIFORGE_HOME}" \ - --channel conda-forge \ - pip python=3.14 conda-build conda-forge-ci-setup=4 "conda-build>=26.3" +curl -L -o "${MICROMAMBA_EXE}" "${MICROMAMBA_URL}" +chmod +x "${MICROMAMBA_EXE}" + +echo Creating environment +"${MICROMAMBA_EXE}" create --yes --root-prefix "${MAMBA_ROOT_PREFIX}" --prefix "${MINIFORGE_HOME}" \ + --override-channels --channel conda-forge --strict-channel-priority \ + pip python=3.14 conda-build conda-forge-ci-setup=4 "conda-build>=26.3" echo "Moving pkgs cache from ${MAMBA_ROOT_PREFIX} to ${MINIFORGE_HOME}" mv "${MAMBA_ROOT_PREFIX}/pkgs" "${MINIFORGE_HOME}" -echo "Cleaning up micromamba" -rm -rf "${MAMBA_ROOT_PREFIX}" "${micromamba_exe}" || true + +echo Cleaning up micromamba +rm -rf "${MAMBA_ROOT_PREFIX}" "${MICROMAMBA_EXE}" || : + ( endgroup "Provisioning base env with micromamba" ) 2> /dev/null ( startgroup "Configuring conda" ) 2> /dev/null -echo "Activating environment" + +# Activate the base conda environment +echo Activating environment source "${MINIFORGE_HOME}/etc/profile.d/conda.sh" conda activate base +# Configure the solver export CONDA_SOLVER="libmamba" export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 +# Set basic configuration +echo Setting up configuration +setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" - -echo -e "\n\nSetting up the condarc and mangling the compiler." -setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml - +# macOS-specific setup if [[ "${CI:-}" != "" ]]; then - mangle_compiler ./ ./recipe .ci_support/${CONFIG}.yaml + mangle_compiler "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" fi if [[ "${CI:-}" != "" ]]; then - echo -e "\n\nMangling homebrew in the CI to avoid conflicts." - /usr/bin/sudo mangle_homebrew - /usr/bin/sudo -k + echo "Mangling homebrew in the CI to avoid conflicts." + /usr/bin/sudo mangle_homebrew + /usr/bin/sudo -k else - echo -e "\n\nNot mangling homebrew as we are not running in CI" + echo "Not mangling homebrew as we are not running in CI" fi if [[ "${sha:-}" == "" ]]; then - sha=$(git rev-parse HEAD) + sha=$(git rev-parse HEAD) fi if [[ "${OSX_SDK_DIR:-}" == "" ]]; then - if [[ "${CI:-}" == "" ]]; then - echo "Please set OSX_SDK_DIR to a directory where SDKs can be downloaded to. Aborting" - exit 1 - else - export OSX_SDK_DIR=/opt/conda-sdks - /usr/bin/sudo mkdir -p "${OSX_SDK_DIR}" - /usr/bin/sudo chown "${USER}" "${OSX_SDK_DIR}" - fi + if [[ "${CI:-}" == "" ]]; then + echo "Please set OSX_SDK_DIR to a directory where SDKs can be downloaded to. Aborting" + exit 1 + else + export OSX_SDK_DIR=/opt/conda-sdks + /usr/bin/sudo mkdir -p "${OSX_SDK_DIR}" + /usr/bin/sudo chown "${USER}" "${OSX_SDK_DIR}" + fi else - if tmpf=$(mktemp "$OSX_SDK_DIR"/tmp.XXXXXXXX 2>/dev/null); then - rm -f "$tmpf" - echo "OSX_SDK_DIR is writeable without sudo, continuing" - else - echo "User-provided OSX_SDK_DIR is not writeable for current user! Aborting" - exit 1 - fi + if tmpf=$(mktemp "$OSX_SDK_DIR"/tmp.XXXXXXXX 2>/dev/null); then + rm -f "$tmpf" + echo "OSX_SDK_DIR is writeable without sudo, continuing" + else + echo "User-provided OSX_SDK_DIR is not writeable for current user! Aborting" + exit 1 + fi fi -echo -e "\n\nRunning the build setup script." +echo Running build setup source run_conda_forge_build_setup -( endgroup "Configuring conda" ) 2> /dev/null +if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" +fi -echo -e "\n\nMaking the build clobber file" -make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml -if [[ -f LICENSE.txt ]]; then - cp LICENSE.txt "recipe/recipe-scripts-license.txt" +( endgroup "Configuring conda" ) 2> /dev/null + +if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then + echo Copying feedstock license + cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" fi if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then - if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" - fi - CONDA_SUBDIR="${BUILD_PLATFORM}" conda debug ./recipe -m ./.ci_support/${CONFIG}.yaml \ + # differences between conda-build vs. rattler-build + # - 1 step (conda debug + manually open shell) vs. 2 step (rb debug {setup, shell}) + # - recipe is positional vs. --recipe "${RECIPE_ROOT}" + # - --output-id vs. --output-name + # - --clobber-file vs. none + # - none vs. --target-platform + CONDA_SUBDIR="${BUILD_PLATFORM}" conda debug \ + "${RECIPE_ROOT}" \ + -m "${CONFIG_FILE}" \ ${EXTRA_CB_OPTIONS:-} \ - --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + ${BUILD_OUTPUT_ID:+--output-id "${BUILD_OUTPUT_ID}"} \ + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" # Drop into an interactive shell /bin/bash -else - - if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" - fi +fi - CONDA_SUBDIR="${BUILD_PLATFORM}" conda-build ./recipe -m ./.ci_support/${CONFIG}.yaml \ - --suppress-variables ${EXTRA_CB_OPTIONS:-} \ - --clobber-file ./.ci_support/clobber_${CONFIG}.yaml \ - --extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha" +# Build the recipe +echo Building recipe - ( startgroup "Inspecting artifacts" ) 2> /dev/null +# differences between conda-build vs. rattler-build +# - recipe is positional vs. --recipe "${RECIPE_ROOT}" +# - --suppress-variables vs. none +# - --clobber-file vs. none +# - none vs. --target-platform +# - --extra-meta a=b c=d vs. --extra-meta a=b --extra-meta c=d - # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 - command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir ./recipe -m ./.ci_support/${CONFIG}.yaml || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" +CONDA_SUBDIR="${BUILD_PLATFORM}" conda-build \ + "${RECIPE_ROOT}" \ + -m "${CONFIG_FILE}" \ + ${EXTRA_CB_OPTIONS:-} \ + --suppress-variables \ + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ + --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" - ( endgroup "Inspecting artifacts" ) 2> /dev/null - ( startgroup "Validating outputs" ) 2> /dev/null +( startgroup "Inspecting artifacts" ) 2> /dev/null - validate_recipe_outputs "${FEEDSTOCK_NAME}" +# inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 +command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir "${RECIPE_ROOT}" -m "${CONFIG_FILE}" || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" - ( endgroup "Validating outputs" ) 2> /dev/null +( endgroup "Inspecting artifacts" ) 2> /dev/null +( startgroup "Validating outputs" ) 2> /dev/null +validate_recipe_outputs "${FEEDSTOCK_NAME}" +( endgroup "Validating outputs" ) 2> /dev/null +if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then ( startgroup "Uploading packages" ) 2> /dev/null - - if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then - upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml - fi - + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" ( endgroup "Uploading packages" ) 2> /dev/null fi diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index e11c3ecf8..bb04aa492 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -16,10 +16,20 @@ FOR %%A IN ("%~dp0.") DO SET "REPO_ROOT=%%~dpA" if "%MINIFORGE_HOME%"=="" set "MINIFORGE_HOME=%USERPROFILE%\Miniforge3" :: Remove trailing backslash, if present if "%MINIFORGE_HOME:~-1%"=="\" set "MINIFORGE_HOME=%MINIFORGE_HOME:~0,-1%" + +set FEEDSTOCK_ROOT=%cd% +set RECIPE_ROOT=%FEEDSTOCK_ROOT%\recipe +set CI_SUPPORT=%FEEDSTOCK_ROOT%\.ci_support +set CONFIG_FILE=%CI_SUPPORT%\%CONFIG%.yaml + +set "arch=64" +if "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "arch=arm64" + call :start_group "Provisioning base env with micromamba" + set "MAMBA_ROOT_PREFIX=%MINIFORGE_HOME%-micromamba-%RANDOM%" -set "MICROMAMBA_VERSION=1.5.10-0" -set "MICROMAMBA_URL=https://github.com/mamba-org/micromamba-releases/releases/download/%MICROMAMBA_VERSION%/micromamba-win-64" +set "MICROMAMBA_VERSION=2.9.0-0" +set "MICROMAMBA_URL=https://github.com/mamba-org/micromamba-releases/releases/download/%MICROMAMBA_VERSION%/micromamba-win-%arch%" set "MICROMAMBA_TMPDIR=%TMP%\micromamba-%RANDOM%" set "MICROMAMBA_EXE=%MICROMAMBA_TMPDIR%\micromamba.exe" @@ -33,9 +43,11 @@ call "%MICROMAMBA_EXE%" create --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefi --channel conda-forge ^ pip python=3.14 conda-build conda-forge-ci-setup=4 "conda-build>=26.3" if !errorlevel! neq 0 exit /b !errorlevel! -echo Removing %MAMBA_ROOT_PREFIX% + +echo Cleaning up micromamba del /S /Q "%MAMBA_ROOT_PREFIX%" >nul del /S /Q "%MICROMAMBA_TMPDIR%" >nul + call :end_group call :start_group "Configuring conda" @@ -51,17 +63,18 @@ set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" :: Set basic configuration echo Setting up configuration -setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml -if !errorlevel! neq 0 exit /b !errorlevel! -echo Running build setup +setup_conda_rc "%FEEDSTOCK_ROOT%" "%RECIPE_ROOT%" "%CONFIG_FILE%" +if !errorlevel! neq 0 exit /b !errorlevel!echo Running build setup CALL run_conda_forge_build_setup if !errorlevel! neq 0 exit /b !errorlevel! -if EXIST LICENSE.txt ( +call :end_group + +if EXIST %FEEDSTOCK_ROOT%\LICENSE.txt ( echo Copying feedstock license - copy LICENSE.txt "recipe\\recipe-scripts-license.txt" + copy "%FEEDSTOCK_ROOT%\\LICENSE.txt" "%RECIPE_ROOT%\\recipe-scripts-license.txt" ) if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( if [%CROSSCOMPILING_EMULATOR%] == [] ( @@ -73,20 +86,22 @@ if NOT [%flow_run_id%] == [] ( set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%" ) -call :end_group - :: Build the recipe echo Building recipe -set "_OLD_CONDA_SUBDIR=%CONDA_SUBDIR%" -set "CONDA_SUBDIR=%BUILD_PLATFORM%" -conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% + +conda-build.exe ^ + "%RECIPE_ROOT%" ^ + -m %CONFIG_FILE% ^ + %EXTRA_CB_OPTIONS% ^ + --suppress-variables + if !errorlevel! neq 0 exit /b !errorlevel! -set "_OLD_CONDA_SUBDIR=" -set "CONDA_SUBDIR=%_OLD_CONDA_SUBDIR%" call :start_group "Inspecting artifacts" + :: inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 -WHERE inspect_artifacts >nul 2>nul && inspect_artifacts --recipe-dir ".\recipe" -m .ci_support\%CONFIG%.yaml || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" +WHERE inspect_artifacts >nul 2>nul && inspect_artifacts --recipe-dir "%RECIPE_ROOT%" -m %CONFIG_FILE% || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" + call :end_group :: Prepare some environment variables for the upload step @@ -110,8 +125,6 @@ if /i "%CI%" == "azure" ( ) set "TEMP=%UPLOAD_TEMP%" ) - -:: Validate call :start_group "Validating outputs" validate_recipe_outputs "%FEEDSTOCK_NAME%" if !errorlevel! neq 0 exit /b !errorlevel! @@ -122,7 +135,7 @@ if /i "%UPLOAD_PACKAGES%" == "true" ( call :start_group "Uploading packages" if not exist "%TEMP%\" md "%TEMP%" set "TMP=%TEMP%" - upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml + upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" "%FEEDSTOCK_ROOT%" "%RECIPE_ROOT%" "%CONFIG_FILE%" if !errorlevel! neq 0 exit /b !errorlevel! call :end_group ) diff --git a/README.md b/README.md index 1756faa73..634a775e3 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,7 @@ mamba repoquery depends cpython --channel conda-forge/label/python_debug + About conda-forge ================= @@ -248,9 +249,7 @@ for each of the installable packages. Such a repository is known as a *feedstock A feedstock is made up of a conda recipe (the instructions on what and how to build the package) and the necessary configurations for automatic building using freely available continuous integration services. Thanks to the awesome service provided by -[Azure](https://azure.microsoft.com/en-us/services/devops/), [GitHub](https://github.com/), -[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/), -[Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/) +[Azure](https://azure.microsoft.com/en-us/services/devops/) and [GitHub](https://github.com/) it is possible to build and upload installable packages to the [conda-forge](https://anaconda.org/conda-forge) [anaconda.org](https://anaconda.org/) channel for Linux, Windows and OSX respectively. diff --git a/recipe/build_base.bat b/recipe/build_base.bat index 2b3318dd3..63702600d 100644 --- a/recipe/build_base.bat +++ b/recipe/build_base.bat @@ -56,10 +56,7 @@ if "%PY_INTERP_DEBUG%"=="yes" ( set _D= ) -REM PGO is disabled for the 3.15 build. It was enabled for 3.14 job, but it doesn't -REM work as intended and there are lots of warnings generated of the form -REM warning PG0188: No .PGC files matching %SRC_DIR%\PCbuild\amd64\_tkinter!*.pgc' were found -set PGO= +set PGO=--pgo if "%DEBUG_C%"=="yes" ( set PGO= ) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 44247e152..f34a19502 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' %}