diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml new file mode 100755 index 00000000..17e762fc --- /dev/null +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -0,0 +1,117 @@ +# 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' + SHORT_CONFIG: win_64_ + timeoutInMinutes: 360 + variables: + CONDA_BLD_PATH: D:\\bld\\ + 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' + path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe" + urllib.request.urlretrieve(url, path) + + - script: | + start /wait "" %BUILD_ARTIFACTSTAGINGDIRECTORY%\Miniforge.exe /InstallationType=JustMe /RegisterPython=0 /S /D=C:\Miniforge + displayName: Install Miniforge + + - powershell: Write-Host "##vso[task.prependpath]C:\Miniforge\Scripts" + displayName: Add conda to PATH + + - script: | + call activate base + mamba.exe install "python=3.10" 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 + + # 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" + ) + if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" + ) + conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% + displayName: Build recipe + env: + PYTHONUNBUFFERED: 1 + - script: | + set CI=azure + set CI_RUN_ID=$(build.BuildNumber).$(system.JobAttempt) + set FEEDSTOCK_NAME=$(build.Repository.Name) + set ARTIFACT_STAGING_DIR=$(Build.ArtifactStagingDirectory) + set CONDA_BLD_DIR=$(CONDA_BLD_PATH) + set BLD_ARTIFACT_PREFIX=conda_artifacts + if "%AGENT_JOBSTATUS%" == "Failed" ( + set ENV_ARTIFACT_PREFIX=conda_envs + ) + call ".scripts\create_conda_build_artifacts.bat" + displayName: Prepare conda build artifacts + condition: succeededOrFailed() + + - task: PublishPipelineArtifact@1 + displayName: Store conda build artifacts + condition: not(eq(variables.BLD_ARTIFACT_PATH, '')) + inputs: + targetPath: $(BLD_ARTIFACT_PATH) + artifactName: $(BLD_ARTIFACT_NAME) + + - task: PublishPipelineArtifact@1 + displayName: Store conda build environment artifacts + condition: not(eq(variables.ENV_ARTIFACT_PATH, '')) + inputs: + targetPath: $(ENV_ARTIFACT_PATH) + artifactName: $(ENV_ARTIFACT_NAME) + - 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: + 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 diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml new file mode 100644 index 00000000..5d9ec268 --- /dev/null +++ b/.ci_support/win_64_.yaml @@ -0,0 +1,34 @@ +arpack: +- '3.7' +c_compiler: +- vs2019 +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +curl: +- '8' +cxx_compiler: +- vs2019 +fortran_compiler: +- flang +fortran_compiler_version: +- '5' +libgit2: +- '1.6' +libssh2: +- '1' +mpfr: +- '4' +openblas: +- 0.3.* +pcre2: +- '10.40' +perl: +- 5.32.1 +suitesparse: +- '5' +target_platform: +- win-64 +zlib: +- '1.2' diff --git a/.scripts/create_conda_build_artifacts.bat b/.scripts/create_conda_build_artifacts.bat new file mode 100755 index 00000000..2853cfdc --- /dev/null +++ b/.scripts/create_conda_build_artifacts.bat @@ -0,0 +1,80 @@ +setlocal enableextensions enabledelayedexpansion + +rem INPUTS (environment variables that need to be set before calling this script): +rem +rem CI (azure/github_actions/UNSET) +rem CI_RUN_ID (unique identifier for the CI job run) +rem FEEDSTOCK_NAME +rem CONFIG (build matrix configuration string) +rem SHORT_CONFIG (uniquely-shortened configuration string) +rem CONDA_BLD_DIR (path to the conda-bld directory) +rem ARTIFACT_STAGING_DIR (use working directory if unset) +rem BLD_ARTIFACT_PREFIX (prefix for the conda build artifact name, skip if unset) +rem ENV_ARTIFACT_PREFIX (prefix for the conda build environments artifact name, skip if unset) + +rem OUTPUTS +rem +rem BLD_ARTIFACT_NAME +rem BLD_ARTIFACT_PATH +rem ENV_ARTIFACT_NAME +rem ENV_ARTIFACT_PATH + +rem Check that the conda-build directory exists +if not exist %CONDA_BLD_DIR% ( + echo conda-build directory does not exist + exit 1 +) + +if not defined ARTIFACT_STAGING_DIR ( + rem Set staging dir to the working dir + set ARTIFACT_STAGING_DIR=%cd% +) + +rem Set a unique ID for the artifact(s), specialized for this particular job run +set ARTIFACT_UNIQUE_ID=%CI_RUN_ID%_%CONFIG% +if not "%ARTIFACT_UNIQUE_ID%" == "%ARTIFACT_UNIQUE_ID:~0,80%" ( + set ARTIFACT_UNIQUE_ID=%CI_RUN_ID%_%SHORT_CONFIG% +) + +rem Set a descriptive ID for the archive(s), specialized for this particular job run +set ARCHIVE_UNIQUE_ID=%CI_RUN_ID%_%CONFIG% + +rem Make the build artifact zip +if defined BLD_ARTIFACT_PREFIX ( + set BLD_ARTIFACT_NAME=%BLD_ARTIFACT_PREFIX%_%ARTIFACT_UNIQUE_ID% + echo BLD_ARTIFACT_NAME: !BLD_ARTIFACT_NAME! + + set "BLD_ARTIFACT_PATH=%ARTIFACT_STAGING_DIR%\%FEEDSTOCK_NAME%_%BLD_ARTIFACT_PREFIX%_%ARCHIVE_UNIQUE_ID%.zip" + 7z a "!BLD_ARTIFACT_PATH!" "%CONDA_BLD_DIR%" -xr^^!.git/ -xr^^!_*_env*/ -xr^^!*_cache/ -bb + if errorlevel 1 exit 1 + echo BLD_ARTIFACT_PATH: !BLD_ARTIFACT_PATH! + + if "%CI%" == "azure" ( + echo ##vso[task.setVariable variable=BLD_ARTIFACT_NAME]!BLD_ARTIFACT_NAME! + echo ##vso[task.setVariable variable=BLD_ARTIFACT_PATH]!BLD_ARTIFACT_PATH! + ) + if "%CI%" == "github_actions" ( + echo BLD_ARTIFACT_NAME=!BLD_ARTIFACT_NAME!>> !GITHUB_OUTPUT! + echo BLD_ARTIFACT_PATH=!BLD_ARTIFACT_PATH!>> !GITHUB_OUTPUT! + ) +) + +rem Make the environments artifact zip +if defined ENV_ARTIFACT_PREFIX ( + set ENV_ARTIFACT_NAME=!ENV_ARTIFACT_PREFIX!_%ARTIFACT_UNIQUE_ID% + echo ENV_ARTIFACT_NAME: !ENV_ARTIFACT_NAME! + + set "ENV_ARTIFACT_PATH=%ARTIFACT_STAGING_DIR%\%FEEDSTOCK_NAME%_%ENV_ARTIFACT_PREFIX%_%ARCHIVE_UNIQUE_ID%.zip" + 7z a "!ENV_ARTIFACT_PATH!" -r "%CONDA_BLD_DIR%"/_*_env*/ -bb + if errorlevel 1 exit 1 + echo ENV_ARTIFACT_PATH: !ENV_ARTIFACT_PATH! + + if "%CI%" == "azure" ( + echo ##vso[task.setVariable variable=ENV_ARTIFACT_NAME]!ENV_ARTIFACT_NAME! + echo ##vso[task.setVariable variable=ENV_ARTIFACT_PATH]!ENV_ARTIFACT_PATH! + ) + if "%CI%" == "github_actions" ( + echo ENV_ARTIFACT_NAME=!ENV_ARTIFACT_NAME!>> !GITHUB_OUTPUT! + echo ENV_ARTIFACT_PATH=!ENV_ARTIFACT_PATH!>> !GITHUB_OUTPUT! + ) +) \ No newline at end of file diff --git a/README.md b/README.md index db2ba120..b71f4973 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,13 @@ Current build status variant + + win_64 + + + variant + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 33a441c1..6b346f50 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,4 +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 diff --git a/recipe/bld.bat b/recipe/bld.bat new file mode 100644 index 00000000..06edc4b4 --- /dev/null +++ b/recipe/bld.bat @@ -0,0 +1,16 @@ +copy "%RECIPE_DIR%\build.sh" . +copy "%RECIPE_DIR%\windows.sh" . +FOR /F "delims=" %%i IN ('cygpath.exe -u "%LIBRARY_PREFIX%"') DO set "LIBRARY_PREFIX=%%i" +SET PREFIXW=%PREFIX% +FOR /F "delims=" %%i IN ('cygpath.exe -u "%PREFIX%"') DO set "PREFIX=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%PYTHON%"') DO set "PYTHON=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%RECIPE_DIR%"') DO set "RECIPE_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%SP_DIR%"') DO set "SP_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%SRC_DIR%"') DO set "SRC_DIR=%%i" +FOR /F "delims=" %%i IN ('cygpath.exe -u "%STDLIB_DIR%"') DO set "STDLIB_DIR=%%i" +set MSYSTEM=MINGW%ARCH% +set MSYS2_PATH_TYPE=inherit +set CHERE_INVOKING=1 +CALL bash -lc ./windows.sh +if %errorlevel% neq 0 exit /b %errorlevel% +exit /b 0 diff --git a/recipe/build.sh b/recipe/build.sh index 434e3bd9..cb399c10 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -16,6 +16,8 @@ if [[ "${target_platform}" == osx-* ]]; then export EXTRA_MAKEFLAGS="USE_SYSTEM_LIBGIT2=0 USE_SYSTEM_MBEDTLS=0" elif [[ "${target_platform}" == linux-* ]]; then export EXTRA_MAKEFLAGS="USE_SYSTEM_LIBGIT2=1 USE_SYSTEM_MBEDTLS=1" +elif [[ "${target_platform}" == win-* ]]; then + export EXTRA_MAKEFLAGS="USE_SYSTEM_LIBGIT2=1 USE_SYSTEM_MBEDTLS=0 USE_SYSTEM_P7ZIP=0 USE_SYSTEM_NGHTTP2=0 USE_SYSTEM_GMP=0" fi # See the following link for how official Julia sets JULIA_CPU_TARGET # https://github.com/JuliaCI/julia-buildbot/blob/ba448c690935fe53d2b1fc5ce22bc60fd1e251a7/master/inventory.py diff --git a/recipe/meta.yaml b/recipe/meta.yaml index aea158f1..7d444b24 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -19,8 +19,8 @@ source: - patches/julia-libunwind-1.6.patch # [linux] - patches/0003-Defer-codesigning-to-conda-forge.patch # [osx] +## just do win until we get the recipe to work build: - skip: true # [win] number: 0 binary_relocation: false features: @@ -34,45 +34,52 @@ requirements: - {{ compiler('c') }} - {{ compiler('cxx') }} host: - - openblas-ilp64 + - m2-bash # [win] + - m2-base # [win] + - openblas-ilp64 # [not win] + - openblas # [win] - patchelf # [linux] - openlibm - - gmp + - gmp # [not win] + - openlibm <0.8.0 + - mpfr - curl - libgit2 # [not osx] - libssh2 - libosxunwind # [osx] - libunwind # [linux] - - mbedtls # [not osx] + - mbedtls # [not (osx or win)] - mpfr - arpack - suitesparse - pcre2 - git - libutf8proc - - libnghttp2 + - libnghttp2 # [not win] - zlib - - p7zip + - p7zip # [not win] run: - - openblas-ilp64 + - openblas-ilp64 # [not win] + - openblas # [win] - libosxunwind # [osx] - libunwind # [linux] - - gmp - - openlibm + - gmp # [not win] + - mpfr + - openlibm <0.8.0 - arpack - suitesparse - pcre2 - curl - libgit2 # [not osx] - libssh2 - - mbedtls # [not osx] + - mbedtls # [not (osx or win)] - mpfr - git - libutf8proc - - libnghttp2 + - libnghttp2 # [not win] - zlib - - p7zip + - p7zip # [not win] test: commands: diff --git a/recipe/windows.sh b/recipe/windows.sh new file mode 100644 index 00000000..bcc6a676 --- /dev/null +++ b/recipe/windows.sh @@ -0,0 +1,3 @@ +#!/bin/sh +cd `cygpath -u $PWD` +source ./build.sh