xref: /aosp_15_r20/external/grpc-grpc/tools/bazelify_tests/test/build_artifact_python_linux_x64_cp39.sh (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1#!/bin/bash
2# Copyright 2023 The gRPC Authors
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16set -ex
17
18# env variable values extracted from PythonArtifact in tools/run_tests/artifacts/artifact_targets.py
19# TODO(jtattermusch): find a better way of configuring the python artifact build (the current approach mostly serves as a demonstration)
20export PYTHON=/opt/python/cp39-cp39/bin/python
21export PIP=/opt/python/cp39-cp39/bin/pip
22export GRPC_SKIP_PIP_CYTHON_UPGRADE=TRUE
23export GRPC_RUN_AUDITWHEEL_REPAIR=TRUE
24export GRPC_BUILD_GRPCIO_TOOLS_DEPENDENTS=TRUE
25
26# Without this python cannot find the c++ compiler
27# TODO(jtattermusch): find better solution to prevent bazel from
28# restricting path contents
29export PATH="/opt/rh/devtoolset-10/root/usr/bin:$PATH"
30
31# set build parallelism to fit the machine configuration of bazelified tests RBE pool.
32export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=8
33
34mkdir -p artifacts
35
36ARTIFACTS_OUT=artifacts tools/run_tests/artifacts/build_artifact_python.sh
37