mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-01 23:30:35 +00:00
Here's the motivating issue: https://github.com/microsoft/azure-pipelines-tasks/issues/10331 Noticed some problems in other repos so also updating usages in ORT. We may be fine now without it, but this change adds some safeguard against future additions of 'set -x' for debugging.
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
# It's used for compilation with cache in Mac Host.
|
|
|
|
parameters:
|
|
- name: WithCache
|
|
displayName: Build with Cache
|
|
type: boolean
|
|
default: false
|
|
|
|
- name: BuildStep
|
|
type: stepList
|
|
|
|
# if WithCahe is false, the following parameters are not used.
|
|
- name: Today
|
|
type: string
|
|
default: ""
|
|
|
|
- name: AdditionalKey
|
|
type: string
|
|
default: ""
|
|
|
|
- name: CacheDir
|
|
type: string
|
|
default: ""
|
|
|
|
- name: ChangeEveryCommit
|
|
type: boolean
|
|
default: true
|
|
|
|
steps:
|
|
- script: |
|
|
which ccache || brew install ccache
|
|
# Do not output ##vso[] commands with `set -x` or they may be parsed again and include a trailing quote.
|
|
set +x
|
|
echo "##vso[task.prependpath]/usr/local/opt/ccache/libexec"
|
|
mkdir -p "${{ parameters.CacheDir }}"
|
|
displayName: Install ccache and update PATH to use linked versions of gcc, cc, etc
|
|
condition: eq(${{ parameters.WithCache }}, true)
|
|
|
|
- task: Cache@2
|
|
inputs:
|
|
${{ if eq(parameters.ChangeEveryCommit, true) }}:
|
|
# If it's a merge build, the run will read the cache generated by main build.
|
|
${{if eq(variables['Build.SourceBranchName'], 'merge')}}:
|
|
key: ' "$(TODAY)" | ccache | merge '
|
|
${{else}}:
|
|
key: ' "${{parameters.Today}}" | ${{parameters.AdditionalKey}} | "$(Build.SourceVersion)" '
|
|
restoreKeys: |
|
|
"${{parameters.Today}}" | ${{parameters.AdditionalKey}}
|
|
${{ else }}:
|
|
key: ' ${{parameters.AdditionalKey}} '
|
|
restoreKeys: |
|
|
${{parameters.AdditionalKey}}
|
|
path: ${{ parameters.CacheDir }}
|
|
displayName: ccache task
|
|
condition: eq(${{ parameters.WithCache }}, true)
|
|
|
|
- ${{ parameters.BuildStep }}
|
|
|
|
- ${{ if eq(parameters.WithCache, true) }}:
|
|
- template: check-cache-stats.yml
|
|
parameters:
|
|
CacheDir: ${{ parameters.CacheDir }}
|