xref: /aosp_15_r20/external/executorch/build/packaging/pre_build_script.sh (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1#!/bin/bash
2# Copyright (c) Meta Platforms, Inc. and affiliates.
3# All rights reserved.
4#
5# This source code is licensed under the BSD-style license found in the
6# LICENSE file in the root directory of this source tree.
7
8set -euxo pipefail
9
10# This script is run before building ExecuTorch binaries
11
12# Manually install build requirements because `python setup.py bdist_wheel` does
13# not install them. TODO(dbort): Switch to using `python -m build --wheel`,
14# which does install them. Though we'd need to disable build isolation to be
15# able to see the installed torch package.
16readonly BUILD_DEPS=(
17  # This list must match the build-system.requires list from pyproject.toml.
18  "cmake"
19  "pip>=23"
20  "pyyaml"
21  "setuptools>=63"
22  "tomli"
23  "wheel"
24  "zstd"
25)
26pip install --progress-bar off "${BUILD_DEPS[@]}"
27