Dan Willemsen | 0df1517 | 2017-05-07 11:23:59 -0700 | [diff] [blame] | 1 | #!/bin/bash -eu |
| 2 | # |
| 3 | # Copyright 2017 Google Inc. All rights reserved. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # |
| 18 | # This file is used in our continous build infrastructure to run a variety of |
| 19 | # tests related to the build system. |
| 20 | # |
| 21 | # Currently, it's used to build and run multiproduct_kati, so it'll attempt |
| 22 | # to build ninja files for every product in the tree. I expect this to |
| 23 | # evolve as we find interesting things to test or track performance for. |
| 24 | # |
| 25 | |
Anton Hansson | 785a31a | 2020-12-16 20:08:03 +0000 | [diff] [blame] | 26 | # Products that are broken or otherwise don't work with multiproduct_kati |
| 27 | SKIPPED_PRODUCTS=( |
Anton Hansson | b850f84 | 2022-02-17 19:52:46 +0000 | [diff] [blame] | 28 | # Both of these products are for soong-only builds, and will fail the kati stage. |
Anton Hansson | 785a31a | 2020-12-16 20:08:03 +0000 | [diff] [blame] | 29 | mainline_sdk |
Anton Hansson | b850f84 | 2022-02-17 19:52:46 +0000 | [diff] [blame] | 30 | ndk |
Anton Hansson | 785a31a | 2020-12-16 20:08:03 +0000 | [diff] [blame] | 31 | ) |
| 32 | |
Dan Willemsen | 0df1517 | 2017-05-07 11:23:59 -0700 | [diff] [blame] | 33 | # To track how long we took to startup. %N isn't supported on Darwin, but |
| 34 | # that's detected in the Go code, which skips calculating the startup time. |
| 35 | export TRACE_BEGIN_SOONG=$(date +%s%N) |
| 36 | |
Dan Willemsen | 0abd437 | 2018-10-15 22:06:54 -0700 | [diff] [blame] | 37 | # Remove BUILD_NUMBER so that incremental builds on build servers don't |
| 38 | # re-read makefiles every time. |
| 39 | unset BUILD_NUMBER |
| 40 | |
Dan Willemsen | 0df1517 | 2017-05-07 11:23:59 -0700 | [diff] [blame] | 41 | export TOP=$(cd $(dirname ${BASH_SOURCE[0]})/../..; PWD= /bin/pwd) |
Jeff Gaston | e2128d3 | 2017-10-06 12:22:09 -0700 | [diff] [blame] | 42 | cd "${TOP}" |
Dan Willemsen | 91f9b54 | 2017-07-18 19:39:34 -0700 | [diff] [blame] | 43 | source "${TOP}/build/soong/scripts/microfactory.bash" |
Dan Willemsen | 0df1517 | 2017-05-07 11:23:59 -0700 | [diff] [blame] | 44 | |
Dan Willemsen | e7efcbe | 2017-06-20 23:27:45 -0700 | [diff] [blame] | 45 | case $(uname) in |
| 46 | Linux) |
| 47 | export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so |
Dan Willemsen | 89479fa | 2017-10-09 16:08:30 -0700 | [diff] [blame] | 48 | export SEGFAULT_USE_ALTSTACK=1 |
| 49 | ulimit -a |
Dan Willemsen | e7efcbe | 2017-06-20 23:27:45 -0700 | [diff] [blame] | 50 | ;; |
| 51 | esac |
| 52 | |
Rupert Shuttleworth | 6284ceb | 2020-10-27 03:50:40 +0000 | [diff] [blame] | 53 | echo |
Lukacs T. Berki | 4070bcd | 2021-05-17 14:33:01 +0200 | [diff] [blame] | 54 | echo "Free disk space:" |
Cole Faust | fa3431c | 2021-11-30 12:15:34 -0800 | [diff] [blame] | 55 | # Ignore df errors because it errors out on gvfsd file systems |
| 56 | # but still displays most of the useful info we need |
| 57 | df -h || true |
Lukacs T. Berki | 4070bcd | 2021-05-17 14:33:01 +0200 | [diff] [blame] | 58 | |
| 59 | echo |
Rupert Shuttleworth | 6284ceb | 2020-10-27 03:50:40 +0000 | [diff] [blame] | 60 | echo "Running Bazel smoke test..." |
Jingwen Chen | 8c52358 | 2021-06-01 11:19:53 +0000 | [diff] [blame] | 61 | STANDALONE_BAZEL=true "${TOP}/tools/bazel" --batch --max_idle_secs=1 info |
Rupert Shuttleworth | 6284ceb | 2020-10-27 03:50:40 +0000 | [diff] [blame] | 62 | |
| 63 | echo |
| 64 | echo "Running Soong test..." |
Dan Willemsen | 91f9b54 | 2017-07-18 19:39:34 -0700 | [diff] [blame] | 65 | soong_build_go multiproduct_kati android/soong/cmd/multiproduct_kati |
Anton Hansson | 785a31a | 2020-12-16 20:08:03 +0000 | [diff] [blame] | 66 | exec "$(getoutdir)/multiproduct_kati" --skip-products "$(echo "${SKIPPED_PRODUCTS[@]-}" | tr ' ' ',')" "$@" |