1*523fa7a6SAndroid Build Coastguard Worker#!/bin/bash 2*523fa7a6SAndroid Build Coastguard Worker# Copyright (c) Meta Platforms, Inc. and affiliates. 3*523fa7a6SAndroid Build Coastguard Worker# All rights reserved. 4*523fa7a6SAndroid Build Coastguard Worker# 5*523fa7a6SAndroid Build Coastguard Worker# This source code is licensed under the BSD-style license found in the 6*523fa7a6SAndroid Build Coastguard Worker# LICENSE file in the root directory of this source tree. 7*523fa7a6SAndroid Build Coastguard Worker 8*523fa7a6SAndroid Build Coastguard Workerset -exu 9*523fa7a6SAndroid Build Coastguard Worker 10*523fa7a6SAndroid Build Coastguard Worker# shellcheck source=/dev/null 11*523fa7a6SAndroid Build Coastguard Workersource "$(dirname "${BASH_SOURCE[0]}")/utils.sh" 12*523fa7a6SAndroid Build Coastguard Worker 13*523fa7a6SAndroid Build Coastguard WorkerBUILD_TOOL=$1 14*523fa7a6SAndroid Build Coastguard Workerif [[ -z "${BUILD_TOOL:-}" ]]; then 15*523fa7a6SAndroid Build Coastguard Worker echo "Missing build tool (require buck2 or cmake), exiting..." 16*523fa7a6SAndroid Build Coastguard Worker exit 1 17*523fa7a6SAndroid Build Coastguard Workerelse 18*523fa7a6SAndroid Build Coastguard Worker echo "Setup Linux for ${BUILD_TOOL} ..." 19*523fa7a6SAndroid Build Coastguard Workerfi 20*523fa7a6SAndroid Build Coastguard Worker 21*523fa7a6SAndroid Build Coastguard Worker# As Linux job is running inside a Docker container, all of its dependencies 22*523fa7a6SAndroid Build Coastguard Worker# have already been installed, so we use PyTorch build from source here instead 23*523fa7a6SAndroid Build Coastguard Worker# of nightly. This allows CI to test against latest commits from PyTorch 24*523fa7a6SAndroid Build Coastguard Workerinstall_executorch "use-pt-pinned-commit" 25*523fa7a6SAndroid Build Coastguard Workerbuild_executorch_runner "${BUILD_TOOL}" 26*523fa7a6SAndroid Build Coastguard Workerdo_not_use_nightly_on_ci 27