diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index fcb0974..b1513b8 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -11,16 +11,17 @@ jobs: linux_64_: CONFIG: linux_64_ UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 linux_aarch64_: CONFIG: linux_aarch64_ UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 linux_ppc64le_: CONFIG: linux_ppc64le_ UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 timeoutInMinutes: 360 + variables: {} steps: # configure qemu binfmt-misc running. This allows us to run docker containers @@ -33,6 +34,9 @@ jobs: - 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 diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index 8032e96..ac0bf38 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -5,7 +5,7 @@ jobs: - job: osx pool: - vmImage: macOS-11 + vmImage: macOS-13 strategy: matrix: osx_64_: @@ -15,11 +15,15 @@ jobs: CONFIG: osx_arm64_ 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}) diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 82c5318..13022dd 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -14,34 +14,23 @@ jobs: timeoutInMinutes: 360 variables: CONDA_BLD_PATH: D:\\bld\\ + MINIFORGE_HOME: D:\Miniforge UPLOAD_TEMP: D:\\tmp steps: - - task: PythonScript@0 - displayName: 'Download Miniforge' - inputs: - scriptSource: inline - script: | - import urllib.request - url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe' - path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe" - urllib.request.urlretrieve(url, path) - - - script: | - start /wait "" %BUILD_ARTIFACTSTAGINGDIRECTORY%\Miniforge.exe /InstallationType=JustMe /RegisterPython=0 /S /D=C:\Miniforge - displayName: Install Miniforge - - - powershell: Write-Host "##vso[task.prependpath]C:\Miniforge\Scripts" - displayName: Add conda to PATH - - script: | call ".scripts\run_win_build.bat" displayName: Run Windows build env: + MINIFORGE_HOME: $(MINIFORGE_HOME) + CONDA_BLD_PATH: $(CONDA_BLD_PATH) PYTHONUNBUFFERED: 1 CONFIG: $(CONFIG) CI: azure + flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt) + remote_url: $(Build.Repository.Uri) + sha: $(Build.SourceVersion) UPLOAD_PACKAGES: $(UPLOAD_PACKAGES) UPLOAD_TEMP: $(UPLOAD_TEMP) BINSTAR_TOKEN: $(BINSTAR_TOKEN) diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index f6b4424..f1ac79a 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,5 +1,9 @@ +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: -- cos6 +- conda channel_sources: - conda-forge channel_targets: @@ -7,8 +11,8 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 +- quay.io/condaforge/linux-anvil-x86_64:alma9 target_platform: - linux-64 diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index c6326fe..2088d86 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -1,9 +1,9 @@ -BUILD: -- aarch64-conda_cos7-linux-gnu -cdt_arch: -- aarch64 +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: -- cos7 +- conda channel_sources: - conda-forge channel_targets: @@ -11,8 +11,8 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 +- quay.io/condaforge/linux-anvil-x86_64:alma9 target_platform: - linux-aarch64 diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml index c1ceece..3026648 100644 --- a/.ci_support/linux_ppc64le_.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -1,5 +1,9 @@ +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: -- cos7 +- conda channel_sources: - conda-forge channel_targets: @@ -7,8 +11,8 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '12' +- '13' docker_image: -- quay.io/condaforge/linux-anvil-cos7-x86_64 +- quay.io/condaforge/linux-anvil-x86_64:alma9 target_platform: - linux-ppc64le diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index 4fc1587..8beeaa0 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -1,5 +1,11 @@ MACOSX_DEPLOYMENT_TARGET: -- '10.9' +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' channel_sources: - conda-forge channel_targets: @@ -7,7 +13,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '18' macos_machine: - x86_64-apple-darwin13.4.0 target_platform: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml index 8d88f82..d402228 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -1,5 +1,11 @@ MACOSX_DEPLOYMENT_TARGET: - '11.0' +MACOSX_SDK_VERSION: +- '11.0' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' channel_sources: - conda-forge channel_targets: @@ -7,7 +13,7 @@ channel_targets: cxx_compiler: - clangxx cxx_compiler_version: -- '16' +- '18' macos_machine: - arm64-apple-darwin20.0.0 target_platform: diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index f2f006f..f98bd6e 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -1,3 +1,5 @@ +c_stdlib: +- vs channel_sources: - conda-forge channel_targets: 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/.gitignore b/.gitignore index c89ecb7..47b5408 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,29 @@ +# User content belongs under recipe/. +# Feedstock configuration goes in `conda-forge.yml` +# Everything else is managed by the conda-smithy rerender process. +# Please do not modify + +# Ignore all files and folders in root +* +!/conda-forge.yml + +# Don't ignore any files/folders if the parent folder is 'un-ignored' +# This also avoids warnings when adding an already-checked file with an ignored parent. +!/**/ +# Don't ignore any files/folders recursively in the following folders +!/recipe/** +!/.ci_support/** + +# Since we ignore files/folders recursively, any folders inside +# build_artifacts gets ignored which trips some build systems. +# To avoid that we 'un-ignore' all files/folders recursively +# and only ignore the root build_artifacts folder. +!/build_artifacts/** +/build_artifacts + *.pyc -build_artifacts +# Rattler-build's artifacts are in `output` when not specifying anything. +/output +# Pixi's configuration +.pixi diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index bd9e671..827a29f 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -28,19 +28,23 @@ conda-build: pkgs_dirs: - ${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache - /opt/conda/pkgs +solver: libmamba CONDARC - -mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=3 -mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=3 +mv /opt/conda/conda-meta/history /opt/conda/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S) +echo > /opt/conda/conda-meta/history +micromamba install --root-prefix ~/.conda --prefix /opt/conda \ + --yes --override-channels --channel conda-forge --strict-channel-priority \ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=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}" @@ -66,9 +70,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" + --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.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 "Inspecting artifacts" ) 2> /dev/null ( startgroup "Validating outputs" ) 2> /dev/null validate_recipe_outputs "${FEEDSTOCK_NAME}" diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 9236239..6ee04aa 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -12,7 +12,7 @@ source .scripts/logging_utils.sh set -xeo pipefail THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" -PROVIDER_DIR="$(basename $THISDIR)" +PROVIDER_DIR="$(basename "$THISDIR")" FEEDSTOCK_ROOT="$( cd "$( dirname "$0" )/.." >/dev/null && pwd )" RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" @@ -21,6 +21,12 @@ 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 @@ -91,6 +97,9 @@ docker run ${DOCKER_RUN_ARGS} \ -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 \ diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 870c49a..0e3c394 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -6,27 +6,41 @@ 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="Mambaforge-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 +MINIFORGE_HOME="${MINIFORGE_HOME:-${HOME}/miniforge3}" +MINIFORGE_HOME="${MINIFORGE_HOME%/}" # remove trailing slash +export CONDA_BLD_PATH="${CONDA_BLD_PATH:-${MINIFORGE_HOME}/conda-bld}" + +( 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)" +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.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +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 +( endgroup "Provisioning base env with micromamba" ) 2> /dev/null ( startgroup "Configuring conda" ) 2> /dev/null - -source ${MINIFORGE_HOME}/etc/profile.d/conda.sh +echo "Activating environment" +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 boa conda-forge-ci-setup=3 -mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build boa conda-forge-ci-setup=3 @@ -45,6 +59,10 @@ 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 @@ -75,9 +93,17 @@ else EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test" fi - conda mambabuild ./recipe -m ./.ci_support/${CONFIG}.yaml \ + conda-build ./recipe -m ./.ci_support/${CONFIG}.yaml \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ - --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + --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.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" + + ( endgroup "Inspecting artifacts" ) 2> /dev/null ( startgroup "Validating outputs" ) 2> /dev/null validate_recipe_outputs "${FEEDSTOCK_NAME}" diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index 07d3445..283e143 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -3,25 +3,50 @@ :: changes to this script, consider a proposal to conda-smithy so that other feedstocks can also :: benefit from the improvement. -:: Note: we assume a Miniforge installation is available - :: INPUTS (required environment variables) :: CONFIG: name of the .ci_support/*.yaml file for this job :: CI: azure, github_actions, or unset +:: MINIFORGE_HOME: where to install the base conda environment :: UPLOAD_PACKAGES: true or false :: UPLOAD_ON_BRANCH: true or false setlocal enableextensions enabledelayedexpansion +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%" +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_TMPDIR=%TMP%\micromamba-%RANDOM%" +set "MICROMAMBA_EXE=%MICROMAMBA_TMPDIR%\micromamba.exe" + +echo Downloading micromamba %MICROMAMBA_VERSION% +if not exist "%MICROMAMBA_TMPDIR%" mkdir "%MICROMAMBA_TMPDIR%" +certutil -urlcache -split -f "%MICROMAMBA_URL%" "%MICROMAMBA_EXE%" +if !errorlevel! neq 0 exit /b !errorlevel! + +echo Creating environment +call "%MICROMAMBA_EXE%" create --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefix "%MINIFORGE_HOME%" ^ + --channel conda-forge ^ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +if !errorlevel! neq 0 exit /b !errorlevel! +echo Removing %MAMBA_ROOT_PREFIX% +del /S /Q "%MAMBA_ROOT_PREFIX%" >nul +del /S /Q "%MICROMAMBA_TMPDIR%" >nul +call :end_group + call :start_group "Configuring conda" :: Activate the base conda environment -call activate base - -:: Provision the necessary dependencies to build the recipe later -echo Installing dependencies -mamba.exe install "python=3.10" pip mamba conda-build boa conda-forge-ci-setup=3 -c conda-forge --strict-channel-priority --yes +echo Activating environment +call "%MINIFORGE_HOME%\Scripts\activate.bat" +:: Configure the solver +set "CONDA_SOLVER=libmamba" if !errorlevel! neq 0 exit /b !errorlevel! +set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" :: Set basic configuration echo Setting up configuration @@ -38,16 +63,27 @@ if EXIST LICENSE.txt ( copy LICENSE.txt "recipe\\recipe-scripts-license.txt" ) if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( - set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" + if [%CROSSCOMPILING_EMULATOR%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" + ) +) + +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 -conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% +conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% if !errorlevel! neq 0 exit /b !errorlevel! +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" +call :end_group + :: Prepare some environment variables for the upload step if /i "%CI%" == "github_actions" ( set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" diff --git a/README.md b/README.md index b5115fe..780d913 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ available continuous integration services. Thanks to the awesome service provide [CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/), [Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/) it is possible to build and upload installable packages to the -[conda-forge](https://anaconda.org/conda-forge) [Anaconda-Cloud](https://anaconda.org/) +[conda-forge](https://anaconda.org/conda-forge) [anaconda.org](https://anaconda.org/) channel for Linux, Windows and OSX respectively. To manage the continuous integration and simplify feedstock maintenance diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6b346f5..eff4ad6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,32 @@ # update the conda-forge.yml and/or the recipe/meta.yaml. # -*- mode: yaml -*- -jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-win.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file +stages: +- stage: Check + jobs: + - job: Skip + pool: + vmImage: 'ubuntu-22.04' + variables: + DECODE_PERCENTS: 'false' + RET: 'true' + steps: + - checkout: self + fetchDepth: '2' + - bash: | + git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "` + echo "##vso[task.setvariable variable=log]$git_log" + displayName: Obtain commit message + - bash: echo "##vso[task.setvariable variable=RET]false" + condition: and(eq(variables['Build.Reason'], 'PullRequest'), or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'))) + displayName: Skip build? + - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" + name: result + displayName: Export result +- stage: Build + condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) + dependsOn: Check + jobs: + - template: ./.azure-pipelines/azure-pipelines-linux.yml + - template: ./.azure-pipelines/azure-pipelines-osx.yml + - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py index 3f4b7a7..02c2374 100755 --- a/build-locally.py +++ b/build-locally.py @@ -1,13 +1,17 @@ -#!/usr/bin/env python3 +#!/bin/sh +"""exec" "python3" "$0" "$@" #""" # fmt: off # fmt: on # # This file has been generated by conda-smithy in order to build the recipe # locally. # -import os +# The line above this comment is a bash / sh / zsh guard +# to stop people from running it with the wrong interpreter import glob +import os +import platform import subprocess +import sys from argparse import ArgumentParser -import platform def setup_environment(ns): @@ -23,6 +27,13 @@ def setup_environment(ns): os.path.dirname(__file__), "miniforge3" ) + # The default cache location might not be writable using docker on macOS. + if ns.config.startswith("linux") and platform.system() == "Darwin": + os.environ["CONDA_FORGE_DOCKER_RUN_ARGS"] = ( + os.environ.get("CONDA_FORGE_DOCKER_RUN_ARGS", "") + + " -e RATTLER_CACHE_DIR=/tmp/rattler_cache" + ) + def run_docker_build(ns): script = ".scripts/run_docker_build.sh" @@ -34,10 +45,19 @@ def run_osx_build(ns): subprocess.check_call([script]) +def run_win_build(ns): + script = ".scripts/run_win_build.bat" + subprocess.check_call(["cmd", "/D", "/Q", "/C", f"CALL {script}"]) + + def verify_config(ns): + choices_filter = ns.filter or "*" valid_configs = { - os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml") + os.path.basename(f)[:-5] + for f in glob.glob(f".ci_support/{choices_filter}.yaml") } + if choices_filter != "*": + print(f"filtering for '{choices_filter}.yaml' configs") print(f"valid configs are {valid_configs}") if ns.config in valid_configs: print("Using " + ns.config + " configuration") @@ -50,29 +70,37 @@ def verify_config(ns): selections = list(enumerate(sorted(valid_configs), 1)) for i, c in selections: print(f"{i}. {c}") - s = input("\n> ") + try: + s = input("\n> ") + except KeyboardInterrupt: + print("\nno option selected, bye!", file=sys.stderr) + sys.exit(1) idx = int(s) - 1 ns.config = selections[idx][1] print(f"selected {ns.config}") else: raise ValueError("config " + ns.config + " is not valid") - # Remove the following, as implemented - if ns.config.startswith("win"): - raise ValueError( - f"only Linux/macOS configs currently supported, got {ns.config}" + if ( + ns.config.startswith("osx") + and platform.system() == "Darwin" + and not os.environ.get("OSX_SDK_DIR") + ): + raise RuntimeError( + "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." ) - 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'. " - "Setting this variable implies agreement to the licensing terms of the SDK by Apple." - ) def main(args=None): p = ArgumentParser("build-locally") p.add_argument("config", default=None, nargs="?") + p.add_argument( + "--filter", + default=None, + help="Glob string to filter which build choices are presented in interactive mode.", + ) p.add_argument( "--debug", action="store_true", @@ -93,6 +121,8 @@ def main(args=None): run_docker_build(ns) elif ns.config.startswith("osx"): run_osx_build(ns) + elif ns.config.startswith("win"): + run_win_build(ns) finally: recipe_license_file = os.path.join( "recipe", "recipe-scripts-license.txt" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a969177..64ed12e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,16 +1,16 @@ {% set name = "GLM" %} -{% set version = "0.9.9.8" %} +{% set version = "1.0.1" %} package: name: {{ name|lower }} version: {{ version }} source: - url: https://github.com/g-truc/glm/releases/download/{{ version }}/glm-{{ version }}.zip - sha256: 37e2a3d62ea3322e43593c34bae29f57e3e251ea89f4067506c94043769ade4c + url: https://github.com/g-truc/glm/archive/refs/tags/{{ version }}.tar.gz + sha256: 9f3174561fd26904b23f0db5e560971cbf9b3cbda0b280f04d5c379d03bf234c + patches: - - patches/macos_test_errors.patch - - patches/cmake_install_target.patch + - patches/macos_test_errors.patch build: number: 0 @@ -18,6 +18,7 @@ build: requirements: build: + - {{ stdlib("c") }} - {{ compiler('cxx') }} - cmake - make # [unix] @@ -26,6 +27,11 @@ test: commands: - test -r "${PREFIX}/include/glm" # [unix] - if not exist %LIBRARY_INC%\glm exit 1 # [win] + - cmake-package-check glm --targets glm::glm + requires: + - cmake-package-check + - {{ compiler('c') }} + - {{ compiler('cxx') }} about: home: https://glm.g-truc.net diff --git a/recipe/patches/cmake_install_target.patch b/recipe/patches/cmake_install_target.patch deleted file mode 100644 index 7bcf101..0000000 --- a/recipe/patches/cmake_install_target.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,15 +1,40 @@ --cmake_minimum_required(VERSION 3.2 FATAL_ERROR) -+cmake_minimum_required(VERSION 3.20 FATAL_ERROR) - cmake_policy(VERSION 3.2) - --set(GLM_VERSION "0.9.9") -+file(READ "glm/detail/setup.hpp" GLM_SETUP_FILE) -+string(REGEX MATCH "#define[ ]+GLM_VERSION_MAJOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) -+set(GLM_VERSION_MAJOR "${CMAKE_MATCH_1}") -+string(REGEX MATCH "#define[ ]+GLM_VERSION_MINOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) -+set(GLM_VERSION_MINOR "${CMAKE_MATCH_1}") -+string(REGEX MATCH "#define[ ]+GLM_VERSION_PATCH[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) -+set(GLM_VERSION_PATCH "${CMAKE_MATCH_1}") -+string(REGEX MATCH "#define[ ]+GLM_VERSION_REVISION[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) -+set(GLM_VERSION_REVISION "${CMAKE_MATCH_1}") -+ -+set(GLM_VERSION ${GLM_VERSION_MAJOR}.${GLM_VERSION_MINOR}.${GLM_VERSION_PATCH}.${GLM_VERSION_REVISION}) - project(glm VERSION ${GLM_VERSION} LANGUAGES CXX) - enable_testing() - -+include(GNUInstallDirs) -+ - add_subdirectory(glm) - add_library(glm::glm ALIAS glm) - - if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) - -+install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "CMakeLists.txt" EXCLUDE) -+install(EXPORT glm FILE glmConfig.cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/glm NAMESPACE glm::) -+include(CMakePackageConfigHelpers) -+write_basic_package_version_file("glmConfigVersion.cmake" COMPATIBILITY AnyNewerVersion ARCH_INDEPENDENT) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/glm) -+ -+cmake_path(APPEND PKGCONFIG_INCLUDEDIR "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}") -+configure_file("cmake/glm.pc.in" "glm.pc" @ONLY) -+install( -+ FILES "${CMAKE_CURRENT_BINARY_DIR}/glm.pc" -+ DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig" -+) -+ - add_subdirectory(test) - - endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) ---- /dev/null -+++ b/cmake/glm.pc.in -@@ -0,0 +1,8 @@ -+prefix=@CMAKE_INSTALL_PREFIX@ -+includedir=@PKGCONFIG_INCLUDEDIR@ -+ -+Name: GLM -+Description: OpenGL Mathematics -+URL: https://glm.g-truc.net -+Version: @GLM_VERSION@ -+Cflags: -I${includedir} ---- a/glm/CMakeLists.txt -+++ b/glm/CMakeLists.txt -@@ -43,7 +43,13 @@ source_group("SIMD Files" FILES ${SIMD_I - source_group("SIMD Files" FILES ${SIMD_HEADER}) - - add_library(glm INTERFACE) --target_include_directories(glm INTERFACE ../) -+ -+target_include_directories(glm INTERFACE -+ $ -+ $ -+) -+ -+install(TARGETS glm EXPORT glm) - - if(BUILD_STATIC_LIBS) - add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} diff --git a/recipe/patches/macos_test_errors.patch b/recipe/patches/macos_test_errors.patch index ebbd419..c8cb68d 100644 --- a/recipe/patches/macos_test_errors.patch +++ b/recipe/patches/macos_test_errors.patch @@ -1,13 +1,26 @@ -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index e7f85f19f..e67a448f2 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -197,7 +197,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler") - endif() - -- add_compile_options(-Werror -Weverything) -+ #add_compile_options(-Werror -Weverything) - add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types) - add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral) - +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 4ed1403f..8673ed00 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -10,9 +10,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler") + endif() + +- if(NOT GLM_DISABLE_AUTO_DETECTION) +- add_compile_options(-Werror -Weverything) +- endif() ++ # if(NOT GLM_DISABLE_AUTO_DETECTION) ++ # add_compile_options(-Werror -Weverything) ++ # endif() + + elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + if(NOT GLM_QUIET) +@@ -20,7 +20,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + endif() + + if(NOT GLM_DISABLE_AUTO_DETECTION) +- add_compile_options(-Werror) ++# add_compile_options(-Werror) + # add_compile_options(-Wpedantic) + # add_compile_options(-Wall) + # add_compile_options(-Wextra)