diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index 6642027..386b32b 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-10.15 + vmImage: macOS-11 strategy: matrix: osx_64_python3.10.____cpython: diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index acd7907..1a5a655 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -31,45 +31,27 @@ jobs: CONDA_BLD_PATH: D:\\bld\\ steps: - - script: | - choco install vcpython27 -fdv -y --debug - condition: contains(variables['CONFIG'], 'vs2008') - displayName: Install vcpython27.msi (if needed) - - # Cygwin's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) - # - script: rmdir C:\cygwin /s /q - # continueOnError: true - - - powershell: | - Set-PSDebug -Trace 1 - - $batchcontent = @" - ECHO ON - SET vcpython=C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0 - - DIR "%vcpython%" - - CALL "%vcpython%\vcvarsall.bat" %* - "@ - - $batchDir = "C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC" - $batchPath = "$batchDir" + "\vcvarsall.bat" - New-Item -Path $batchPath -ItemType "file" -Force - - Set-Content -Value $batchcontent -Path $batchPath + - 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) - Get-ChildItem -Path $batchDir + - script: | + start /wait "" %BUILD_ARTIFACTSTAGINGDIRECTORY%\Miniforge.exe /InstallationType=JustMe /RegisterPython=0 /S /D=C:\Miniforge + displayName: Install Miniforge - Get-ChildItem -Path ($batchDir + '\..') + - powershell: Write-Host "##vso[task.prependpath]C:\Miniforge\Scripts" + displayName: Add conda to PATH - condition: contains(variables['CONFIG'], 'vs2008') - displayName: Patch vs2008 (if needed) - - task: CondaEnvironment@1 - inputs: - packageSpecs: 'python=3.9 conda-build conda pip boa conda-forge-ci-setup=3' # Optional - installOptions: "-c conda-forge" - updateConda: true - displayName: Install conda-build and activate environment + - script: | + call activate base + mamba.exe install 'python=3.9' conda-build conda pip boa 'conda-forge-ci-setup=3' -c conda-forge --strict-channel-priority --yes + displayName: Install conda-build - script: set PYTHONUNBUFFERED=1 displayName: Set PYTHONUNBUFFERED @@ -86,25 +68,16 @@ jobs: call activate base run_conda_forge_build_setup displayName: conda-forge build setup - - - # Special cased version setting some more things! - - script: | - call activate base - conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml - displayName: Build recipe (vs2008) - env: - VS90COMNTOOLS: "C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\bin" - PYTHONUNBUFFERED: 1 - condition: contains(variables['CONFIG'], 'vs2008') - 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 env: PYTHONUNBUFFERED: 1 - condition: not(contains(variables['CONFIG'], 'vs2008')) - script: | set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" call activate base diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ad461b..3e61aa2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,8 @@ 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/.scripts/build_steps.sh b/.scripts/build_steps.sh index c6b23e8..a6b09f6 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -24,7 +24,10 @@ 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}" diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 3d85505..736a39a 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -61,6 +61,10 @@ if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then fi +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}" diff --git a/LICENSE.txt b/LICENSE.txt index 6ec1401..2ec51d7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,13 +1,27 @@ -BSD 3-clause license +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/build-locally.py b/build-locally.py index eec38a0..3f4b7a7 100755 --- a/build-locally.py +++ b/build-locally.py @@ -86,12 +86,19 @@ def main(args=None): verify_config(ns) setup_environment(ns) - 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) + 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__": diff --git a/recipe/0001-Add-add_dll_directory-for-LIBRARY_BIN-for-Py38-on-Windows.patch b/recipe/0001-Add-add_dll_directory-for-LIBRARY_BIN-for-Py38-on-Windows.patch deleted file mode 100644 index a9dcb84..0000000 --- a/recipe/0001-Add-add_dll_directory-for-LIBRARY_BIN-for-Py38-on-Windows.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/llvmlite/binding/ffi.py b/llvmlite/binding/ffi.py -index 3f53b2a..cb34899 100644 ---- a/llvmlite/binding/ffi.py -+++ b/llvmlite/binding/ffi.py -@@ -119,6 +119,9 @@ if os.name == 'nt': - # Append DLL directory to PATH, to allow loading of bundled CRT libraries - # (Windows uses PATH for DLL loading, see http://msdn.microsoft.com/en-us/library/7d83bc18.aspx). # noqa E501 - os.environ['PATH'] += ';' + _lib_dir -+ import sys -+ if sys.version_info >= (3, 8): -+ os.add_dll_directory(os.path.join(os.path.normpath(sys.prefix), 'Library', 'bin')) - - - _lib_name = get_library_name() diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 755d28e..ccbc446 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,6 +1,6 @@ {% set name = "llvmlite" %} -{% set version = "0.38.1" %} -{% set sha256 = "0622a86301fcf81cc50d7ed5b4bebe992c030580d413a8443b328ed4f4d82561" %} +{% set version = "0.39.0" %} +{% set sha256 = "01098be54f1aa25e391cebba8ea71cd1533f8cd1f50e34c7dd7540c2560a93af" %} package: name: {{ name|lower }} @@ -11,7 +11,8 @@ source: url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz sha256: {{ sha256 }} patches: - - 0001-Add-add_dll_directory-for-LIBRARY_BIN-for-Py38-on-Windows.patch # [win and py>=38] + # https://github.com/conda-forge/llvmlite-feedstock/pull/62#issuecomment-1209762518 + - patches/0001-Disable-test_libm-on-macOS.patch build: number: 0 diff --git a/recipe/patch_cmake.patch b/recipe/patch_cmake.patch deleted file mode 100644 index 10d9404..0000000 --- a/recipe/patch_cmake.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/ffi/CMakeLists.txt b/ffi/CMakeLists.txt -index 87cf00c..bb8ce6a 100755 ---- a/ffi/CMakeLists.txt -+++ b/ffi/CMakeLists.txt -@@ -7,6 +7,7 @@ project(llvmlite_ffi) - include(CheckIncludeFiles) - - find_package(LLVM REQUIRED CONFIG) -+find_package("ZLIB" REQUIRED) - - message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") - message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") -@@ -16,10 +17,12 @@ message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") - # you will need to enable C++11 support - # for your compiler. - -+include_directories(${ZLIB_INCLUDE_DIRS}) - include_directories(${LLVM_INCLUDE_DIRS}) - add_definitions(${LLVM_DEFINITIONS}) - - # Look for SVML -+list(APPEND LLVM_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) - set(CMAKE_REQUIRED_INCLUDES ${LLVM_INCLUDE_DIRS}) - - CHECK_INCLUDE_FILES("llvm/IR/SVML.inc" HAVE_SVML) -@@ -45,6 +48,7 @@ llvm_map_components_to_libnames(llvm_libs all) - # under the llvm_libs for the "all" components map. This breaks static linking - # so the "OptRemarks" library is removed from this list. - list(REMOVE_ITEM llvm_libs "OptRemarks") -+list(APPEND llvm_libs ${ZLIB_LIBRARIES}) - - # Link against LLVM libraries - target_link_libraries(llvmlite ${llvm_libs}) diff --git a/recipe/patches/0001-Disable-test_libm-on-macOS.patch b/recipe/patches/0001-Disable-test_libm-on-macOS.patch new file mode 100644 index 0000000..0730410 --- /dev/null +++ b/recipe/patches/0001-Disable-test_libm-on-macOS.patch @@ -0,0 +1,34 @@ +From e3648a827115539c368ee13d8b791f45d1afea69 Mon Sep 17 00:00:00 2001 +From: John Kirkham +Date: Fri, 12 Aug 2022 09:31:14 -0700 +Subject: [PATCH] Disable `test_libm` on macOS + +--- + llvmlite/tests/test_binding.py | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/llvmlite/tests/test_binding.py b/llvmlite/tests/test_binding.py +index 28b2f5f..b3018c8 100644 +--- a/llvmlite/tests/test_binding.py ++++ b/llvmlite/tests/test_binding.py +@@ -1633,14 +1633,11 @@ class TestDylib(BaseTest): + with self.assertRaises(RuntimeError): + llvm.load_library_permanently("zzzasdkf;jasd;l") + +- @unittest.skipUnless(platform.system() in ["Linux", "Darwin"], +- "test only works on Linux and Darwin") ++ @unittest.skipUnless(platform.system() in ["Linux"], ++ "test only works on Linux") + def test_libm(self): + system = platform.system() +- if system == "Linux": +- libm = find_library("m") +- elif system == "Darwin": +- libm = find_library("libm") ++ libm = find_library("m") + llvm.load_library_permanently(libm) + + +-- +2.37.1 + diff --git a/recipe/run_test.py b/recipe/run_test.py index 448c60a..e489ce5 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -2,6 +2,6 @@ from llvmlite.tests import main # Disable tests for distribution only -# These check for static linkage, which don't do. +# These check for static linkage, which we don't do. os.environ['LLVMLITE_DIST_TEST'] = '' main()