From 58c41e1f39463c02b28afe876269db6eb4b6b541 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 1 Aug 2024 15:21:25 +1100 Subject: [PATCH 01/10] handle stdlib & run-exports --- recipe/meta.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 6ad00e1..f7ccfa2 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -16,13 +16,14 @@ build: # The recipe assumes building on Linux, but we don't have "skip" active since # the linter will complain with "`noarch` packages can't have selectors". # skip: True # [not linux] - ignore_run_exports: - - libgcc-ng + ignore_run_exports_from: + - {{ stdlib('c') }} + - {{ compiler('c') }} requirements: build: + - {{ stdlib('c') }} - {{ compiler('c') }} - - sysroot_linux-64 2.17 # [linux64] - make host: run: From 7b86c69a7fbbf62396349180a68d389771b1f449 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 1 Aug 2024 15:22:41 +1100 Subject: [PATCH 02/10] also install leap-seconds.list --- recipe/build.sh | 8 ++++++++ recipe/meta.yaml | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index 8ca4bf3..9ee2038 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,7 +1,15 @@ +#!/bin/bash +set -ex + +# by default the makefile does not install leap-seconds.list; +# however, some implementations (e.g. libc++) rely on it so +# we expand the default (TZDATA_TEXT=tzdata.zi leapseconds) + make -e \ DESTDIR=./build \ USRDIR='' \ POSIXRULES='' \ + TZDATA_TEXT='tzdata.zi leapseconds leap-seconds.list' \ install mkdir -p "${PREFIX}/share" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f7ccfa2..7f22062 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,7 +11,7 @@ source: sha256: 80072894adff5a458f1d143e16e4ca1d8b2a122c9c5399da482cb68cba6a1ff8 build: - number: 0 + number: 1 noarch: generic # The recipe assumes building on Linux, but we don't have "skip" active since # the linter will complain with "`noarch` packages can't have selectors". @@ -31,6 +31,7 @@ requirements: test: commands: - test -f "${PREFIX}/share/zoneinfo/leapseconds" + - test -f "${PREFIX}/share/zoneinfo/leap-seconds.list" - test -f "${PREFIX}/share/zoneinfo/iso3166.tab" - test -f "${PREFIX}/share/zoneinfo/zone1970.tab" - test -f "${PREFIX}/share/zoneinfo/zone.tab" From ca9deaf00b821ae2f2de3c3f8c9c4f4eabfbd4fe Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 1 Aug 2024 15:23:43 +1100 Subject: [PATCH 03/10] add expiry date to leapseconds file otherwise consumers cannot distinguish whether there are simply no new leapseconds, or the leapseconds file is out of date --- recipe/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/build.sh b/recipe/build.sh index 9ee2038..7ed26a6 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -7,6 +7,7 @@ set -ex make -e \ DESTDIR=./build \ + EXPIRES_LINE=1 \ USRDIR='' \ POSIXRULES='' \ TZDATA_TEXT='tzdata.zi leapseconds leap-seconds.list' \ From 916eb5d2b92e57adb4ba0a23d8bfb3e248c8924f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 1 Aug 2024 15:38:02 +1100 Subject: [PATCH 04/10] MNT: Re-rendered with conda-build 24.7.1, conda-smithy 3.37.2, and conda-forge-pinning 2024.07.31.04.56.44 --- .azure-pipelines/azure-pipelines-linux.yml | 1 + .ci_support/linux_64_.yaml | 7 +++++++ .gitattributes | 4 ++-- .scripts/build_steps.sh | 12 +++++++++--- build-locally.py | 9 +++++---- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index abcbeb9..875d996 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -13,6 +13,7 @@ jobs: UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 timeoutInMinutes: 360 + variables: {} steps: # configure qemu binfmt-misc running. This allows us to run docker containers diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index 5b74e21..3f49777 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -2,6 +2,10 @@ c_compiler: - gcc c_compiler_version: - '12' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: - cos7 channel_sources: @@ -10,3 +14,6 @@ channel_targets: - conda-forge main docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 +zip_keys: +- - c_stdlib_version + - cdt_name diff --git a/.gitattributes b/.gitattributes index 7f32763..18f114a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -20,8 +20,8 @@ bld.bat text eol=crlf .travis.yml linguist-generated=true .scripts/* linguist-generated=true .woodpecker.yml linguist-generated=true -LICENSE.txt linguist-generated=true -README.md linguist-generated=true +/LICENSE.txt linguist-generated=true +/README.md linguist-generated=true azure-pipelines.yml linguist-generated=true build-locally.py linguist-generated=true shippable.yml linguist-generated=true diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index f017291..6c805a9 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -34,9 +34,9 @@ CONDARC export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=4 + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=4 + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -65,10 +65,16 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else - conda mambabuild "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + conda-build "${RECIPE_ROOT}" -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:-}" + ( startgroup "Inspecting artifacts" ) 2> /dev/null + + # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + + ( endgroup "Inspecting artifacts" ) 2> /dev/null ( startgroup "Validating outputs" ) 2> /dev/null validate_recipe_outputs "${FEEDSTOCK_NAME}" diff --git a/build-locally.py b/build-locally.py index 3f4b7a7..d78427b 100755 --- a/build-locally.py +++ b/build-locally.py @@ -3,11 +3,11 @@ # This file has been generated by conda-smithy in order to build the recipe # locally. # -import os import glob +import os +import platform import subprocess from argparse import ArgumentParser -import platform def setup_environment(ns): @@ -64,8 +64,9 @@ def verify_config(ns): elif ns.config.startswith("osx"): if "OSX_SDK_DIR" not in os.environ: raise RuntimeError( - "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=SDKs' " - "to download the SDK automatically to 'SDKs/MacOSX.sdk'. " + "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=$PWD/SDKs' " + "to download the SDK automatically to '$PWD/SDKs/MacOSX.sdk'. " + "Note: OSX_SDK_DIR must be set to an absolute path. " "Setting this variable implies agreement to the licensing terms of the SDK by Apple." ) From dbafd0f81aff98a5c21666b4dca2d6ab93a955c2 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 1 Aug 2024 15:45:43 +1100 Subject: [PATCH 05/10] remove obsolete config in conda-forge.yml; alphabetize --- conda-forge.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/conda-forge.yml b/conda-forge.yml index cd3239d..628fa3f 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,8 +1,6 @@ +conda_build: + pkg_format: '2' conda_forge_output_validation: true github: branch_name: main tooling_branch_name: main -os_version: - linux_64: cos7 -conda_build: - pkg_format: '2' From 9293873827e1a17442f1a9dbcb02a4e4a62440a9 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 1 Aug 2024 15:46:57 +1100 Subject: [PATCH 06/10] do not build on linux, where the c-stdlib depends on tzdata since https://github.com/conda-forge/linux-sysroot-feedstock/commit/72bac2311c6795b729cbeec7cbd4fb46b5670b1f --- conda-forge.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/conda-forge.yml b/conda-forge.yml index 628fa3f..cb8eeca 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -4,3 +4,4 @@ conda_forge_output_validation: true github: branch_name: main tooling_branch_name: main +noarch_platforms: osx_64 From bc0dd9976903adceea082703c40a3d10e2e5145a Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 1 Aug 2024 15:47:55 +1100 Subject: [PATCH 07/10] MNT: Re-rendered with conda-build 24.7.1, conda-smithy 3.37.2, and conda-forge-pinning 2024.07.31.04.56.44 --- .azure-pipelines/azure-pipelines-linux.yml | 44 -------- .azure-pipelines/azure-pipelines-osx.yml | 37 +++++++ .ci_support/linux_64_.yaml | 19 ---- .ci_support/osx_64_.yaml | 18 ++++ .scripts/build_steps.sh | 95 ----------------- .scripts/run_docker_build.sh | 114 --------------------- .scripts/run_osx_build.sh | 104 +++++++++++++++++++ azure-pipelines.yml | 2 +- 8 files changed, 160 insertions(+), 273 deletions(-) delete mode 100755 .azure-pipelines/azure-pipelines-linux.yml create mode 100755 .azure-pipelines/azure-pipelines-osx.yml delete mode 100644 .ci_support/linux_64_.yaml create mode 100644 .ci_support/osx_64_.yaml delete mode 100755 .scripts/build_steps.sh delete mode 100755 .scripts/run_docker_build.sh create mode 100755 .scripts/run_osx_build.sh diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml deleted file mode 100755 index 875d996..0000000 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -jobs: -- job: linux - pool: - vmImage: ubuntu-latest - strategy: - matrix: - linux_64_: - CONFIG: linux_64_ - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 - timeoutInMinutes: 360 - variables: {} - - steps: - # configure qemu binfmt-misc running. This allows us to run docker containers - # embedded qemu-static - - script: | - docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes - ls /proc/sys/fs/binfmt_misc/ - condition: not(startsWith(variables['CONFIG'], 'linux_64')) - displayName: Configure binfmt_misc - - - script: | - export CI=azure - export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) - export remote_url=$(Build.Repository.Uri) - export sha=$(Build.SourceVersion) - export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME - export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) - if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then - export IS_PR_BUILD="True" - else - export IS_PR_BUILD="False" - fi - .scripts/run_docker_build.sh - displayName: Run docker build - env: - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml new file mode 100755 index 0000000..a8ca2b4 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -0,0 +1,37 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: +- job: osx + pool: + vmImage: macOS-12 + strategy: + matrix: + osx_64_: + CONFIG: osx_64_ + UPLOAD_PACKAGES: 'True' + timeoutInMinutes: 360 + variables: {} + + steps: + # TODO: Fast finish on azure pipelines? + - script: | + export CI=azure + export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) + export remote_url=$(Build.Repository.Uri) + export sha=$(Build.SourceVersion) + export OSX_FORCE_SDK_DOWNLOAD="1" + export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME + export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + ./.scripts/run_osx_build.sh + displayName: Run OSX build + env: + BINSTAR_TOKEN: $(BINSTAR_TOKEN) + FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml deleted file mode 100644 index 3f49777..0000000 --- a/.ci_support/linux_64_.yaml +++ /dev/null @@ -1,19 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '12' -c_stdlib: -- sysroot -c_stdlib_version: -- '2.17' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 -zip_keys: -- - c_stdlib_version - - cdt_name diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml new file mode 100644 index 0000000..f498f86 --- /dev/null +++ b/.ci_support/osx_64_.yaml @@ -0,0 +1,18 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_compiler: +- clang +c_compiler_version: +- '16' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +macos_machine: +- x86_64-apple-darwin13.4.0 diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh deleted file mode 100755 index 6c805a9..0000000 --- a/.scripts/build_steps.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/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 -*- - -set -xeuo pipefail -export FEEDSTOCK_ROOT="${FEEDSTOCK_ROOT:-/home/conda/feedstock_root}" -source ${FEEDSTOCK_ROOT}/.scripts/logging_utils.sh - - -( endgroup "Start Docker" ) 2> /dev/null - -( startgroup "Configuring conda" ) 2> /dev/null - -export PYTHONUNBUFFERED=1 -export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" -export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" -export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" - -cat >~/.condarc <=24.1" -mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" - -# set up the condarc -setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" - -source run_conda_forge_build_setup - -# make the build number clobber -make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" - - - -( endgroup "Configuring conda" ) 2> /dev/null - -if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then - 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 debug "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ - ${EXTRA_CB_OPTIONS:-} \ - --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" - - # Drop into an interactive shell - /bin/bash -else - conda-build "${RECIPE_ROOT}" -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:-}" - ( startgroup "Inspecting artifacts" ) 2> /dev/null - - # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 - command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" - - ( endgroup "Inspecting artifacts" ) 2> /dev/null - ( startgroup "Validating outputs" ) 2> /dev/null - - validate_recipe_outputs "${FEEDSTOCK_NAME}" - - ( endgroup "Validating outputs" ) 2> /dev/null - - ( startgroup "Uploading packages" ) 2> /dev/null - - if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then - upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" - fi - - ( endgroup "Uploading packages" ) 2> /dev/null -fi - -( startgroup "Final checks" ) 2> /dev/null - -touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh deleted file mode 100755 index 00f377a..0000000 --- a/.scripts/run_docker_build.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/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. - -source .scripts/logging_utils.sh - -( startgroup "Configure Docker" ) 2> /dev/null - -set -xeo pipefail - -THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" -PROVIDER_DIR="$(basename $THISDIR)" - -FEEDSTOCK_ROOT="$( cd "$( dirname "$0" )/.." >/dev/null && pwd )" -RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" - -if [ -z ${FEEDSTOCK_NAME} ]; then - export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) -fi - -if [[ "${sha:-}" == "" ]]; then - pushd "${FEEDSTOCK_ROOT}" - sha=$(git rev-parse HEAD) - popd -fi - -docker info - -# In order for the conda-build process in the container to write to the mounted -# volumes, we need to run with the same id as the host machine, which is -# normally the owner of the mounted volumes, or at least has write permission -export HOST_USER_ID=$(id -u) -# Check if docker-machine is being used (normally on OSX) and get the uid from -# the VM -if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then - export HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) -fi - -ARTIFACTS="$FEEDSTOCK_ROOT/build_artifacts" - -if [ -z "$CONFIG" ]; then - set +x - FILES=`ls .ci_support/linux_*` - CONFIGS="" - for file in $FILES; do - CONFIGS="${CONFIGS}'${file:12:-5}' or "; - done - echo "Need to set CONFIG env variable. Value can be one of ${CONFIGS:0:-4}" - exit 1 -fi - -if [ -z "${DOCKER_IMAGE}" ]; then - SHYAML_INSTALLED="$(shyaml -h || echo NO)" - if [ "${SHYAML_INSTALLED}" == "NO" ]; then - echo "WARNING: DOCKER_IMAGE variable not set and shyaml not installed. Trying to parse with coreutils" - DOCKER_IMAGE=$(cat .ci_support/${CONFIG}.yaml | grep '^docker_image:$' -A 1 | tail -n 1 | cut -b 3-) - if [ "${DOCKER_IMAGE}" = "" ]; then - echo "No docker_image entry found in ${CONFIG}. Falling back to quay.io/condaforge/linux-anvil-comp7" - DOCKER_IMAGE="quay.io/condaforge/linux-anvil-comp7" - fi - else - DOCKER_IMAGE="$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-value docker_image.0 quay.io/condaforge/linux-anvil-comp7 )" - fi -fi - -mkdir -p "$ARTIFACTS" -DONE_CANARY="$ARTIFACTS/conda-forge-build-done-${CONFIG}" -rm -f "$DONE_CANARY" - -# Allow people to specify extra default arguments to `docker run` (e.g. `--rm`) -DOCKER_RUN_ARGS="${CONDA_FORGE_DOCKER_RUN_ARGS}" -if [ -z "${CI}" ]; then - DOCKER_RUN_ARGS="-it ${DOCKER_RUN_ARGS}" -fi - -( endgroup "Configure Docker" ) 2> /dev/null - -( startgroup "Start Docker" ) 2> /dev/null - -export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" -export IS_PR_BUILD="${IS_PR_BUILD:-False}" -docker pull "${DOCKER_IMAGE}" -docker run ${DOCKER_RUN_ARGS} \ - -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ - -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z,delegated \ - -e CONFIG \ - -e HOST_USER_ID \ - -e UPLOAD_PACKAGES \ - -e IS_PR_BUILD \ - -e GIT_BRANCH \ - -e UPLOAD_ON_BRANCH \ - -e CI \ - -e FEEDSTOCK_NAME \ - -e CPU_COUNT \ - -e BUILD_WITH_CONDA_DEBUG \ - -e BUILD_OUTPUT_ID \ - -e flow_run_id \ - -e remote_url \ - -e sha \ - -e BINSTAR_TOKEN \ - -e FEEDSTOCK_TOKEN \ - -e STAGING_BINSTAR_TOKEN \ - "${DOCKER_IMAGE}" \ - bash \ - "/home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh" - -# verify that the end of the script was reached -test -f "$DONE_CANARY" - -# This closes the last group opened in `build_steps.sh` -( endgroup "Final checks" ) 2> /dev/null \ No newline at end of file diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh new file mode 100755 index 0000000..4ebc38f --- /dev/null +++ b/.scripts/run_osx_build.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash + +# -*- mode: jinja-shell -*- + +source .scripts/logging_utils.sh + +set -xe + +MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3} + +( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null + +MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" +MINIFORGE_FILE="Miniforge3-MacOSX-$(uname -m).sh" +curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" +rm -rf ${MINIFORGE_HOME} +bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} + +( endgroup "Installing a fresh version of Miniforge" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null + +source ${MINIFORGE_HOME}/etc/profile.d/conda.sh +conda activate base +export CONDA_SOLVER="libmamba" +export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 + +mamba install --update-specs --quiet --yes --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ + pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" + + + +echo -e "\n\nSetting up the condarc and mangling the compiler." +setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml + +if [[ "${CI:-}" != "" ]]; then + mangle_compiler ./ ./recipe .ci_support/${CONFIG}.yaml +fi + +if [[ "${CI:-}" != "" ]]; then + echo -e "\n\nMangling 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" +fi + +if [[ "${sha:-}" == "" ]]; then + sha=$(git rev-parse HEAD) +fi + +echo -e "\n\nRunning the build setup script." +source run_conda_forge_build_setup + + + +( endgroup "Configuring conda" ) 2> /dev/null + +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" +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 debug ./recipe -m ./.ci_support/${CONFIG}.yaml \ + ${EXTRA_CB_OPTIONS:-} \ + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + + # Drop into an interactive shell + /bin/bash +else + + 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" + + ( startgroup "Inspecting artifacts" ) 2> /dev/null + + # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + + ( endgroup "Inspecting artifacts" ) 2> /dev/null + ( startgroup "Validating outputs" ) 2> /dev/null + + validate_recipe_outputs "${FEEDSTOCK_NAME}" + + ( endgroup "Validating outputs" ) 2> /dev/null + + ( 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 + + ( endgroup "Uploading packages" ) 2> /dev/null +fi \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ad85a2c..5baab3e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,4 +3,4 @@ # -*- mode: yaml -*- jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml \ No newline at end of file + - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file From 231ffce00c77b572807c029e00d5756f65cf931b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 1 Aug 2024 16:02:10 +1100 Subject: [PATCH 08/10] adapt test; avoid GNU-specific find-feature see https://man.netbsd.org/find.1 & https://unix.stackexchange.com/a/272493 --- recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 7f22062..2464681 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -47,8 +47,8 @@ test: - | heads="$( find "${PREFIX}/share/zoneinfo" -type f \ - \! -name \*.zi \! -name \*.tab \! -name leapseconds \ - -exec head -c4 {} \; -printf \\n \ + \! -name \*.zi \! -name \*.tab \! -name leapseconds \! -name leap-seconds.list \ + -exec sh -c 'head -c4 $1 && echo' sh {} \; \ | uniq )" test "${heads}" = TZif From 8ebf0657d250f8a8537151052c8ceebfc5815571 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 17 Aug 2024 13:38:30 +1100 Subject: [PATCH 09/10] update comment about which platform we build on --- recipe/meta.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 2464681..cbf9232 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -13,9 +13,8 @@ source: build: number: 1 noarch: generic - # The recipe assumes building on Linux, but we don't have "skip" active since - # the linter will complain with "`noarch` packages can't have selectors". - # skip: True # [not linux] + # We build on osx (see conda-forge.yml) because sysroot_linux- depends on + # tzdata; since this package is data-only, we don't want any of the run-exports ignore_run_exports_from: - {{ stdlib('c') }} - {{ compiler('c') }} From 65912a30ec48cf05a29517a1fac144e05e8ebb5c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 27 Aug 2024 09:37:02 +1100 Subject: [PATCH 10/10] add myself to maintainers --- .github/CODEOWNERS | 2 +- README.md | 1 + recipe/meta.yaml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 05b40b2..1be0458 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @mbargull @ocefpaf @pganssle \ No newline at end of file +* @h-vetinari @mbargull @ocefpaf @pganssle \ No newline at end of file diff --git a/README.md b/README.md index 898da02..e4727fb 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ In order to produce a uniquely identifiable distribution: Feedstock Maintainers ===================== +* [@h-vetinari](https://github.com/h-vetinari/) * [@mbargull](https://github.com/mbargull/) * [@ocefpaf](https://github.com/ocefpaf/) * [@pganssle](https://github.com/pganssle/) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index cbf9232..dcf25f9 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -73,3 +73,4 @@ extra: - ocefpaf - mbargull - pganssle + - h-vetinari