From 69606c3da9309fa1eb9129f80eff1515e8793d78 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Tue, 29 Oct 2019 02:15:36 -0400 Subject: [PATCH 1/6] Drop per package CPU/GPU mutexes Based on discussions with the xgboost developers, it appears that only the C++ library changes based on whether it is built in CPU or GPU mode. The other language bindings do not change based on whether this functionality exists or not. So drop all of the per package mutexes to streamline things a bit. --- recipe/meta.yaml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8754a662..321f8f29 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -47,11 +47,6 @@ outputs: run: - llvm-openmp # [osx] - - name: _py-xgboost-mutex - version: 2.0 - build: - string: cpu_0 - - name: py-xgboost script: install-py-xgboost.sh requirements: @@ -62,7 +57,6 @@ outputs: - pip run: - {{ pin_subpackage('libxgboost', exact=True) }} - - {{ pin_subpackage('_py-xgboost-mutex', exact=True) }} - python - numpy - scipy @@ -72,14 +66,6 @@ outputs: imports: - xgboost - - name: py-xgboost-cpu - requirements: - host: - - python - run: - - python - - {{ pin_subpackage('py-xgboost', exact=True) }} - - name: xgboost requirements: host: @@ -91,11 +77,6 @@ outputs: - python - {{ pin_subpackage('py-xgboost', exact=True) }} - - name: _r-xgboost-mutex - version: 2.0 - build: - string: cpu_0 - - name: r-xgboost script: install-r-xgboost.sh build: @@ -120,7 +101,6 @@ outputs: - r-knitr run: - {{ pin_subpackage('libxgboost', exact=True) }} - - {{ pin_subpackage('_r-xgboost-mutex', exact=True) }} - llvm-openmp # [osx] - r-base - r-matrix @@ -133,14 +113,6 @@ outputs: commands: - Rscript test-r-xgboost.r - - name: r-xgboost-cpu - requirements: - host: - - r-base - run: - - r-base - - {{ pin_subpackage('r-xgboost', exact=True) }} - about: home: https://github.com/dmlc/xgboost license: Apache-2.0 From 19c435dde25e884f42ac2c6be698a8b4ca2a88f1 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Tue, 29 Oct 2019 02:15:37 -0400 Subject: [PATCH 2/6] MNT: Re-rendered with conda-build 3.18.10, conda-smithy 3.6.0, and conda-forge-pinning 2019.10.22 Now that the per package CPU/GPU mutexes have been dropped, re-render the feedstock to update its content accordingly. --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8a2206ce..29e17a78 100644 --- a/README.md +++ b/README.md @@ -75,13 +75,9 @@ Current release info | Name | Downloads | Version | Platforms | | --- | --- | --- | --- | -| [![Conda Recipe](https://img.shields.io/badge/recipe-_py--xgboost--mutex-green.svg)](https://anaconda.org/conda-forge/_py-xgboost-mutex) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/_py-xgboost-mutex.svg)](https://anaconda.org/conda-forge/_py-xgboost-mutex) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/_py-xgboost-mutex.svg)](https://anaconda.org/conda-forge/_py-xgboost-mutex) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/_py-xgboost-mutex.svg)](https://anaconda.org/conda-forge/_py-xgboost-mutex) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-_r--xgboost--mutex-green.svg)](https://anaconda.org/conda-forge/_r-xgboost-mutex) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/_r-xgboost-mutex.svg)](https://anaconda.org/conda-forge/_r-xgboost-mutex) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/_r-xgboost-mutex.svg)](https://anaconda.org/conda-forge/_r-xgboost-mutex) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/_r-xgboost-mutex.svg)](https://anaconda.org/conda-forge/_r-xgboost-mutex) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libxgboost-green.svg)](https://anaconda.org/conda-forge/libxgboost) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libxgboost.svg)](https://anaconda.org/conda-forge/libxgboost) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libxgboost.svg)](https://anaconda.org/conda-forge/libxgboost) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libxgboost.svg)](https://anaconda.org/conda-forge/libxgboost) | | [![Conda Recipe](https://img.shields.io/badge/recipe-py--xgboost-green.svg)](https://anaconda.org/conda-forge/py-xgboost) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/py-xgboost.svg)](https://anaconda.org/conda-forge/py-xgboost) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/py-xgboost.svg)](https://anaconda.org/conda-forge/py-xgboost) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/py-xgboost.svg)](https://anaconda.org/conda-forge/py-xgboost) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-py--xgboost--cpu-green.svg)](https://anaconda.org/conda-forge/py-xgboost-cpu) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/py-xgboost-cpu.svg)](https://anaconda.org/conda-forge/py-xgboost-cpu) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/py-xgboost-cpu.svg)](https://anaconda.org/conda-forge/py-xgboost-cpu) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/py-xgboost-cpu.svg)](https://anaconda.org/conda-forge/py-xgboost-cpu) | | [![Conda Recipe](https://img.shields.io/badge/recipe-r--xgboost-green.svg)](https://anaconda.org/conda-forge/r-xgboost) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/r-xgboost.svg)](https://anaconda.org/conda-forge/r-xgboost) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/r-xgboost.svg)](https://anaconda.org/conda-forge/r-xgboost) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/r-xgboost.svg)](https://anaconda.org/conda-forge/r-xgboost) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-r--xgboost--cpu-green.svg)](https://anaconda.org/conda-forge/r-xgboost-cpu) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/r-xgboost-cpu.svg)](https://anaconda.org/conda-forge/r-xgboost-cpu) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/r-xgboost-cpu.svg)](https://anaconda.org/conda-forge/r-xgboost-cpu) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/r-xgboost-cpu.svg)](https://anaconda.org/conda-forge/r-xgboost-cpu) | | [![Conda Recipe](https://img.shields.io/badge/recipe-xgboost-green.svg)](https://anaconda.org/conda-forge/xgboost) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/xgboost.svg)](https://anaconda.org/conda-forge/xgboost) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/xgboost.svg)](https://anaconda.org/conda-forge/xgboost) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/xgboost.svg)](https://anaconda.org/conda-forge/xgboost) | Installing xgboost @@ -93,16 +89,16 @@ Installing `xgboost` from the `conda-forge` channel can be achieved by adding `c conda config --add channels conda-forge ``` -Once the `conda-forge` channel has been enabled, `_py-xgboost-mutex, _r-xgboost-mutex, libxgboost, py-xgboost, py-xgboost-cpu, r-xgboost, r-xgboost-cpu, xgboost` can be installed with: +Once the `conda-forge` channel has been enabled, `libxgboost, py-xgboost, r-xgboost, xgboost` can be installed with: ``` -conda install _py-xgboost-mutex _r-xgboost-mutex libxgboost py-xgboost py-xgboost-cpu r-xgboost r-xgboost-cpu xgboost +conda install libxgboost py-xgboost r-xgboost xgboost ``` -It is possible to list all of the versions of `_py-xgboost-mutex` available on your platform with: +It is possible to list all of the versions of `libxgboost` available on your platform with: ``` -conda search _py-xgboost-mutex --channel conda-forge +conda search libxgboost --channel conda-forge ``` From 236c6c3283c7f02a10f57ef16a806f204a126a85 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Tue, 29 Oct 2019 02:15:38 -0400 Subject: [PATCH 3/6] Add `xgboost-proc` to allow CPU/GPU selection As only the C++ library changes between CPU and GPU builds, add a meta package to allow selection between the two builds of the C++ library. Since this does not include GPU builds yet, simply set the selection package to CPU only. --- recipe/meta.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 321f8f29..c1b1bce8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,6 +1,8 @@ {% set name = "xgboost" %} {% set version = "0.90" %} +{% set xgboost_proc_type = "cpu" %} + package: name: {{ name|lower }} version: {{ version }} @@ -32,6 +34,20 @@ requirements: - llvm-openmp # [osx] outputs: + - name: xgboost-proc + version: 1.0.0 + build: + number: 0 + string: "{{ xgboost_proc_type }}" + test: + commands: + - exit 0 + about: + home: https://github.com/conda-forge/xgboost-feedstock + license: BSD-3-Clause + license_family: BSD + summary: A meta-package to select CPU or GPU xgboost build. + - name: libxgboost script: install-libxgboost.sh requirements: @@ -46,6 +62,8 @@ outputs: - llvm-openmp # [osx] run: - llvm-openmp # [osx] + run_constrained: + - xgboost-proc * {{ xgboost_proc_type }} - name: py-xgboost script: install-py-xgboost.sh From dbccc17438644af418b40ef5abde8dbd1e07420b Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Tue, 29 Oct 2019 02:15:38 -0400 Subject: [PATCH 4/6] MNT: Re-rendered with conda-build 3.18.10, conda-smithy 3.6.0, and conda-forge-pinning 2019.10.22 Now that `xgboost-proc` has been added for CPU/GPU selection, re-render to update the feedstock content accordingly. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 29e17a78..98e1baa1 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ Current release info | [![Conda Recipe](https://img.shields.io/badge/recipe-py--xgboost-green.svg)](https://anaconda.org/conda-forge/py-xgboost) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/py-xgboost.svg)](https://anaconda.org/conda-forge/py-xgboost) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/py-xgboost.svg)](https://anaconda.org/conda-forge/py-xgboost) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/py-xgboost.svg)](https://anaconda.org/conda-forge/py-xgboost) | | [![Conda Recipe](https://img.shields.io/badge/recipe-r--xgboost-green.svg)](https://anaconda.org/conda-forge/r-xgboost) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/r-xgboost.svg)](https://anaconda.org/conda-forge/r-xgboost) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/r-xgboost.svg)](https://anaconda.org/conda-forge/r-xgboost) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/r-xgboost.svg)](https://anaconda.org/conda-forge/r-xgboost) | | [![Conda Recipe](https://img.shields.io/badge/recipe-xgboost-green.svg)](https://anaconda.org/conda-forge/xgboost) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/xgboost.svg)](https://anaconda.org/conda-forge/xgboost) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/xgboost.svg)](https://anaconda.org/conda-forge/xgboost) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/xgboost.svg)](https://anaconda.org/conda-forge/xgboost) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-xgboost--proc-green.svg)](https://anaconda.org/conda-forge/xgboost-proc) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/xgboost-proc.svg)](https://anaconda.org/conda-forge/xgboost-proc) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/xgboost-proc.svg)](https://anaconda.org/conda-forge/xgboost-proc) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/xgboost-proc.svg)](https://anaconda.org/conda-forge/xgboost-proc) | Installing xgboost ================== @@ -89,10 +90,10 @@ Installing `xgboost` from the `conda-forge` channel can be achieved by adding `c conda config --add channels conda-forge ``` -Once the `conda-forge` channel has been enabled, `libxgboost, py-xgboost, r-xgboost, xgboost` can be installed with: +Once the `conda-forge` channel has been enabled, `libxgboost, py-xgboost, r-xgboost, xgboost, xgboost-proc` can be installed with: ``` -conda install libxgboost py-xgboost r-xgboost xgboost +conda install libxgboost py-xgboost r-xgboost xgboost xgboost-proc ``` It is possible to list all of the versions of `libxgboost` available on your platform with: From 07b70955af424d7322d94e8df86b756b63e610ea Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Tue, 29 Oct 2019 02:15:39 -0400 Subject: [PATCH 5/6] Bump build number to 5 Rebuild all of the packages now that the CPU/GPU selection metapackages have been restructured. --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c1b1bce8..911351f0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -19,7 +19,7 @@ source: - 0003-Fix-R-package-mingw-w64-compiler-flags-remove-m64.patch build: - number: 4 + number: 5 skip: true # [win or linux32 or py2k] requirements: From 47245fcb30ee915238c602c52424c3146b2311cc Mon Sep 17 00:00:00 2001 From: jakirkham Date: Thu, 6 Jul 2023 02:10:20 -0700 Subject: [PATCH 6/6] MNT: Re-rendered with conda-build 3.24.0, conda-smithy 3.23.1, and conda-forge-pinning 2023.07.06.05.56.46 --- .azure-pipelines/azure-pipelines-linux.yml | 25 ++++-- .azure-pipelines/azure-pipelines-osx.yml | 75 ++++------------ .ci_support/README | 7 +- .ci_support/{linux_.yaml => linux_64_.yaml} | 23 +++-- .ci_support/{osx_.yaml => osx_64_.yaml} | 23 +++-- .circleci/config.yml | 5 +- .gitattributes | 3 + .github/workflows/automerge.yml | 19 ++++ .github/workflows/webservices.yml | 13 +++ .scripts/build_steps.sh | 57 ++++++++++-- .scripts/logging_utils.sh | 35 ++++++++ .scripts/run_docker_build.sh | 50 ++++++++--- .scripts/run_osx_build.sh | 85 ++++++++++++++++++ LICENSE.txt | 32 +++++-- README.md | 96 ++++++++++++++------- build-locally.py | 48 ++++++++++- 16 files changed, 447 insertions(+), 149 deletions(-) rename .ci_support/{linux_.yaml => linux_64_.yaml} (52%) rename .ci_support/{osx_.yaml => osx_64_.yaml} (63%) create mode 100644 .github/workflows/automerge.yml create mode 100644 .github/workflows/webservices.yml create mode 100644 .scripts/logging_utils.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 index 9ffb709e..8f69b57a 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -5,16 +5,21 @@ jobs: - job: linux pool: - vmImage: ubuntu-16.04 - timeoutInMinutes: 360 + vmImage: ubuntu-latest strategy: - maxParallel: 8 matrix: - linux_: - CONFIG: linux_ - UPLOAD_PACKAGES: True - DOCKER_IMAGE: condaforge/linux-anvil-comp7 + linux_64_: + CONFIG: linux_64_ + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + timeoutInMinutes: 360 + 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: | @@ -26,6 +31,12 @@ jobs: - script: | export CI=azure 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: diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index ca725089..394fdcae 100755 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -5,72 +5,27 @@ jobs: - job: osx pool: - vmImage: macOS-10.13 - timeoutInMinutes: 360 + vmImage: macOS-11 strategy: - maxParallel: 8 matrix: - osx_: - CONFIG: osx_ - UPLOAD_PACKAGES: True + osx_64_: + CONFIG: osx_64_ + UPLOAD_PACKAGES: 'True' + timeoutInMinutes: 360 steps: # TODO: Fast finish on azure pipelines? - script: | - echo "Fast Finish" - - - - script: | - echo "Removing homebrew from Azure to avoid conflicts." - curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew - chmod +x ~/uninstall_homebrew - ~/uninstall_homebrew -fq - rm ~/uninstall_homebrew - displayName: Remove homebrew - - - bash: | - echo "##vso[task.prependpath]$CONDA/bin" - sudo chown -R $USER $CONDA - displayName: Add conda to PATH - - - script: | - source activate base - conda install -n base -c conda-forge --quiet --yes conda-forge-ci-setup=2 conda-build - displayName: 'Add conda-forge-ci-setup=2' - - - script: | - source activate base - echo "Configuring conda." - - setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml export CI=azure - source run_conda_forge_build_setup - conda update --yes --quiet --override-channels -c conda-forge -c defaults --all - env: { - OSX_FORCE_SDK_DOWNLOAD: "1" - } - displayName: Configure conda and conda-build - - - script: | - source activate base - mangle_compiler ./ ./recipe ./.ci_support/${CONFIG}.yaml - displayName: Mangle compiler - - - script: | - source activate base - make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml - displayName: Generate build number clobber file - - - script: | - source activate base - conda build ./recipe -m ./.ci_support/${CONFIG}.yaml --clobber-file ./.ci_support/clobber_${CONFIG}.yaml - displayName: Build recipe - - - script: | - source activate base + export OSX_FORCE_SDK_DOWNLOAD="1" export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME - upload_package ./ ./recipe ./.ci_support/${CONFIG}.yaml - displayName: Upload package + 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) - condition: not(eq(variables['UPLOAD_PACKAGES'], 'False')) \ No newline at end of file + BINSTAR_TOKEN: $(BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/README b/.ci_support/README index e4e2dcec..a47316be 100644 --- a/.ci_support/README +++ b/.ci_support/README @@ -1 +1,6 @@ -This file is automatically generated by conda-smithy. To change any matrix elements, you should change conda-smithy's input conda_build_config.yaml and re-render the recipe, rather than editing these files directly. \ No newline at end of file +This file is automatically generated by conda-smithy. If any +particular build configuration is expected, but it is not found, +please make sure all dependencies are satisfiable. To add/modify any +matrix elements, you should create/change conda-smithy's input +recipe/conda_build_config.yaml and re-render the recipe, rather than +editing these files directly. diff --git a/.ci_support/linux_.yaml b/.ci_support/linux_64_.yaml similarity index 52% rename from .ci_support/linux_.yaml rename to .ci_support/linux_64_.yaml index 40bac39d..e1e88f36 100644 --- a/.ci_support/linux_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,17 +1,19 @@ c_compiler: - gcc c_compiler_version: -- '7' +- '12' +cdt_name: +- cos6 channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cxx_compiler: - gxx cxx_compiler_version: -- '7' +- '12' docker_image: -- condaforge/linux-anvil-comp7 +- quay.io/condaforge/linux-anvil-cos7-x86_64 pin_run_as_build: python: min_pin: x.x @@ -20,8 +22,13 @@ pin_run_as_build: min_pin: x.x max_pin: x.x python: -- '3.6' -- '3.7' +- 3.10.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_cpython r_base: -- 3.5.1 -- '3.6' +- '4.2' +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version diff --git a/.ci_support/osx_.yaml b/.ci_support/osx_64_.yaml similarity index 63% rename from .ci_support/osx_.yaml rename to .ci_support/osx_64_.yaml index 750d0593..ea6efad5 100644 --- a/.ci_support/osx_.yaml +++ b/.ci_support/osx_64_.yaml @@ -3,19 +3,19 @@ MACOSX_DEPLOYMENT_TARGET: c_compiler: - clang c_compiler_version: -- '9' +- '15' channel_sources: -- conda-forge,defaults +- conda-forge channel_targets: - conda-forge main cxx_compiler: - clangxx cxx_compiler_version: -- '9' +- '15' +llvm_openmp: +- '15' macos_machine: - x86_64-apple-darwin13.4.0 -macos_min_version: -- '10.9' pin_run_as_build: python: min_pin: x.x @@ -24,8 +24,13 @@ pin_run_as_build: min_pin: x.x max_pin: x.x python: -- '3.6' -- '3.7' +- 3.10.* *_cpython +- 3.8.* *_cpython +- 3.9.* *_cpython r_base: -- 3.5.1 -- '3.6' +- '4.2' +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ad461b8..8b4ef2f9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,14 @@ # 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 -*- +# -*- mode: jinja-yaml -*- version: 2 jobs: build: working_directory: ~/test - machine: true + machine: + image: ubuntu-2004:current steps: - run: # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. diff --git a/.gitattributes b/.gitattributes index 86ff9377..7f327638 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ bld.bat text eol=crlf # github helper pieces to make some files not show up in diffs automatically .azure-pipelines/* linguist-generated=true .circleci/* linguist-generated=true +.ci_support/README linguist-generated=true .drone/* linguist-generated=true .drone.yml linguist-generated=true .github/* linguist-generated=true @@ -17,6 +18,8 @@ bld.bat text eol=crlf .gitattributes linguist-generated=true .gitignore linguist-generated=true .travis.yml linguist-generated=true +.scripts/* linguist-generated=true +.woodpecker.yml linguist-generated=true LICENSE.txt linguist-generated=true README.md linguist-generated=true azure-pipelines.yml linguist-generated=true diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 00000000..da1368a1 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,19 @@ +on: + status: {} + check_suite: + types: + - completed + +jobs: + automerge-action: + runs-on: ubuntu-latest + name: automerge + steps: + - name: checkout + uses: actions/checkout@v3 + - name: automerge-action + id: automerge-action + uses: conda-forge/automerge-action@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/.github/workflows/webservices.yml b/.github/workflows/webservices.yml new file mode 100644 index 00000000..d6f06b5c --- /dev/null +++ b/.github/workflows/webservices.yml @@ -0,0 +1,13 @@ +on: repository_dispatch + +jobs: + webservices: + runs-on: ubuntu-latest + name: webservices + steps: + - name: webservices + id: webservices + uses: conda-forge/webservices-dispatch-action@main + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + rerendering_github_token: ${{ secrets.RERENDERING_GITHUB_TOKEN }} diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 8a4af44f..e21030ca 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -5,9 +5,18 @@ # 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 PYTHONUNBUFFERED=1 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" @@ -15,11 +24,18 @@ 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" + + ( startgroup "Uploading packages" ) 2> /dev/null + + if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then + upload_package "${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/logging_utils.sh b/.scripts/logging_utils.sh new file mode 100644 index 00000000..57bc95c2 --- /dev/null +++ b/.scripts/logging_utils.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Provide a unified interface for the different logging +# utilities CI providers offer. If unavailable, provide +# a compatible fallback (e.g. bare `echo xxxxxx`). + +function startgroup { + # Start a foldable group of log lines + # Pass a single argument, quoted + case ${CI:-} in + azure ) + echo "##[group]$1";; + travis ) + echo "$1" + echo -en 'travis_fold:start:'"${1// /}"'\\r';; + github_actions ) + echo "::group::$1";; + * ) + echo "$1";; + esac +} 2> /dev/null + +function endgroup { + # End a foldable group of log lines + # Pass a single argument, quoted + + case ${CI:-} in + azure ) + echo "##[endgroup]";; + travis ) + echo -en 'travis_fold:end:'"${1// /}"'\\r';; + github_actions ) + echo "::endgroup::";; + esac +} 2> /dev/null diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 066a8575..c4079b7a 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -5,14 +5,22 @@ # 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")/.."; pwd;) +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 + docker info # In order for the conda-build process in the container to write to the mounted @@ -41,10 +49,14 @@ 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. Falling back to condaforge/linux-anvil-comp7" - DOCKER_IMAGE="condaforge/linux-anvil-comp7" + 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 condaforge/linux-anvil-comp7 )" + DOCKER_IMAGE="$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-value docker_image.0 quay.io/condaforge/linux-anvil-comp7 )" fi fi @@ -52,24 +64,40 @@ 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="-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:ro,z \ - -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z \ + -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ + -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z,delegated \ -e CONFIG \ - -e BINSTAR_TOKEN \ -e HOST_USER_ID \ -e UPLOAD_PACKAGES \ + -e IS_PR_BUILD \ -e GIT_BRANCH \ -e UPLOAD_ON_BRANCH \ -e CI \ - $DOCKER_IMAGE \ + -e FEEDSTOCK_NAME \ + -e CPU_COUNT \ + -e BUILD_WITH_CONDA_DEBUG \ + -e BUILD_OUTPUT_ID \ + -e BINSTAR_TOKEN \ + "${DOCKER_IMAGE}" \ bash \ - /home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh + "/home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh" # verify that the end of the script was reached -test -f "$DONE_CANARY" \ No newline at end of file +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 00000000..f7256b52 --- /dev/null +++ b/.scripts/run_osx_build.sh @@ -0,0 +1,85 @@ +#!/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="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 + +( startgroup "Configuring conda" ) 2> /dev/null + +source ${MINIFORGE_HOME}/etc/profile.d/conda.sh +conda activate base + +mamba install --update-specs --quiet --yes --channel conda-forge \ + conda-build pip boa conda-forge-ci-setup=3 +mamba update --update-specs --yes --quiet --channel conda-forge \ + conda-build pip boa conda-forge-ci-setup=3 + + + +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 + +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 mambabuild ./recipe -m ./.ci_support/${CONFIG}.yaml \ + --suppress-variables ${EXTRA_CB_OPTIONS:-} \ + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + + ( startgroup "Uploading packages" ) 2> /dev/null + + if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then + upload_package ./ ./recipe ./.ci_support/${CONFIG}.yaml + fi + + ( endgroup "Uploading packages" ) 2> /dev/null +fi \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index cba42cff..2ec51d75 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,13 +1,27 @@ -BSD 3-clause license -Copyright (c) 2015-2019, conda-forge +BSD-3-Clause license +Copyright (c) 2015-2022, conda-forge contributors All rights reserved. -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/README.md b/README.md index 98e1baa1..8dfa242a 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,38 @@ +About xgboost-feedstock +======================= + +Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/xgboost-feedstock/blob/main/LICENSE.txt) + About xgboost -============= +------------- Home: https://github.com/dmlc/xgboost Package license: Apache-2.0 -Feedstock license: BSD 3-Clause - Summary: Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Flink and DataFlow +Development: https://github.com/dmlc/xgboost/ + +Documentation: https://xgboost.readthedocs.io/ + XGBoost is an optimized distributed gradient boosting library designed to be highly efficient, flexible and portable. It implements machine learning algorithms under the Gradient Boosting framework. XGBoost provides a parallel tree boosting (also known as GBDT, GBM) that solve many data science problems in a fast and accurate way. The same code runs on major distributed environment (Hadoop, SGE, MPI) and can solve problems beyond billions of examples. +About xgboost-proc +------------------ + +Home: https://github.com/conda-forge/xgboost-feedstock + +Package license: BSD-3-Clause + +Summary: A meta-package to select CPU or GPU xgboost build. Current build status ==================== @@ -30,24 +45,24 @@ Current build status
- - + + - + - + @@ -56,18 +71,6 @@ Current build status - - - - - - - -
VariantStatus
linuxlinux_64 - - variant + + variant
osxosx_64 - - variant + + variant
Windows - Windows disabled -
Linux_ppc64le - ppc64le disabled -
Current release info @@ -88,25 +91,52 @@ Installing `xgboost` from the `conda-forge` channel can be achieved by adding `c ``` conda config --add channels conda-forge +conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `libxgboost, py-xgboost, r-xgboost, xgboost, xgboost-proc` can be installed with: +Once the `conda-forge` channel has been enabled, `libxgboost, py-xgboost, r-xgboost, xgboost, xgboost-proc` can be installed with `conda`: ``` conda install libxgboost py-xgboost r-xgboost xgboost xgboost-proc ``` -It is possible to list all of the versions of `libxgboost` available on your platform with: +or with `mamba`: + +``` +mamba install libxgboost py-xgboost r-xgboost xgboost xgboost-proc +``` + +It is possible to list all of the versions of `libxgboost` available on your platform with `conda`: ``` conda search libxgboost --channel conda-forge ``` +or with `mamba`: + +``` +mamba search libxgboost --channel conda-forge +``` + +Alternatively, `mamba repoquery` may provide more information: + +``` +# Search all versions available on your platform: +mamba repoquery search libxgboost --channel conda-forge + +# List packages depending on `libxgboost`: +mamba repoquery whoneeds libxgboost --channel conda-forge + +# List dependencies of `libxgboost`: +mamba repoquery depends libxgboost --channel conda-forge +``` + About conda-forge ================= -[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](http://numfocus.org) +[![Powered by +NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org) conda-forge is a community-led conda channel of installable packages. In order to provide high-quality builds, the process has been automated into the @@ -116,10 +146,12 @@ for each of the installable packages. Such a repository is known as a *feedstock A feedstock is made up of a conda recipe (the instructions on what and how to build the package) and the necessary configurations for automatic building using freely available continuous integration services. Thanks to the awesome service provided by -[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/) -and [TravisCI](https://travis-ci.org/) it is possible to build and upload installable -packages to the [conda-forge](https://anaconda.org/conda-forge) -[Anaconda-Cloud](https://anaconda.org/) channel for Linux, Windows and OSX respectively. +[Azure](https://azure.microsoft.com/en-us/services/devops/), [GitHub](https://github.com/), +[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/), +[Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/) +it is possible to build and upload installable packages to the +[conda-forge](https://anaconda.org/conda-forge) [Anaconda-Cloud](https://anaconda.org/) +channel for Linux, Windows and OSX respectively. To manage the continuous integration and simplify feedstock maintenance [conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed. @@ -158,9 +190,9 @@ build distinct package versions. In order to produce a uniquely identifiable distribution: * If the version of a package **is not** being increased, please add or increase - the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string). + the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string). * If the version of a package **is** being increased, please remember to return - the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string) + the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string) back to 0. Feedstock Maintainers diff --git a/build-locally.py b/build-locally.py index 8f7ecca4..3f4b7a79 100755 --- a/build-locally.py +++ b/build-locally.py @@ -7,11 +7,21 @@ import glob import subprocess from argparse import ArgumentParser +import platform def setup_environment(ns): os.environ["CONFIG"] = ns.config os.environ["UPLOAD_PACKAGES"] = "False" + os.environ["IS_PR_BUILD"] = "True" + if ns.debug: + os.environ["BUILD_WITH_CONDA_DEBUG"] = "1" + if ns.output_id: + os.environ["BUILD_OUTPUT_ID"] = ns.output_id + if "MINIFORGE_HOME" not in os.environ: + os.environ["MINIFORGE_HOME"] = os.path.join( + os.path.dirname(__file__), "miniforge3" + ) def run_docker_build(ns): @@ -19,6 +29,11 @@ def run_docker_build(ns): subprocess.check_call([script]) +def run_osx_build(ns): + script = ".scripts/run_osx_build.sh" + subprocess.check_call([script]) + + def verify_config(ns): valid_configs = { os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml") @@ -42,21 +57,48 @@ def verify_config(ns): else: raise ValueError("config " + ns.config + " is not valid") # Remove the following, as implemented - if not ns.config.startswith("linux"): + if ns.config.startswith("win"): raise ValueError( - f"only Linux configs currently supported, got {ns.config}" + f"only Linux/macOS configs currently supported, got {ns.config}" ) + 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( + "--debug", + action="store_true", + help="Setup debug environment using `conda debug`", + ) + p.add_argument( + "--output-id", help="If running debug, specify the output to setup." + ) ns = p.parse_args(args=args) verify_config(ns) setup_environment(ns) - run_docker_build(ns) + try: + if ns.config.startswith("linux") or ( + ns.config.startswith("osx") and platform.system() == "Linux" + ): + run_docker_build(ns) + elif ns.config.startswith("osx"): + run_osx_build(ns) + finally: + recipe_license_file = os.path.join( + "recipe", "recipe-scripts-license.txt" + ) + if os.path.exists(recipe_license_file): + os.remove(recipe_license_file) if __name__ == "__main__":