From 81e3b989c2272a1494c18e6104f644e8ecfa55b4 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 28 Aug 2024 18:12:35 +1100 Subject: [PATCH 1/2] switch to new name for libgcc --- recipe/meta.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 39755e8..60f6749 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -31,7 +31,7 @@ source: - nvcc.profile.patch.win # [win] build: - number: 0 + number: 1 skip: true # [osx or ppc64le] outputs: @@ -96,12 +96,12 @@ outputs: - {{ pin_subpackage("cuda-nvcc-tools", exact=True) }} - {{ pin_subpackage("cuda-crt-dev_" + target_platform, exact=True) }} - {{ pin_subpackage("cuda-nvvm-dev_" + target_platform, exact=True) }} - - libgcc-ng {{ gcc_min_constraint }} # [linux] + - libgcc {{ gcc_min_constraint }} # [linux] run: - {{ pin_compatible("cuda-version", max_pin="x.x") }} - {{ pin_subpackage("cuda-crt-dev_" + target_platform, exact=True) }} - {{ pin_subpackage("cuda-nvvm-dev_" + target_platform, exact=True) }} - - libgcc-ng {{ gcc_min_constraint }} # [linux] + - libgcc {{ gcc_min_constraint }} # [linux] run_constrained: - gcc_impl_{{ target_platform }} {{ gcc_constraint }} # [linux] - arm-variant * {{ arm_variant_type }} # [aarch64] From 7df954b9e19d3cc60ba80ac0c9b33b88f2f581eb Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 24 Oct 2024 18:33:25 +1100 Subject: [PATCH 2/2] MNT: Re-rendered with conda-build 24.9.0, conda-smithy 3.43.0, and conda-forge-pinning 2024.10.24.06.12.44 --- .azure-pipelines/azure-pipelines-win.yml | 19 ++--------- .scripts/build_steps.sh | 14 ++++---- .scripts/run_win_build.bat | 42 ++++++++++++++++++------ azure-pipelines.yml | 31 +++++++++++++++-- 4 files changed, 69 insertions(+), 37 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 204327b..9901917 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -14,31 +14,16 @@ jobs: timeoutInMinutes: 360 variables: CONDA_BLD_PATH: D:\\bld\\ + MINIFORGE_HOME: D:\Miniforge 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/Miniforge3-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 ".scripts\run_win_build.bat" displayName: Run Windows build env: + MINIFORGE_HOME: $(MINIFORGE_HOME) PYTHONUNBUFFERED: 1 CONFIG: $(CONFIG) CI: azure diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index af0b9ac..f8051ab 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -31,13 +31,13 @@ pkgs_dirs: solver: libmamba CONDARC +mv /opt/conda/conda-meta/history /opt/conda/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S) +echo > /opt/conda/conda-meta/history +micromamba install --root-prefix ~/.conda --prefix /opt/conda \ + --yes --override-channels --channel conda-forge --strict-channel-priority \ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 -mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" - # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -73,8 +73,8 @@ else --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" ( startgroup "Inspecting artifacts" ) 2> /dev/null - # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 - command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir "${RECIPE_ROOT}" -m "${CONFIG_FILE}" || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" ( endgroup "Inspecting artifacts" ) 2> /dev/null ( startgroup "Validating outputs" ) 2> /dev/null diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat index 33f3277..752eec6 100755 --- a/.scripts/run_win_build.bat +++ b/.scripts/run_win_build.bat @@ -3,30 +3,52 @@ :: changes to this script, consider a proposal to conda-smithy so that other feedstocks can also :: benefit from the improvement. -:: Note: we assume a Miniforge installation is available - :: 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 +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 Moving pkgs cache from %MAMBA_ROOT_PREFIX% to %MINIFORGE_HOME% +move /Y "%MAMBA_ROOT_PREFIX%\pkgs" "%MINIFORGE_HOME%" +if !errorlevel! neq 0 exit /b !errorlevel! +echo Removing %MAMBA_ROOT_PREFIX% +del /S /Q "%MAMBA_ROOT_PREFIX%" +del /S /Q "%MICROMAMBA_TMPDIR%" +call :end_group + call :start_group "Configuring conda" :: Activate the base conda environment -call activate base +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" -:: Provision the necessary dependencies to build the recipe later -echo Installing dependencies -mamba.exe install pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -c conda-forge --strict-channel-priority --yes -if !errorlevel! neq 0 exit /b !errorlevel! - :: Set basic configuration echo Setting up configuration setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml @@ -54,8 +76,8 @@ conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTR if !errorlevel! neq 0 exit /b !errorlevel! call :start_group "Inspecting artifacts" -:: inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 -WHERE inspect_artifacts >nul 2>nul && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" +:: 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 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index baa1c2b..8b954b8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,6 +2,31 @@ # update the conda-forge.yml and/or the recipe/meta.yaml. # -*- mode: yaml -*- -jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file +stages: +- stage: Check + jobs: + - job: Skip + pool: + vmImage: 'ubuntu-22.04' + variables: + DECODE_PERCENTS: 'false' + RET: 'true' + steps: + - checkout: self + fetchDepth: '2' + - bash: | + git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "` + echo "##vso[task.setvariable variable=log]$git_log" + displayName: Obtain commit message + - bash: echo "##vso[task.setvariable variable=RET]false" + condition: or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]')) + displayName: Skip build? + - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" + name: result + displayName: Export result +- stage: Build + condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) + dependsOn: Check + jobs: + - template: ./.azure-pipelines/azure-pipelines-linux.yml + - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file