• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%YAML 1.2
2--- |
3  # Copyright 2024 The gRPC Authors
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  # The aarch64 wheels are being crosscompiled to allow running the build
18  # on x64 machine. The dockcross/linux-armv7 image is a x86_64
19  # image with crosscompilation toolchain installed
20
21  # AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_linux_armv7/Dockerfile.template`!!!
22  FROM dockcross/linux-armv7
23
24  <%text>RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
25                                   libnss3-dev libssl-dev libreadline-dev libffi-dev && apt-get clean</%text>
26
27  ADD install_python_for_wheel_crosscompilation.sh /scripts/install_python_for_wheel_crosscompilation.sh
28
29  RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.8.8" "3.8.8" /opt/python/cp38-cp38
30  RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.9.2" "3.9.2" /opt/python/cp39-cp39
31  RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.10.0" "3.10.0rc1" /opt/python/cp310-cp310
32  RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.11.0" "3.11.0rc1" /opt/python/cp311-cp311
33  RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.12.0" "3.12.0rc2" /opt/python/cp312-cp312
34  RUN /scripts/install_python_for_wheel_crosscompilation.sh "3.13.0" "3.13.0rc2" /opt/python/cp313-cp313
35
36  ENV AUDITWHEEL_ARCH armv7l
37  ENV AUDITWHEEL_PLAT linux_armv7l
38
39  <%include file="../ccache_crosscompile.include"/>
40
41  # The dockcross base of this image sets CC and CXX to absolute paths, which makes it impossible to redirect their invocations
42  # to ccache via a symlink. Use relative paths instead.
43  <%text>
44  ENV CC ${CROSS_TRIPLE}-gcc
45  ENV CXX ${CROSS_TRIPLE}-g++
46  </%text>
47
48  # For historical reasons, task_runner.py the script under docker container using "bash -l"
49  # which loads /etc/profile on startup. dockcross/linux-armv7 is based on an image where
50  # /etc/profile overwrites contents of PATH (for security reasons) when run as root.
51  # That causes the crosscompiler binaries located under /usr/xcc/armv7-unknown-linux-gnueabi/bin
52  # to be removed from PATH. Since in our builds we don't need the /etc/profile for anything, we can just
53  # truncate it.
54  # TODO(jtattermusch): Remove this hack when possible.
55  RUN echo "# file contents removed to avoid resetting PATH set by the docker image" >/etc/profile
56
57  <%include file="../git_config.include"/>
58