mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-06 12:06:49 +00:00
Starting with version 1.80, the Rust linter does not accept an invalid value for `target_arch` in configuration checks: ``` Compiling kata-sys-util v0.1.0 (/home/ddd/Work/kata/kata-containers/src/libs/kata-sys-util) error: unexpected `cfg` condition value: `powerpc64le` --> /home/ddd/Work/kata/kata-containers/src/libs/kata-sys-util/src/protection.rs:17:34 | 17 | #[cfg(any(target_arch = "s390x", target_arch = "powerpc64le"))] | ^^^^^^^^^^^^^^------------- | | | help: there is a expected value with a similar name: `"powerpc64"` | = note: expected values for `target_arch` are: `aarch64`, `arm`, `arm64ec`, `avr`, `bpf`, `csky`, `hexagon`, `loongarch64`, `m68k`, `mips`, `mips32r6`, `mips64`, `mips64r6`, `msp430`, `nvptx64`, `powerpc`, `powerpc64`, `riscv32`, `riscv64`, `s390x`, `sparc`, `sparc64`, `wasm32`, `wasm64`, `x86`, and `x86_64` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration = note: `-D unexpected-cfgs` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unexpected_cfgs)]` ``` According [to GitHub user @Urgau][explain], this is a new warning introduced in Rust 1.80, but the problem exists before. The correct architecture name should be `powerpc64`, and the differentiation between `powerpc64le` and `powerpc64` should use the `target_endian = "little"` check. [explain]: #10072 (comment) Fixes: #10067 Signed-off-by: Christophe de Dinechin <dinechin@redhat.com> [emlima: fix some more occurences and typos] Signed-off-by: Emanuel Lima <emlima@redhat.com> [stevenhorsman: fix some more occurences and typos] Signed-off-by: stevenhorsman <steven@uk.ibm.com>
73 lines
2.8 KiB
Docker
73 lines
2.8 KiB
Docker
# Copyright (c) 2019 Intel Corporation
|
|
# Copyright (c) 2020 Ant Group
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
FROM ubuntu:22.04
|
|
|
|
# CACHE_TIMEOUT: date to invalid cache, if the date changes the image will be rebuild
|
|
# This is required to keep build dependencies with security fixes.
|
|
ARG CACHE_TIMEOUT
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
ARG DPKG_ARCH
|
|
ARG ARCH
|
|
ARG GCC_ARCH
|
|
ARG PREFIX
|
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
RUN if [ "${ARCH}" != "$(uname -m)" ]; then sed -i 's/^deb/deb [arch=amd64]/g' /etc/apt/sources.list && \
|
|
dpkg --add-architecture "${DPKG_ARCH#:}" && \
|
|
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy main restricted" >> /etc/apt/sources.list && \
|
|
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy-updates main restricted" >> /etc/apt/sources.list && \
|
|
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy universe" >> /etc/apt/sources.list && \
|
|
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy-updates universe" >> /etc/apt/sources.list && \
|
|
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy multiverse" >> /etc/apt/sources.list && \
|
|
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy-updates multiverse" >> /etc/apt/sources.list && \
|
|
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list; fi
|
|
|
|
RUN apt-get update && apt-get upgrade -y && \
|
|
apt-get --no-install-recommends install -y \
|
|
apt-utils \
|
|
autoconf \
|
|
automake \
|
|
bc \
|
|
bison \
|
|
ca-certificates \
|
|
cpio \
|
|
dpkg-dev \
|
|
flex \
|
|
gawk \
|
|
libaio-dev${DPKG_ARCH} \
|
|
libaudit-dev${DPKG_ARCH} \
|
|
libblkid-dev${DPKG_ARCH} \
|
|
libcap-dev${DPKG_ARCH} \
|
|
libcap-ng-dev${DPKG_ARCH} \
|
|
libdw-dev${DPKG_ARCH} \
|
|
libelf-dev${DPKG_ARCH} \
|
|
libffi-dev${DPKG_ARCH} \
|
|
libglib2.0-0${DPKG_ARCH} \
|
|
libglib2.0-dev${DPKG_ARCH} \
|
|
libglib2.0-dev${DPKG_ARCH} git \
|
|
libltdl-dev${DPKG_ARCH} \
|
|
libmount-dev${DPKG_ARCH} \
|
|
libpixman-1-dev${DPKG_ARCH} \
|
|
libselinux1-dev${DPKG_ARCH} \
|
|
libtool${DPKG_ARCH} \
|
|
liburing-dev${DPKG_ARCH} \
|
|
make \
|
|
ninja-build \
|
|
pkg-config${DPKG_ARCH} \
|
|
libseccomp-dev${DPKG_ARCH} \
|
|
libseccomp2${DPKG_ARCH} \
|
|
patch \
|
|
python3 \
|
|
python3-dev \
|
|
python3-venv \
|
|
python3-tomli \
|
|
rsync \
|
|
zlib1g-dev${DPKG_ARCH} && \
|
|
if [ "${ARCH}" != s390x ]; then apt-get install -y --no-install-recommends libpmem-dev${DPKG_ARCH}; fi && \
|
|
GCC_ARCH="${ARCH}" && if [ "${ARCH}" = "ppc64le" ]; then GCC_ARCH="powerpc64le"; fi && \
|
|
if [ "${ARCH}" != "$(uname -m)" ]; then apt-get install --no-install-recommends -y gcc-"${GCC_ARCH}"-linux-gnu; fi && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/
|