diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index b1513b8..807de1f 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -49,4 +49,4 @@ jobs: env: BINSTAR_TOKEN: $(BINSTAR_TOKEN) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml index ac0bf38..d08eed2 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-13 + vmImage: macOS-15 strategy: matrix: osx_64_: @@ -37,4 +37,4 @@ jobs: env: BINSTAR_TOKEN: $(BINSTAR_TOKEN) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 13022dd..ada9763 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -35,4 +35,4 @@ jobs: UPLOAD_TEMP: $(UPLOAD_TEMP) BINSTAR_TOKEN: $(BINSTAR_TOKEN) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index a480b28..6c2620a 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,13 +1,11 @@ c_compiler: - gcc c_compiler_version: -- '13' +- '14' c_stdlib: - sysroot c_stdlib_version: - '2.17' -cdt_name: -- conda channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index 28c0585..353d1ec 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -1,13 +1,11 @@ c_compiler: - gcc c_compiler_version: -- '13' +- '14' c_stdlib: - sysroot c_stdlib_version: - '2.17' -cdt_name: -- conda channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml index dd23725..e2157fa 100644 --- a/.ci_support/linux_ppc64le_.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -1,13 +1,11 @@ c_compiler: - gcc c_compiler_version: -- '13' +- '14' c_stdlib: - sysroot c_stdlib_version: - '2.17' -cdt_name: -- conda channel_sources: - conda-forge channel_targets: diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml index 3a64447..0de5172 100644 --- a/.ci_support/osx_64_.yaml +++ b/.ci_support/osx_64_.yaml @@ -5,7 +5,7 @@ MACOSX_SDK_VERSION: c_compiler: - clang c_compiler_version: -- '18' +- '19' c_stdlib: - macosx_deployment_target c_stdlib_version: diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_.yaml index cb48f33..67ea69e 100644 --- a/.ci_support/osx_arm64_.yaml +++ b/.ci_support/osx_arm64_.yaml @@ -5,7 +5,7 @@ MACOSX_SDK_VERSION: c_compiler: - clang c_compiler_version: -- '18' +- '19' c_stdlib: - macosx_deployment_target c_stdlib_version: diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index 390ec88..7ec2f4b 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -1,5 +1,5 @@ c_compiler: -- vs2019 +- vs2022 c_stdlib: - vs channel_sources: diff --git a/.gitattributes b/.gitattributes index 18f114a..85ccb8f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -24,4 +24,5 @@ bld.bat text eol=crlf /README.md linguist-generated=true azure-pipelines.yml linguist-generated=true build-locally.py linguist-generated=true +pixi.toml linguist-generated=true shippable.yml linguist-generated=true diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index f2f6924..609de60 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -96,4 +96,4 @@ fi ( startgroup "Final checks" ) 2> /dev/null -touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file +touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 00f377a..b63b5a0 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" @@ -111,4 +111,4 @@ docker run ${DOCKER_RUN_ARGS} \ 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 +( endgroup "Final checks" ) 2> /dev/null diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh index 0e3c394..361edeb 100755 --- a/.scripts/run_osx_build.sh +++ b/.scripts/run_osx_build.sh @@ -117,4 +117,4 @@ else fi ( endgroup "Uploading packages" ) 2> /dev/null -fi \ No newline at end of file +fi diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index f0ead3d..3c7b325 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -25,7 +25,7 @@ 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%" +powershell -ExecutionPolicy Bypass -Command "(New-Object Net.WebClient).DownloadFile('%MICROMAMBA_URL%', '%MICROMAMBA_EXE%')" if !errorlevel! neq 0 exit /b !errorlevel! echo Creating environment @@ -146,4 +146,4 @@ if /i "%CI%" == "azure" ( echo ##[endgroup] exit /b ) -exit /b \ No newline at end of file +exit /b diff --git a/README.md b/README.md index 63b9280..ec423b4 100644 --- a/README.md +++ b/README.md @@ -152,12 +152,12 @@ it is possible to build and upload installable packages to the [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 +To manage the continuous integration and simplify feedstock maintenance, [conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed. Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``. -For more information please check the [conda-forge documentation](https://conda-forge.org/docs/). +For more information, please check the [conda-forge documentation](https://conda-forge.org/docs/). Terminology =========== @@ -184,7 +184,7 @@ merged, the recipe will be re-built and uploaded automatically to the everybody to install and use from the `conda-forge` channel. Note that all branches in the conda-forge/jansson-feedstock are immediately built and any created packages are uploaded, so PRs should be based -on branches in forks and branches in the main repository should only be used to +on branches in forks, and branches in the main repository should only be used to build distinct package versions. In order to produce a uniquely identifiable distribution: diff --git a/build-locally.py b/build-locally.py index c4a56c6..9dfe440 100755 --- a/build-locally.py +++ b/build-locally.py @@ -10,6 +10,7 @@ import os import platform import subprocess +import sys from argparse import ArgumentParser @@ -44,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") @@ -60,38 +70,43 @@ 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=$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." - ) 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", help="Setup debug environment using `conda debug`", ) - p.add_argument( - "--output-id", help="If running debug, specify the output to setup." - ) + p.add_argument("--output-id", help="If running debug, specify the output to setup.") ns = p.parse_args(args=args) verify_config(ns) @@ -104,10 +119,10 @@ 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" - ) + recipe_license_file = os.path.join("recipe", "recipe-scripts-license.txt") if os.path.exists(recipe_license_file): os.remove(recipe_license_file) diff --git a/recipe/bld.bat b/recipe/bld.bat index 4e4a4ab..676ed73 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -1,9 +1,12 @@ mkdir "%SRC_DIR%"\build pushd "%SRC_DIR%"\build +REM This also sets the minimum CMake policy version to 3.5 for compatibility. Can be removed with >2.14.1 + cmake -G "Ninja" ^ -DBUILD_SHARED_LIBS=ON ^ -DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ^ .. if errorlevel 1 exit 1 diff --git a/recipe/janssonConfig.cmake b/recipe/janssonConfig.cmake new file mode 100644 index 0000000..cef5f41 --- /dev/null +++ b/recipe/janssonConfig.cmake @@ -0,0 +1,22 @@ +# janssonConfig.cmake +include_guard(GLOBAL) + +if(NOT TARGET jansson::jansson) + find_package(PkgConfig REQUIRED QUIET) + pkg_check_modules(JANSSON REQUIRED jansson) + + add_library(jansson::jansson INTERFACE IMPORTED) + set_target_properties(jansson::jansson PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${JANSSON_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${JANSSON_LIBRARIES}" + ) + + message(STATUS "janssonConfig.cmake shim by conda-forge: created imported target jansson::jansson " + "from pkg-config (${JANSSON_VERSION})") +else() + message(STATUS "janssonConfig.cmake shim: using existing jansson::jansson target") +endif() + +set(JANSSON_LIBRARIES "${JANSSON_LIBRARIES}") +set(JANSSON_INCLUDE_DIRS "${JANSSON_INCLUDE_DIRS}") +set(JANSSON_VERSION "${JANSSON_VERSION}") \ No newline at end of file diff --git a/recipe/meta.yaml b/recipe/meta.yaml index cc1867a..cd6b12c 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -9,7 +9,7 @@ source: sha256: 979210eaffdffbcf54cfc34d047fccde13f21b529a381df26db871d886f729a4 build: - number: 0 + number: 1 run_exports: - {{ pin_subpackage('jansson', max_pin='x') }}