1
0
Fork 0

Merge pull request #209 from google/build-examples

option to disable compilation cache + perl on windows
This commit is contained in:
Mikhail Goncharov 2020-07-08 16:39:37 +02:00 committed by GitHub
commit f325b51010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 9 deletions

View file

@ -32,11 +32,8 @@ RUN powershell -NoProfile -InputFormat None -Command `
# install tools as described in https://llvm.org/docs/GettingStartedVS.html # install tools as described in https://llvm.org/docs/GettingStartedVS.html
# and a few more that were not documented... # and a few more that were not documented...
RUN choco install -y ninja RUN choco install -y ninja git python3 gnuwin activeperl
RUN choco install -y git
RUN choco install -y cmake --version 3.15.4 RUN choco install -y cmake --version 3.15.4
RUN choco install -y python3
RUN choco install -y gnuwin
RUN choco install -y sccache RUN choco install -y sccache
RUN pip install psutil RUN pip install psutil

View file

@ -20,6 +20,7 @@ if __name__ == '__main__':
script_branch = os.getenv("scripts_branch", "master") script_branch = os.getenv("scripts_branch", "master")
queue_prefix = os.getenv("ph_queue_prefix", "") queue_prefix = os.getenv("ph_queue_prefix", "")
diff_id = os.getenv("ph_buildable_diff", "") diff_id = os.getenv("ph_buildable_diff", "")
steps = [] steps = []
linux_buld_step = { linux_buld_step = {
'label': ':linux: build and test linux', 'label': ':linux: build and test linux',

View file

@ -19,34 +19,45 @@ import yaml
if __name__ == '__main__': if __name__ == '__main__':
script_branch = os.getenv("scripts_branch", "master") script_branch = os.getenv("scripts_branch", "master")
queue_prefix = os.getenv("ph_queue_prefix", "") queue_prefix = os.getenv("ph_queue_prefix", "")
no_cache = os.getenv('ph_no_cache', '') != ''
projects = 'clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;openmp;polly'
steps = [] steps = []
linux_buld_step = { linux_buld_step = {
'label': ':linux: build and test linux', 'label': ':linux: build and test linux',
'key': 'linux', 'key': 'linux',
'commands': [ 'commands': [
'ccache --clear' if no_cache else '',
'ccache --zero-stats',
'mkdir -p artifacts', 'mkdir -p artifacts',
'dpkg -l >> artifacts/packages.txt', 'dpkg -l >> artifacts/packages.txt',
'export SRC=${BUILDKITE_BUILD_PATH}/llvm-premerge-checks', 'export SRC=${BUILDKITE_BUILD_PATH}/llvm-premerge-checks',
'rm -rf ${SRC}', 'rm -rf ${SRC}',
'git clone --depth 1 --branch ${scripts_branch} https://github.com/google/llvm-premerge-checks.git ${SRC}', 'git clone --depth 1 --branch ${scripts_branch} https://github.com/google/llvm-premerge-checks.git ${SRC}',
'${SRC}/scripts/premerge_checks.py ' f'${{SRC}}/scripts/premerge_checks.py --projects="{projects}"',
'--projects="clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;flang;openmp;polly;compiler-rt"', 'EXIT_STATUS=\\$?',
'echo "--- ccache stats"',
'ccache --show-stats',
'exit \\$EXIT_STATUS',
], ],
'artifact_paths': ['artifacts/**/*', '*_result.json'], 'artifact_paths': ['artifacts/**/*', '*_result.json'],
'agents': {'queue': f'{queue_prefix}linux'}, 'agents': {'queue': f'{queue_prefix}linux'},
'timeout_in_minutes': 120, 'timeout_in_minutes': 120,
} }
clear_sccache = 'powershell -command "sccache --stop-server; ' \
'Remove-Item -Recurse -Force -ErrorAction Ignore $env:SCCACHE_DIR; ' \
'sccache --start-server"'
windows_buld_step = { windows_buld_step = {
'label': ':windows: build and test windows', 'label': ':windows: build and test windows',
'key': 'windows', 'key': 'windows',
'commands': [ 'commands': [
clear_sccache if no_cache else '',
'sccache --zero-stats', 'sccache --zero-stats',
'set SRC=%BUILDKITE_BUILD_PATH%/llvm-premerge-checks', 'set SRC=%BUILDKITE_BUILD_PATH%/llvm-premerge-checks',
'rm -rf %SRC%', 'rm -rf %SRC%',
'git clone --depth 1 --branch %scripts_branch% https://github.com/google/llvm-premerge-checks.git %SRC%', 'git clone --depth 1 --branch %scripts_branch% https://github.com/google/llvm-premerge-checks.git %SRC%',
'powershell -command "%SRC%/scripts/premerge_checks.py ' f'powershell -command "%SRC%/scripts/premerge_checks.py --projects=\'{projects}\'; '
'--projects=\'clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;flang;openmp;polly;compiler-rt\'; '
'\\$exit=\\$?;' '\\$exit=\\$?;'
'echo \'--- sccache stats\';'
'sccache --show-stats;' 'sccache --show-stats;'
'if (\\$exit) {' 'if (\\$exit) {'
' echo success;' ' echo success;'

View file

@ -27,7 +27,7 @@ $IMAGE="gcr.io/llvm-premerge-checks/${NAME}:${version}"
Write-Output "Authenticating docker..." Write-Output "Authenticating docker..."
Write-Output "y`n" | gcloud auth configure-docker Write-Output "y`n" | gcloud auth configure-docker
Write-Output "Pulling new image..." Write-Output "Pulling new image '${IMAGE}'..."
docker pull ${IMAGE} docker pull ${IMAGE}
Write-Output "Stopping old container..." Write-Output "Stopping old container..."
docker stop ${NAME} docker stop ${NAME}