diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml deleted file mode 100755 index abcbeb9..0000000 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ /dev/null @@ -1,43 +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 - - 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 5b74e21..0000000 --- a/.ci_support/linux_64_.yaml +++ /dev/null @@ -1,12 +0,0 @@ -c_compiler: -- gcc -c_compiler_version: -- '12' -cdt_name: -- cos7 -channel_sources: -- conda-forge -channel_targets: -- conda-forge main -docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 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/.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/.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/.scripts/build_steps.sh b/.scripts/build_steps.sh deleted file mode 100755 index f017291..0000000 --- a/.scripts/build_steps.sh +++ /dev/null @@ -1,89 +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 < /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 mambabuild "${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 "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/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/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 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." ) diff --git a/conda-forge.yml b/conda-forge.yml index cd3239d..cb8eeca 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,8 +1,7 @@ +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' +noarch_platforms: osx_64 diff --git a/recipe/build.sh b/recipe/build.sh index 8ca4bf3..7ed26a6 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,7 +1,16 @@ +#!/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 \ + EXPIRES_LINE=1 \ 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 6ad00e1..dcf25f9 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,18 +11,18 @@ 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". - # skip: True # [not linux] - ignore_run_exports: - - libgcc-ng + # 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') }} requirements: build: + - {{ stdlib('c') }} - {{ compiler('c') }} - - sysroot_linux-64 2.17 # [linux64] - make host: run: @@ -30,6 +30,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" @@ -45,8 +46,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 @@ -72,3 +73,4 @@ extra: - ocefpaf - mbargull - pganssle + - h-vetinari