3
3
:: changes to this script, consider a proposal to conda-smithy so that other feedstocks can also
4
4
:: benefit from the improvement.
5
5
6
- :: Note: we assume a Miniforge installation is available
7
-
8
6
:: INPUTS (required environment variables)
9
7
:: CONDA_BLD_PATH: path for the conda-build workspace
10
8
:: CI: azure, or unset
9
+ :: MINIFORGE_HOME: where to install the base conda environment
11
10
12
11
setlocal enableextensions enabledelayedexpansion
13
12
13
+ if " %MINIFORGE_HOME% " == " " set " MINIFORGE_HOME = %USERPROFILE% \Miniforge3"
14
+ :: Remove trailing backslash, if present
15
+ if " %MINIFORGE_HOME:~-1 % " == " \" set " MINIFORGE_HOME = %MINIFORGE_HOME:~0 ,-1 % "
16
+ call :start_group " Provisioning base env with micromamba"
17
+ set " MAMBA_ROOT_PREFIX = %MINIFORGE_HOME% -micromamba-%RANDOM% "
18
+ set " MICROMAMBA_VERSION = 1.5.10-0"
19
+ set " MICROMAMBA_URL = https://github.com/mamba-org/micromamba-releases/releases/download/%MICROMAMBA_VERSION% /micromamba-win-64"
20
+ set " MICROMAMBA_TMPDIR = %TMP% \micromamba-%RANDOM% "
21
+ set " MICROMAMBA_EXE = %MICROMAMBA_TMPDIR% \micromamba.exe"
22
+
23
+ echo Downloading micromamba %MICROMAMBA_VERSION%
24
+ if not exist " %MICROMAMBA_TMPDIR% " mkdir " %MICROMAMBA_TMPDIR% "
25
+ certutil -urlcache -split -f " %MICROMAMBA_URL% " " %MICROMAMBA_EXE% "
26
+ if !errorlevel! neq 0 exit /b !errorlevel!
27
+
28
+ echo Creating environment
29
+ call " %MICROMAMBA_EXE% " create --yes --root-prefix " %MAMBA_ROOT_PREFIX% " --prefix " %MINIFORGE_HOME% " ^
30
+ --channel conda-forge ^
31
+ --file .ci_support\requirements.txt
32
+ if !errorlevel! neq 0 exit /b !errorlevel!
33
+ echo Moving pkgs cache from %MAMBA_ROOT_PREFIX% to %MINIFORGE_HOME%
34
+ move /Y " %MAMBA_ROOT_PREFIX% \pkgs" " %MINIFORGE_HOME% "
35
+ if !errorlevel! neq 0 exit /b !errorlevel!
36
+ echo Removing %MAMBA_ROOT_PREFIX%
37
+ del /S /Q " %MAMBA_ROOT_PREFIX% "
38
+ del /S /Q " %MICROMAMBA_TMPDIR% "
39
+ call :end_group
40
+
14
41
call :start_group " Configuring conda"
15
42
16
43
if " %CONDA_BLD_PATH% " == " " (
17
44
set " CONDA_BLD_PATH = C:\bld"
18
45
)
19
46
20
47
:: Activate the base conda environment
21
- call activate base
48
+ echo Activating " %MINIFORGE_HOME% "
49
+ call " %MINIFORGE_HOME% \Scripts\activate"
22
50
51
+ :: Set basic configuration
52
+ echo Setting up configuration
23
53
conda.exe config --set always_yes yes
24
- if errorlevel 1 exit 1
54
+ if ! errorlevel! neq 0 exit /b !errorlevel!
25
55
conda.exe config --set channel_priority strict
26
- if errorlevel 1 exit 1
56
+ if ! errorlevel! neq 0 exit /b !errorlevel!
27
57
conda.exe config --set solver libmamba
28
- if errorlevel 1 exit 1
29
-
30
- echo Installing dependencies
31
- conda.exe install --file .\.ci_support\requirements.txt
32
- if errorlevel 1 exit 1
58
+ if !errorlevel! neq 0 exit /b !errorlevel!
33
59
34
- :: Set basic configuration
35
- echo Setting up configuration
36
60
setup_conda_rc .\ " .\recipes" .\.ci_support\%CONFIG% .yaml
37
- if errorlevel 1 exit 1
61
+ if ! errorlevel! neq 0 exit /b !errorlevel!
38
62
39
63
echo Run conda_forge_build_setup
40
64
call run_conda_forge_build_setup
41
- if errorlevel 1 exit 1
65
+ if ! errorlevel! neq 0 exit /b !errorlevel!
42
66
43
67
echo Force fetch origin/main
44
68
git fetch --force origin main:main
45
- if errorlevel 1 exit 1
69
+ if ! errorlevel! neq 0 exit /b !errorlevel!
46
70
echo Removing recipes also present in main
47
71
cd recipes
48
72
for /f " tokens=*" %%a in ('git ls-tree --name-only main -- .') do rmdir /s /q %%a && echo Removing recipe: %%a
@@ -54,13 +78,13 @@ if not exist "%CONDA_BLD_PATH%\noarch\" mkdir "%CONDA_BLD_PATH%\noarch\"
54
78
55
79
echo Index %CONDA_BLD_PATH%
56
80
conda.exe index " %CONDA_BLD_PATH% "
57
- if errorlevel 1 exit 1
81
+ if ! errorlevel! neq 0 exit /b !errorlevel!
58
82
59
83
call :end_group
60
84
61
85
echo Building all recipes
62
86
python .ci_support\build_all.py --arch 64
63
- if errorlevel 1 exit 1
87
+ if ! errorlevel! neq 0 exit /b !errorlevel!
64
88
65
89
call :start_group " Inspecting artifacts"
66
90
0 commit comments