Skip to content

Commit

Permalink
Run CI with LLVM 15 on Windows
Browse files Browse the repository at this point in the history
This includes changes:

- Adding the Windows LLVM 15 config to the Azure setup.
- Converting the commands in the Azure pipeline file to a call to the
  setup_conda_environment.cmd script (it's easier to edit a script
  rather than individual lines in the Azure file).
- Installation of LLVM 15 from conda-forge.
- A workaround / supporting change for the conda-forge solution to
  conda-forge/llvmdev-feedstock#175.
  • Loading branch information
gmarkall committed Mar 14, 2024
1 parent a585985 commit cdd4c5f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
10 changes: 5 additions & 5 deletions buildscripts/azure/azure-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
PYTHON: '3.12'
CONDA_ENV: cienv

llvm15:
PYTHON: '3.12'
CONDA_ENV: cienv
LLVM: '15'

steps:

Expand All @@ -33,11 +37,7 @@ jobs:
- script: |
call C:\Miniconda3\Scripts\activate.bat
call conda list
call conda remove --all -q -y -n %CONDA_ENV%
call conda create -n %CONDA_ENV% -q -y python=%PYTHON% cmake
call activate %CONDA_ENV%
call conda install -y -q -c numba/label/dev llvmdev="14.*" libxml2
call buildscripts\\incremental\\setup_conda_environment.cmd
displayName: 'Before Install'
- script: |
Expand Down
19 changes: 19 additions & 0 deletions buildscripts/incremental/build.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

call activate %CONDA_ENV%

@rem LLVM derives the location of diaguids.lib from the build-time environment.
@rem Conda-forge packaging works around this by substituting the build-time
@rem location of Visual Studio with $ENV{VSINSTALLDIR}. In order to ensure that
@rem this environment variable is set appropriately, we activate the Visual
@rem Studio Developer Command Prompt prior to running setup.py
@rem
@rem This workaround is required whilst using LLVM from conda-forge; it may also
@rem be necessary to consider a workaround for our own llvmdev packages.
@rem
@rem For more info, see:
@rem
@rem - https://github.com/conda-forge/llvmdev-feedstock/issues/175
@rem - https://github.com/conda-forge/llvmdev-feedstock/pull/223
@rem - https://github.com/MicrosoftDocs/visualstudio-docs/issues/7774
if "%LLVM%"=="15" (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
if %errorlevel% neq 0 exit /b %errorlevel%
)

python setup.py build
22 changes: 11 additions & 11 deletions buildscripts/incremental/setup_conda_environment.cmd
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
@rem The cmd /C hack circumvents a regression where conda installs a conda.bat
@rem script in non-root environments.
set CONDA_INSTALL=cmd /C conda install -q -y
set PIP_INSTALL=pip install -q

@echo on

@rem Deactivate any environment
call deactivate
@rem Display root environment (for debugging)
conda list
call conda list

@rem Clean up any left-over from a previous build
conda remove --all -q -y -n %CONDA_ENV%
call conda remove --all -q -y -n %CONDA_ENV%

@rem Create and populate environment
conda create -n %CONDA_ENV% -q -y python=%PYTHON% cmake
call conda create -n %CONDA_ENV% -q -y python=%PYTHON% cmake
if %errorlevel% neq 0 exit /b %errorlevel%

call activate %CONDA_ENV%
if %errorlevel% neq 0 exit /b %errorlevel%

@rem Install llvmdev
%CONDA_INSTALL% -c numba/label/dev llvmdev="14.*"
if "%LLVM%"=="15" (
set LLVMDEV_CHANNEL="conda-forge"
) else (
set LLVMDEV_CHANNEL="numba/label/dev"
)

call conda install -y -q -c %LLVMDEV_CHANNEL% llvmdev="%LLVM%" libxml2
if %errorlevel% neq 0 exit /b %errorlevel%

0 comments on commit cdd4c5f

Please sign in to comment.