1#!/bin/bash 2# Copyright 2022 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# avoid slow finalization after the script has exited. 19source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc 20 21# change to grpc repo root 22cd $(dirname $0)/../../.. 23 24export PREPARE_BUILD_INSTALL_DEPS_PYTHON=true 25source tools/internal_ci/helper_scripts/prepare_build_macos_rc 26 27# TODO(jtattermusch): cleanup this prepare build step (needed for python artifact build) 28# install cython for all python versions 29python3.7 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user 30python3.8 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user 31python3.9 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user 32python3.10 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user 33python3.11 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user 34python3.12 -m pip install -U 'cython<3.0.0rc1' setuptools==65.4.1 wheel --user 35 36# Build all python macos artifacts (this step actually builds all the binary wheels and source archives) 37tools/run_tests/task_runner.py -f artifact macos python ${TASK_RUNNER_EXTRA_FILTERS} -j 2 -x build_artifacts/sponge_log.xml || FAILED="true" 38 39# the next step expects to find the artifacts from the previous step in the "input_artifacts" folder. 40rm -rf input_artifacts 41mkdir -p input_artifacts 42cp -r artifacts/* input_artifacts/ || true 43 44# Collect the python artifact from subdirectories of input_artifacts/ to artifacts/ 45# TODO(jtattermusch): when collecting the artifacts that will later be uploaded as kokoro job artifacts, 46# potentially skip some file names that would clash with linux-created artifacts. 47cp -r input_artifacts/python_*/* artifacts/ || true 48 49# TODO(jtattermusch): Here we would normally run python macos distribtests, but currently no such tests are defined 50# in distribtest_targets.py 51 52# This step checks if any of the artifacts exceeds a per-file size limit. 53tools/internal_ci/helper_scripts/check_python_artifacts_size.sh 54 55tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh 56 57if [ "$FAILED" != "" ] 58then 59 exit 1 60fi 61