diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml new file mode 100755 index 0000000..13022dd --- /dev/null +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -0,0 +1,38 @@ +# 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 -*- + +jobs: +- job: win + pool: + vmImage: windows-2022 + strategy: + matrix: + win_64_: + CONFIG: win_64_ + UPLOAD_PACKAGES: 'True' + timeoutInMinutes: 360 + variables: + CONDA_BLD_PATH: D:\\bld\\ + MINIFORGE_HOME: D:\Miniforge + UPLOAD_TEMP: D:\\tmp + + steps: + + - script: | + call ".scripts\run_win_build.bat" + displayName: Run Windows build + env: + MINIFORGE_HOME: $(MINIFORGE_HOME) + CONDA_BLD_PATH: $(CONDA_BLD_PATH) + PYTHONUNBUFFERED: 1 + CONFIG: $(CONFIG) + CI: azure + flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt) + remote_url: $(Build.Repository.Uri) + sha: $(Build.SourceVersion) + UPLOAD_PACKAGES: $(UPLOAD_PACKAGES) + UPLOAD_TEMP: $(UPLOAD_TEMP) + BINSTAR_TOKEN: $(BINSTAR_TOKEN) + FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml new file mode 100644 index 0000000..7374cc9 --- /dev/null +++ b/.ci_support/win_64_.yaml @@ -0,0 +1,14 @@ +ace: +- 8.0.2 +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +cxx_compiler: +- vs2019 +target_platform: +- win-64 diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat new file mode 100755 index 0000000..2e7dd39 --- /dev/null +++ b/.scripts/run_win_build.bat @@ -0,0 +1,146 @@ +:: 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. + +:: INPUTS (required environment variables) +:: CONFIG: name of the .ci_support/*.yaml file for this job +:: CI: azure, github_actions, or unset +:: MINIFORGE_HOME: where to install the base conda environment +:: UPLOAD_PACKAGES: true or false +:: UPLOAD_ON_BRANCH: true or false + +setlocal enableextensions enabledelayedexpansion + +FOR %%A IN ("%~dp0.") DO SET "REPO_ROOT=%%~dpA" +if "%MINIFORGE_HOME%"=="" set "MINIFORGE_HOME=%USERPROFILE%\Miniforge3" +:: Remove trailing backslash, if present +if "%MINIFORGE_HOME:~-1%"=="\" set "MINIFORGE_HOME=%MINIFORGE_HOME:~0,-1%" +call :start_group "Provisioning base env with micromamba" +set "MAMBA_ROOT_PREFIX=%MINIFORGE_HOME%-micromamba-%RANDOM%" +set "MICROMAMBA_VERSION=1.5.10-0" +set "MICROMAMBA_URL=https://github.com/mamba-org/micromamba-releases/releases/download/%MICROMAMBA_VERSION%/micromamba-win-64" +set "MICROMAMBA_TMPDIR=%TMP%\micromamba-%RANDOM%" +set "MICROMAMBA_EXE=%MICROMAMBA_TMPDIR%\micromamba.exe" + +echo Downloading micromamba %MICROMAMBA_VERSION% +if not exist "%MICROMAMBA_TMPDIR%" mkdir "%MICROMAMBA_TMPDIR%" +certutil -urlcache -split -f "%MICROMAMBA_URL%" "%MICROMAMBA_EXE%" +if !errorlevel! neq 0 exit /b !errorlevel! + +echo Creating environment +call "%MICROMAMBA_EXE%" create --yes --root-prefix "%MAMBA_ROOT_PREFIX%" --prefix "%MINIFORGE_HOME%" ^ + --channel conda-forge ^ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" +if !errorlevel! neq 0 exit /b !errorlevel! +echo Removing %MAMBA_ROOT_PREFIX% +del /S /Q "%MAMBA_ROOT_PREFIX%" >nul +del /S /Q "%MICROMAMBA_TMPDIR%" >nul +call :end_group + +call :start_group "Configuring conda" + +:: Activate the base conda environment +echo Activating environment +call "%MINIFORGE_HOME%\Scripts\activate.bat" +:: Configure the solver +set "CONDA_SOLVER=libmamba" +if !errorlevel! neq 0 exit /b !errorlevel! +set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" + +:: Set basic configuration +echo Setting up configuration +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.9.4 +WHERE inspect_artifacts >nul 2>nul && inspect_artifacts --recipe-dir ".\recipe" -m .ci_support\%CONFIG%.yaml || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" +call :end_group + +:: Prepare some environment variables for the upload step +if /i "%CI%" == "github_actions" ( + set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" + 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/README.md b/README.md index a9a401b..2feb02b 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,13 @@ Current build status variant + + win_64 + + + variant + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 013bdc1..eff4ad6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,4 +29,5 @@ stages: dependsOn: Check jobs: - template: ./.azure-pipelines/azure-pipelines-linux.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/recipe/bld.bat b/recipe/bld.bat new file mode 100644 index 0000000..2093540 --- /dev/null +++ b/recipe/bld.bat @@ -0,0 +1,2 @@ +cmake %CMAKE_ARGS% -S . -B build -DBUILD_SHARED_LIBS=On -DCMAKE_PREFIX_PATH=%PREFIX% +cmake --build build --config Release --target install diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 48c1475..f554210 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,8 +10,7 @@ source: sha256: 0068942b3aa3b0733d29f7ea1daa615bc5a943a411c148e5089609a0e3fe7e98 build: - number: 0 - skip: true # [win] + number: 1 run_exports: - {{ pin_subpackage('cpptrace', max_pin='x.x.x') }} @@ -22,30 +21,42 @@ requirements: - {{ stdlib("c") }} - {{ compiler("cxx") }} - cmake - - ninja - - pkg-config + - ninja # [unix] + - pkg-config # [unix] host: - - libdwarf - - libdwarf-dev - - zlib + - libdwarf # [unix] + - libdwarf-dev # [unix] + - zlib # [unix] test: requires: - cmake - {{ compiler("cxx") }} - - ninja + - ninja # [unix] files: - test commands: - - test -f $PREFIX/lib/libcpptrace${SHLIB_EXT} - - test -f $PREFIX/include/cpptrace/cpptrace.hpp - - test -f $PREFIX/include/cpptrace/basic.hpp - - test -f $PREFIX/include/cpptrace/version.hpp - - test -f $PREFIX/lib/cmake/cpptrace/cpptrace-targets.cmake - - cd test - - cmake . -GNinja -DCMAKE_BUILD_TYPE=Debug - - cmake --build . --config Debug - - ./program + - test -f $PREFIX/lib/libcpptrace${SHLIB_EXT} # [unix] + - test -f $PREFIX/include/cpptrace/cpptrace.hpp # [unix] + - test -f $PREFIX/include/cpptrace/basic.hpp # [unix] + - test -f $PREFIX/include/cpptrace/version.hpp # [unix] + - test -f $PREFIX/lib/cmake/cpptrace/cpptrace-targets.cmake # [unix] + - cd test # [unix] + - cmake . -GNinja -DCMAKE_BUILD_TYPE=Debug # [unix] + - cmake --build . --config Debug # [unix] + - ./program # [unix] + + + - "if not exist %LIBRARY_PREFIX%\\lib\\cpptrace.lib (echo Not found: %LIBRARY_PREFIX%\\lib\\cpptrace.lib & exit 1)" # [win] + - "if not exist %LIBRARY_PREFIX%\\bin\\cpptrace.dll (echo Not found: %LIBRARY_PREFIX%\\bin\\cpptrace.dll & exit 1)" # [win] + - "if not exist %LIBRARY_PREFIX%\\include\\cpptrace\\cpptrace.hpp (echo Not found: %LIBRARY_PREFIX%\\include\\cpptrace\\cpptrace.hpp & exit 1)" # [win] + - "if not exist %LIBRARY_PREFIX%\\include\\cpptrace\\basic.hpp (echo Not found: %LIBRARY_PREFIX%\\include\\cpptrace\\basic.hpp & exit 1)" # [win] + - "if not exist %LIBRARY_PREFIX%\\include\\cpptrace\\version.hpp (echo Not found: %LIBRARY_PREFIX%\\include\\cpptrace\\version.hpp & exit 1)" # [win] + - "if not exist %LIBRARY_PREFIX%\\lib\\cmake\\cpptrace\\cpptrace-targets.cmake (echo Not found: %LIBRARY_PREFIX%\\lib\\cmake\\cpptrace\\cpptrace-targets.cmake & exit 1)" # [win] + - cd test # [win] + - cmake . # [win] + - cmake --build . --config Debug # [win] + - .\\Debug\\program.exe # [win] about: home: https://github.com/jeremy-rifkin/cpptrace