Skip to content

Commit

Permalink
Support python 3.11 on aarch64
Browse files Browse the repository at this point in the history
Fixes #30927
  • Loading branch information
Mickaël Guérin committed Feb 2, 2023
1 parent d14020d commit 595f3f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM dockcross/manylinux2014-aarch64:20210826-19322ba
FROM dockcross/manylinux2014-aarch64:latest

# manylinux_2_17 is the preferred alias of manylinux2014
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
Expand All @@ -24,13 +24,14 @@ RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
RUN /opt/python/cp311-cp311/bin/pip install --upgrade cython

#=================
# Install ccache

# Install ccache from source since ccache 3.x packaged with most linux distributions
# does not support Redis backend for caching.
RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD \
RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD STRIP OBJCOPY \
&& curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
&& tar -zxf ccache.tar.gz \
&& cd ccache-4.5.1 \
Expand All @@ -40,14 +41,4 @@ RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD \
&& cd ../.. \
&& rm -rf ccache-4.5.1 ccache.tar.gz

# the dockcross docker image sets variables like CC, CXX etc.
# to point to the crosscompilation toolchain, but doesn't set corresponding
# variables for the "strip" and "objcopy" tools.
# see https://github.com/dockcross/dockcross/blob/4349cb4999401cbf22a90f46f5052d29be240e50/manylinux2014-aarch64/Dockerfile.in#L23
ENV STRIP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip \
OBJCOPY=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-objcopy

# The dockcross base of this image sets CC and CXX to absolute paths, which makes it impossible to redirect their invocations
# to ccache via a symlink. Use relative paths instead.
ENV CC ${CROSS_TRIPLE}-gcc
ENV CXX ${CROSS_TRIPLE}-g++
RUN git config --global --add safe.directory /var/local/jenkins/grpc
5 changes: 4 additions & 1 deletion tools/run_tests/artifacts/artifact_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ def build_jobspec(self, inner_jobs=None):
environ['GRPC_SKIP_PIP_CYTHON_UPGRADE'] = 'TRUE'
if self.arch == 'aarch64':
environ['GRPC_SKIP_TWINE_CHECK'] = 'TRUE'
# As we won't strip the binary with auditwheel (see below), strip
# it at link time.
environ['LDFLAGS'] = '-s'
else:
# only run auditwheel if we're not crosscompiling
environ['GRPC_RUN_AUDITWHEEL_REPAIR'] = 'TRUE'
Expand Down Expand Up @@ -366,7 +369,7 @@ def targets():
PythonArtifact('manylinux2014', 'aarch64', 'cp38-cp38', presubmit=True),
PythonArtifact('manylinux2014', 'aarch64', 'cp39-cp39'),
PythonArtifact('manylinux2014', 'aarch64', 'cp310-cp310'),
# TODO(https://github.com/grpc/grpc/issues/30927): Support aarch64 with 3.11. Blocked on dockcross support.
PythonArtifact('manylinux2014', 'aarch64', 'cp311-cp311'),
PythonArtifact('linux_extra', 'armv7', 'cp37-cp37m', presubmit=True),
PythonArtifact('linux_extra', 'armv7', 'cp38-cp38'),
PythonArtifact('linux_extra', 'armv7', 'cp39-cp39'),
Expand Down

0 comments on commit 595f3f8

Please sign in to comment.