blob: eda4bebe1d2200c494abba8b83841370ff84dba1 [file] [log] [blame]
Dan Willemsen0df15172017-05-07 11:23:59 -07001#!/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 Hansson785a31a2020-12-16 20:08:03 +000026# Products that are broken or otherwise don't work with multiproduct_kati
27SKIPPED_PRODUCTS=(
Martin Stjernholm104f0412022-04-14 13:22:54 +010028 # These products are for soong-only builds, and will fail the kati stage.
29 linux_bionic
Anton Hansson785a31a2020-12-16 20:08:03 +000030 mainline_sdk
Anton Hanssonb850f842022-02-17 19:52:46 +000031 ndk
Colin Cross774a1bf2022-10-06 01:29:49 +000032
33 # New architecture bringup, fails without ALLOW_MISSING_DEPENDENCIES=true
34 aosp_riscv64
Anton Hansson785a31a2020-12-16 20:08:03 +000035)
36
Dan Willemsen0df15172017-05-07 11:23:59 -070037# To track how long we took to startup. %N isn't supported on Darwin, but
38# that's detected in the Go code, which skips calculating the startup time.
39export TRACE_BEGIN_SOONG=$(date +%s%N)
40
Dan Willemsen0abd4372018-10-15 22:06:54 -070041# Remove BUILD_NUMBER so that incremental builds on build servers don't
42# re-read makefiles every time.
43unset BUILD_NUMBER
44
Dan Willemsen0df15172017-05-07 11:23:59 -070045export TOP=$(cd $(dirname ${BASH_SOURCE[0]})/../..; PWD= /bin/pwd)
Jeff Gastone2128d32017-10-06 12:22:09 -070046cd "${TOP}"
Dan Willemsen91f9b542017-07-18 19:39:34 -070047source "${TOP}/build/soong/scripts/microfactory.bash"
Dan Willemsen0df15172017-05-07 11:23:59 -070048
Dan Willemsene7efcbe2017-06-20 23:27:45 -070049case $(uname) in
50 Linux)
Cole Faust03560072022-10-25 14:38:31 -070051 if [[ -f /lib/x86_64-linux-gnu/libSegFault.so ]]; then
52 export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
53 export SEGFAULT_USE_ALTSTACK=1
54 fi
Dan Willemsen89479fa2017-10-09 16:08:30 -070055 ulimit -a
Dan Willemsene7efcbe2017-06-20 23:27:45 -070056 ;;
57esac
58
Rupert Shuttleworth6284ceb2020-10-27 03:50:40 +000059echo
Lukacs T. Berki4070bcd2021-05-17 14:33:01 +020060echo "Free disk space:"
Cole Faustfa3431c2021-11-30 12:15:34 -080061# Ignore df errors because it errors out on gvfsd file systems
62# but still displays most of the useful info we need
63df -h || true
Lukacs T. Berki4070bcd2021-05-17 14:33:01 +020064
65echo
Rupert Shuttleworth6284ceb2020-10-27 03:50:40 +000066echo "Running Bazel smoke test..."
Joe Onoratoba29f382022-10-24 06:38:11 -070067STANDALONE_BAZEL=true "${TOP}/build/bazel/bin/bazel" --batch --max_idle_secs=1 help
Rupert Shuttleworth6284ceb2020-10-27 03:50:40 +000068
69echo
70echo "Running Soong test..."
Dan Willemsen91f9b542017-07-18 19:39:34 -070071soong_build_go multiproduct_kati android/soong/cmd/multiproduct_kati
Anton Hansson785a31a2020-12-16 20:08:03 +000072exec "$(getoutdir)/multiproduct_kati" --skip-products "$(echo "${SKIPPED_PRODUCTS[@]-}" | tr ' ' ',')" "$@"