parameters: - name: EnvSetupScript type: string default: setup_env.bat - name: BuildConfig type: string - name: BuildArch type: string - name: DownloadCUDA type: boolean default: false - name: WITHCACHE type: boolean default: false - name: MachinePool type: string - name: Today type: string steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.8' addToPath: true architecture: ${{parameters.BuildArch}} - script: | python -m pip install --upgrade "setuptools>=61.0.0" wheel numpy flatbuffers workingDirectory: '$(Build.BinariesDirectory)' displayName: 'Install python modules' - template: ../download-deps.yml - task: PythonScript@0 displayName: 'Update deps.txt' inputs: scriptPath: $(Build.SourcesDirectory)/tools/ci_build/replace_urls_in_deps.py arguments: --new_dir $(Build.BinariesDirectory)/deps workingDirectory: $(Build.BinariesDirectory) - template: set-winenv.yml parameters: EnvSetupScript: ${{parameters.EnvSetupScript}} DownloadCUDA: ${{parameters.DownloadCUDA}} - ${{ if eq(parameters.WITHCACHE, true) }}: - powershell: | if ([string]::IsNullOrEmpty((Get-Command ccache -errorAction SilentlyContinue))) { choco install ccache -y --version 4.7.4 $ccache_path = (Get-Command ccache).Source $ccache_parent_dir = (Split-Path -parent $ccache_path) Copy-Item "C:\ProgramData\chocolatey\lib\ccache\tools\ccache-4.7.4-windows-x86_64\ccache.exe" -Destination "C:\ProgramData\chocolatey\bin\cl.exe" Get-ChildItem $ccache_parent_dir ccache --version } displayName: Install ccache and update PATH to use linked versions of gcc, cc, etc - ${{ if eq(parameters.WITHCACHE, true) }}: - task: Cache@2 # machinepool is used to ensure the compiler is same inputs: key: '"$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }} | $(Build.SourcesDirectory)/cmake/deps.txt, $(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1, $(Build.SourcesDirectory)/tools/ci_build/github/windows/helpers.ps1' path: $(Agent.TempDirectory)/deps_ccache restoreKeys: | "$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }} displayName: Cache Task - task: PowerShell@2 displayName: 'Install ONNX' inputs: filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' workingDirectory: '$(Build.BinariesDirectory)' ${{ if eq(parameters.WITHCACHE, true) }}: arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }} -use_cache ${{ else }}: arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }} ${{ if eq(parameters.WITHCACHE, true) }}: env: CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache CCACHE_COMPILERCHECK: content - ${{ if eq(parameters.WITHCACHE, true) }}: - powershell: | ccache -sv ccache -z displayName: cache stat env: CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache