From 5aa840e713483de45b1286999b261f5c8b2e4a6d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 28 Aug 2024 09:15:22 -0500 Subject: [PATCH 1/3] rerender --- .azure-pipelines/azure-pipelines-linux.yml | 9 +- .azure-pipelines/azure-pipelines-osx.yml | 6 +- .azure-pipelines/azure-pipelines-win.yml | 60 ++------- .ci_support/linux_64_.yaml | 11 +- .ci_support/linux_aarch64_.yaml | 9 +- .ci_support/linux_ppc64le_.yaml | 9 +- .../migrations/r-base44_and_m2w64-ucrt.yaml | 50 +++++++ .ci_support/osx_64_.yaml | 10 +- .ci_support/osx_arm64_.yaml | 8 +- .ci_support/win_64_.yaml | 12 +- .gitattributes | 4 +- .gitignore | 25 +++- .scripts/build_steps.sh | 22 ++- .scripts/logging_utils.sh | 4 +- .scripts/run_docker_build.sh | 9 ++ .scripts/run_osx_build.sh | 30 +++-- .scripts/run_win_build.bat | 125 ++++++++++++++++++ .travis.yml | 7 +- README.md | 10 +- azure-pipelines.yml | 4 +- build-locally.py | 9 +- 21 files changed, 337 insertions(+), 96 deletions(-) create mode 100644 .ci_support/migrations/r-base44_and_m2w64-ucrt.yaml create mode 100755 .scripts/run_win_build.bat diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index 974e878..875d996 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -13,13 +13,9 @@ jobs: UPLOAD_PACKAGES: 'True' DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 timeoutInMinutes: 360 + variables: {} steps: - - script: | - rm -rf /opt/ghc - df -h - displayName: Manage disk space - # configure qemu binfmt-misc running. This allows us to run docker containers # embedded qemu-static - script: | @@ -30,6 +26,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..7708e23 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-12 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 a192c0b..204327b 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -5,7 +5,7 @@ jobs: - job: win pool: - vmImage: windows-2019 + vmImage: windows-2022 strategy: matrix: win_64_: @@ -17,13 +17,14 @@ jobs: 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' + url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe' path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe" urllib.request.urlretrieve(url, path) @@ -35,52 +36,17 @@ jobs: displayName: Add conda to PATH - script: | - call activate base - mamba.exe install "python=3.9" conda-build conda pip boa conda-forge-ci-setup=3 "py-lief<0.12" -c conda-forge --strict-channel-priority --yes - displayName: Install conda-build - - - script: set PYTHONUNBUFFERED=1 - displayName: Set PYTHONUNBUFFERED - - # Configure the VM - - script: | - call activate base - setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml - displayName: conda-forge CI setup - - # Configure the VM. - - script: | - set "CI=azure" - call activate base - run_conda_forge_build_setup - displayName: conda-forge build setup - - - script: | - call activate base - if EXIST LICENSE.txt ( - copy LICENSE.txt "recipe\\recipe-scripts-license.txt" - ) - conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables - displayName: Build recipe + call ".scripts\run_win_build.bat" + displayName: Run Windows build env: PYTHONUNBUFFERED: 1 - - script: | - set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" - call activate base - validate_recipe_outputs "%FEEDSTOCK_NAME%" - displayName: Validate Recipe Outputs - - - script: | - set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" - set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" - set "TEMP=$(UPLOAD_TEMP)" - if not exist "%TEMP%\" md "%TEMP%" - set "TMP=%TEMP%" - call activate base - upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml - displayName: Upload package - env: + 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) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) - condition: and(succeeded(), not(eq(variables['UPLOAD_PACKAGES'], 'False')), not(eq(variables['Build.Reason'], 'PullRequest'))) \ No newline at end of file + 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 index 4f8e64e..85d08e5 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,9 +1,13 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '13' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: -- cos6 +- cos7 channel_sources: - conda-forge channel_targets: @@ -16,3 +20,6 @@ mpfr: - '4' target_platform: - linux-64 +zip_keys: +- - c_stdlib_version + - cdt_name diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index 9bf6f2b..9c8e6d8 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -3,7 +3,11 @@ BUILD: c_compiler: - gcc c_compiler_version: -- '11' +- '13' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_arch: - aarch64 cdt_name: @@ -20,3 +24,6 @@ mpfr: - '4' target_platform: - linux-aarch64 +zip_keys: +- - c_stdlib_version + - cdt_name diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml index b6d8fa4..4df50fd 100644 --- a/.ci_support/linux_ppc64le_.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -1,7 +1,11 @@ c_compiler: - gcc c_compiler_version: -- '11' +- '13' +c_stdlib: +- sysroot +c_stdlib_version: +- '2.17' cdt_name: - cos7 channel_sources: @@ -16,3 +20,6 @@ mpfr: - '4' target_platform: - linux-ppc64le +zip_keys: +- - c_stdlib_version + - cdt_name diff --git a/.ci_support/migrations/r-base44_and_m2w64-ucrt.yaml b/.ci_support/migrations/r-base44_and_m2w64-ucrt.yaml new file mode 100644 index 0000000..ee9f9ba --- /dev/null +++ b/.ci_support/migrations/r-base44_and_m2w64-ucrt.yaml @@ -0,0 +1,50 @@ +migrator_ts: 1718391654 +__migrator: + kind: version + migration_number: 1 + bump_number: 1 + commit_message: "Rebuild for r-base 4.4 and UCRT mingw toolchain" + primary_key: r_base + automerge: True + longterm: True + include_noarch: True + pr_limit: 40 + override_cbc_keys: + - r-base + - r_base + - m2w64_c_compiler_stub + - m2w64_cxx_compiler_stub + - m2w64_fortran_compiler_stub + ordering: + m2w64_c_compiler: + - m2w64-toolchain + - gcc + m2w64_cxx_compiler: + - m2w64-toolchain + - gxx + m2w64_fortran_compiler: + - m2w64-toolchain + - gfortran + m2w64_c_stdlib: + - m2w64-toolchain + - m2w64-sysroot + +r_base: + - 4.3 + - 4.4 +m2w64_c_compiler: # [win] + - gcc # [win] +m2w64_c_compiler_version: # [win] + - 13 # [win] +m2w64_cxx_compiler: # [win] + - gxx # [win] +m2w64_cxx_compiler_version: # [win] + - 13 # [win] +m2w64_fortran_compiler: # [win] + - gfortran # [win] +m2w64_fortran_compiler_version: # [win] + - 13 # [win] +m2w64_c_stdlib: # [win] + - m2w64-sysroot # [win] +m2w64_c_stdlib_version: # [win] + - 12 # [win] diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index f4882f3..62b800d 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -1,9 +1,15 @@ MACOSX_DEPLOYMENT_TARGET: -- '10.9' +- '10.13' +MACOSX_SDK_VERSION: +- '10.13' c_compiler: - clang c_compiler_version: -- '14' +- '17' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '10.13' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml index d1a91a5..b838153 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -1,9 +1,15 @@ MACOSX_DEPLOYMENT_TARGET: - '11.0' +MACOSX_SDK_VERSION: +- '11.0' c_compiler: - clang c_compiler_version: -- '14' +- '17' +c_stdlib: +- macosx_deployment_target +c_stdlib_version: +- '11.0' channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index 58a4500..b7bf833 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -1,9 +1,17 @@ -c_compiler: -- vs2019 channel_sources: - conda-forge channel_targets: - conda-forge main +gmp: +- '6' +m2w64_c_compiler: +- gcc +m2w64_c_compiler_version: +- '13' +m2w64_c_stdlib: +- m2w64-sysroot +m2w64_c_stdlib_version: +- '12' mpfr: - '4' target_platform: 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..179afe5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,24 @@ -*.pyc +# 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/** -build_artifacts +# 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 diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 71a4242..6c805a9 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -28,14 +28,15 @@ conda-build: pkgs_dirs: - ${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache - /opt/conda/pkgs +solver: libmamba CONDARC +export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 - -mamba install --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" -mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" +mamba install --update-specs --yes --quiet --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" # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -64,9 +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" + --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/.scripts/logging_utils.sh b/.scripts/logging_utils.sh index 57bc95c..aff009f 100644 --- a/.scripts/logging_utils.sh +++ b/.scripts/logging_utils.sh @@ -12,7 +12,7 @@ function startgroup { echo "##[group]$1";; travis ) echo "$1" - echo -en 'travis_fold:start:'"${1// /}"'\\r';; + echo -en 'travis_fold:start:'"${1// /}"'\r';; github_actions ) echo "::group::$1";; * ) @@ -28,7 +28,7 @@ function endgroup { azure ) echo "##[endgroup]";; travis ) - echo -en 'travis_fold:end:'"${1// /}"'\\r';; + 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 9236239..00f377a 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -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 caa788e..4ebc38f 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -11,7 +11,7 @@ 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" +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} @@ -22,11 +22,13 @@ bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} 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 \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" -mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 "py-lief<0.12" +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" @@ -45,6 +47,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 @@ -55,7 +61,6 @@ source run_conda_forge_build_setup 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 @@ -71,9 +76,18 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else - 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.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/.scripts/run_win_build.bat b/.scripts/run_win_build.bat new file mode 100755 index 0000000..24ef201 --- /dev/null +++ b/.scripts/run_win_build.bat @@ -0,0 +1,125 @@ +:: 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. + +:: 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 +:: UPLOAD_PACKAGES: true or false +:: UPLOAD_ON_BRANCH: true or false + +setlocal enableextensions enabledelayedexpansion + +call :start_group "Configuring conda" + +:: Activate the base conda environment +call activate base +:: Configure the solver +set "CONDA_SOLVER=libmamba" +if !errorlevel! neq 0 exit /b !errorlevel! +set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" + +:: Provision the necessary dependencies to build the recipe later +echo Installing dependencies +mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -c conda-forge --strict-channel-priority --yes +if !errorlevel! neq 0 exit /b !errorlevel! + +:: 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 +CALL run_conda_forge_build_setup + + +if !errorlevel! neq 0 exit /b !errorlevel! + +if EXIST LICENSE.txt ( + echo Copying feedstock license + copy LICENSE.txt "recipe\\recipe-scripts-license.txt" +) + +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-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.6.0 +WHERE inspect_artifacts >nul 2>nul && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" +call :end_group + +:: Prepare some environment variables for the upload step +if /i "%CI%" == "github_actions" ( + set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" + set "GIT_BRANCH=%GITHUB_REF:refs/heads/=%" + if /i "%GITHUB_EVENT_NAME%" == "pull_request" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%RUNNER_TEMP%" +) +if /i "%CI%" == "azure" ( + set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" + set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" + if /i "%BUILD_REASON%" == "PullRequest" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%UPLOAD_TEMP%" +) + +:: Validate +call :start_group "Validating outputs" +validate_recipe_outputs "%FEEDSTOCK_NAME%" +if !errorlevel! neq 0 exit /b !errorlevel! +call :end_group + +if /i "%UPLOAD_PACKAGES%" == "true" ( + if /i "%IS_PR_BUILD%" == "false" ( + 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 + if !errorlevel! neq 0 exit /b !errorlevel! + call :end_group + ) +) + +exit + +:: Logging subroutines + +:start_group +if /i "%CI%" == "github_actions" ( + echo ::group::%~1 + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[group]%~1 + exit /b +) +echo %~1 +exit /b + +:end_group +if /i "%CI%" == "github_actions" ( + echo ::endgroup:: + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[endgroup] + exit /b +) +exit /b \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 58a72eb..0edc914 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ # This file was generated automatically from conda-smithy. To update this configuration, # update the conda-forge.yml and/or the recipe/meta.yaml. -language: generic +language: shell -matrix: +jobs: include: - env: CONFIG=linux_aarch64_ UPLOAD_PACKAGES=True PLATFORM=linux-aarch64 DOCKER_IMAGE=quay.io/condaforge/linux-anvil-aarch64 os: linux @@ -20,6 +20,9 @@ matrix: script: - export CI=travis - export GIT_BRANCH="$TRAVIS_BRANCH" + - export flow_run_id="travis_$TRAVIS_JOB_ID" + - export sha="$TRAVIS_COMMIT" + - export remote_url="https://github.com/$TRAVIS_REPO_SLUG" - export FEEDSTOCK_NAME=$(basename ${TRAVIS_REPO_SLUG}) - if [[ "${TRAVIS_PULL_REQUEST:-}" == "false" ]]; then export IS_PR_BUILD="False"; else export IS_PR_BUILD="True"; fi diff --git a/README.md b/README.md index 853a73e..381329a 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -About mpc -========= +About mpc-feedstock +=================== + +Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/mpc-feedstock/blob/main/LICENSE.txt) Home: http://www.multiprecision.org/ Package license: LGPL-3.0-or-later -Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/mpc-feedstock/blob/main/LICENSE.txt) - Summary: A C library for the arithmetic of complex numbers with arbitrarily high precision. Current build status @@ -156,7 +156,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..e5306da 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,5 +4,5 @@ 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 + - 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..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 fd7dd265284a4b7b37b89fa6d5fa73edfefdc8a6 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 28 Aug 2024 09:15:40 -0500 Subject: [PATCH 2/3] Use gmp --- recipe/bld.bat | 17 +++++++++++++++-- recipe/build.sh | 10 +++++----- recipe/meta.yaml | 28 ++++++++++++++++------------ 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index ad8dc0d..97b09bf 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -1,2 +1,15 @@ -call %BUILD_PREFIX%\Library\bin\run_autotools_clang_conda_build.bat -if %ERRORLEVEL% neq 0 exit 1 +echo source %SYS_PREFIX:\=/%/etc/profile.d/conda.sh > conda_build.sh +echo conda activate "${PREFIX}" >> conda_build.sh +echo conda activate --stack "${BUILD_PREFIX}" >> conda_build.sh +echo CONDA_PREFIX=${CONDA_PREFIX//\\//} >> conda_build.sh +type "%RECIPE_DIR%\build.sh" >> conda_build.sh + +set PREFIX=%PREFIX:\=/% +set BUILD_PREFIX=%BUILD_PREFIX:\=/% +set CONDA_PREFIX=%CONDA_PREFIX:\=/% +set SRC_DIR=%SRC_DIR:\=/% +set MSYSTEM=UCRT64 +set MSYS2_PATH_TYPE=inherit +set CHERE_INVOKING=1 +bash -lc "./conda_build.sh" +if errorlevel 1 exit 1 diff --git a/recipe/build.sh b/recipe/build.sh index abf0081..8014065 100755 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -4,9 +4,7 @@ cp $BUILD_PREFIX/share/gnuconfig/config.* build-aux/ || true if [[ "$target_platform" == "win-64" ]]; then - export CPPFLAGS="$CPPFLAGS -DMSC_USE_DLL" - sed -i.bak "s@-Wl,--output-def,.libs/libmpfr-6.dll.def@@g" configure - sed -i.bak "s@ -version-info [0-9\:]\+@ -avoid-version@g" src/Makefile.in + export PREFIX=${PREFIX}/Library fi ./configure --prefix=$PREFIX \ @@ -14,10 +12,12 @@ fi --with-mpfr=$PREFIX \ --disable-static -[[ "$target_platform" == "win-64" ]] && patch_libtool - make -j${CPU_COUNT} if [[ "$CONDA_BUILD_CROSS_COMPILATION" != 1 ]]; then make check -j${CPU_COUNT} fi make install + +if [[ "$target_platform" == "win-64" ]]; then + cp ${PREFIX}/lib/libmpfr.dll.a ${PREFIX}/lib/mpfr.lib +fi diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 6a9cd13..ebdcdf5 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,8 @@ {% set version = "1.3.1" %} +{% if build_platform is undefined %} +{% set build_platform = "linux-64" %} +{% endif %} +{% set posix = "m2-" if build_platform.startswith("win-") else '' %} package: name: mpc @@ -16,25 +20,25 @@ build: requirements: build: - - gnuconfig # [unix] - - {{ compiler('c') }} - - autotools_clang_conda # [win] - - make # [unix] - - {{ compiler('c') }} + - libtool # [unix] + - m4 # [unix] + - gnuconfig + - {{ posix }}make + - {{ posix }}base # [build_platform.startswith("win-")] + - {{ posix }}diffutils # [build_platform.startswith("win-")] + - {{ compiler('c') }} # [unix] + - {{ stdlib('c') }} # [unix] + - {{ compiler('m2w64_c') }} # [win] + - {{ stdlib('m2w64_c') }} # [win] host: - - gmp # [unix] - - mpir # [win] - - mpfr - run: - - gmp # [unix] - - mpir # [win] + - gmp - mpfr test: commands: - if not exist %LIBRARY_INC%\\mpc.h exit 1 # [win] - if not exist %LIBRARY_LIB%\\mpc.lib exit 1 # [win] - - if not exist %LIBRARY_BIN%\\mpc.dll exit 1 # [win] + - if not exist %LIBRARY_BIN%\\libmpc-3.dll exit 1 # [win] - test -f ${PREFIX}/include/mpc.h # [unix] - test -f ${PREFIX}/lib/libmpc.dylib # [osx] - test -f ${PREFIX}/lib/libmpc.so # [linux] From 59be480a5a39e853613f837fbfbd8e280e697492 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 28 Aug 2024 09:42:01 -0500 Subject: [PATCH 3/3] fix copy paste error --- recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index 8014065..319090f 100755 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -19,5 +19,5 @@ fi make install if [[ "$target_platform" == "win-64" ]]; then - cp ${PREFIX}/lib/libmpfr.dll.a ${PREFIX}/lib/mpfr.lib + cp ${PREFIX}/lib/libmpc.dll.a ${PREFIX}/lib/mpc.lib fi