Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions scripts/Docker/_clang-cross-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ DOCKER_DIR="$1"
# the target architecture to build for
ARCH="$2"

# the docker image architecture to use
# the docker platform to use
MACHINE_ARCH="$(uname -m)"
case $MACHINE_ARCH in
arm64) IMAGE_ARCH=arm64v8 ; MACHINE_ARCH=aarch64 ;;
*) IMAGE_ARCH=amd64 ;;
arm64) PLATFORM=linux/arm64 ; MACHINE_ARCH=aarch64 ;;
*) PLATFORM=linux/amd64 ;;
esac

# the ABI
Expand All @@ -28,10 +28,16 @@ ABI=$3
# the variant
VARIANT=$4

# architecture-specific additional args (matching CI configuration)
ADDITIONAL_ARGS=""
case $ARCH in
loongarch64) ADDITIONAL_ARGS="--verifyGlibcMax=2.38" ;;
esac

(cd $DIR &&
docker build --tag skiasharp-linux-$ABI-cross-$ARCH \
--platform=$PLATFORM \
--build-arg BUILD_ARCH=$ARCH \
--build-arg IMAGE_ARCH=$IMAGE_ARCH \
--build-arg MACHINE_ARCH=$MACHINE_ARCH \
$DOCKER_DIR)

Expand All @@ -40,4 +46,4 @@ VARIANT=$4
(cd $DIR/../.. &&
docker run --rm --name skiasharp-linux-$ABI-cross-$ARCH --volume $(pwd):/work skiasharp-linux-$ABI-cross-$ARCH /bin/bash -c " \
dotnet tool restore ; \
dotnet cake --target=externals-linux-clang-cross --configuration=Release --buildarch=$ARCH $VARIANT ")
dotnet cake --target=externals-linux-clang-cross --configuration=Release --buildarch=$ARCH $VARIANT $ADDITIONAL_ARGS ")
5 changes: 2 additions & 3 deletions scripts/Docker/alpine/clang-cross/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Arguments:
# IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 | riscv64 | loongarch64 ]
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ]
# LLVM_VERSION - the version of the LLVM compiler [ 19 | * ]
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-alpine-linux-musleabihf | aarch64-alpine-linux-musl | riscv64-alpine-linux-musl | loongarch64-alpine-linux-musl ]

ARG IMAGE_ARCH=amd64
FROM ${IMAGE_ARCH}/debian:12
# Use --platform flag when building to select architecture
FROM debian:12

# Set the architecture-specific variables based on the value of the BUILD_ARCH argument
ARG BUILD_ARCH=arm64
Expand Down
5 changes: 2 additions & 3 deletions scripts/Docker/debian/clang-cross/10/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Arguments:
# IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 | riscv64 ]
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ]
# LLVM_VERSION - the version of the LLVM compiler [ 13 | * ]
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 8 | * ]
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-linux-gnueabihf | aarch64-linux-gnu | riscv64-linux-gnu ]
# TOOLCHAIN_ARCH_SHORT - the short form architecture of the GCC toolchain [ armhf | arm64 | riscv64 ]

ARG IMAGE_ARCH=amd64
FROM ${IMAGE_ARCH}/debian:10
# Use --platform flag when building to select architecture
FROM debian:10

# Switch to archives
RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list && \
Expand Down
5 changes: 2 additions & 3 deletions scripts/Docker/debian/clang-cross/11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Arguments:
# IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 | riscv64 ]
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ]
# LLVM_VERSION - the version of the LLVM compiler [ 19 | * ]
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 12 | * ]
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-linux-gnueabihf | aarch64-linux-gnu | riscv64-linux-gnu ]
# TOOLCHAIN_ARCH_SHORT - the short form architecture of the GCC toolchain [ armhf | arm64 | riscv64 ]

ARG IMAGE_ARCH=amd64
FROM ${IMAGE_ARCH}/debian:11
# Use --platform flag when building to select architecture
FROM debian:11

# Set the architecture-specific variables based on the value of the BUILD_ARCH argument
ARG BUILD_ARCH=arm64
Expand Down
5 changes: 2 additions & 3 deletions scripts/Docker/debian/clang-cross/12/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Arguments:
# IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 | riscv64 ]
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ]
# LLVM_VERSION - the version of the LLVM compiler [ 19 | * ]
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 12 | * ]
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-linux-gnueabihf | aarch64-linux-gnu | riscv64-linux-gnu ]
# TOOLCHAIN_ARCH_SHORT - the short form architecture of the GCC toolchain [ armhf | arm64 | riscv64 ]

ARG IMAGE_ARCH=amd64
FROM ${IMAGE_ARCH}/debian:12
# Use --platform flag when building to select architecture
FROM debian:12

# Set the architecture-specific variables based on the value of the BUILD_ARCH argument
ARG BUILD_ARCH=arm64
Expand Down
8 changes: 3 additions & 5 deletions scripts/Docker/debian/clang-cross/13/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Arguments:
# IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 | riscv64 | loongarch64 ]
# DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ]
# LLVM_VERSION - the version of the LLVM compiler [ 19 | * ]
# TOOLCHAIN_VERSION - the version of the GCC toolchain [ 14 | * ]
# TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-linux-gnueabihf | aarch64-linux-gnu | riscv64-linux-gnu | loongarch64-linux-gnu ]
# TOOLCHAIN_ARCH_SHORT - the short form architecture of the GCC toolchain [ armhf | arm64 | riscv64 | loong64 ]

ARG IMAGE_ARCH=amd64
FROM ${IMAGE_ARCH}/debian:13
# Use --platform flag when building to select architecture
FROM debian:13

# Set the architecture-specific variables based on the value of the BUILD_ARCH argument
ARG BUILD_ARCH=arm64
Expand Down Expand Up @@ -51,12 +50,11 @@ RUN . /etc/skia-env \
&& sed -i "s/\/usr\/${TOOLCHAIN_ARCH}\/lib\///g" /usr/${TOOLCHAIN_ARCH}/lib/libc.so

# Install the cross-compilation skia build dependencies (fontconfig)
# In order to compat Loongnix 25, LoongArch APT_REPO use loongnix 25 mirrors.
RUN . /etc/skia-env \
&& mkdir -p /skia-utils/libfontconfig-dev \
&& cd /skia-utils/libfontconfig-dev \
&& case "${TOOLCHAIN_ARCH_SHORT}" in \
loong64) FC_VERSION=2.15.0-1.1 ; FC_PKG=libfontconfig-dev ; APT_REPO=https://pkg.loongnix.cn/loongnix/25 ;; \
loong64) FC_VERSION=2.17.1-3 ; FC_PKG=libfontconfig-dev ; APT_REPO=http://deb.debian.org/debian ;; \
riscv64) FC_VERSION=2.15.0-2.3 ; FC_PKG=libfontconfig-dev ; APT_REPO=http://deb.debian.org/debian ;; \
*) FC_VERSION=2.13.1-2 ; FC_PKG=libfontconfig1-dev ; APT_REPO=http://deb.debian.org/debian ;; \
esac \
Expand Down
4 changes: 2 additions & 2 deletions scripts/azure-templates-jobs-bootstrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ jobs:
dockerfile: ${{ parameters.docker }}/Dockerfile
context: ${{ parameters.docker }}
image: skiasharp:skiasharp
buildArguments: --tag skiasharp ${{ parameters.dockerArgs }}
buildArguments: --platform linux/amd64 --tag skiasharp ${{ parameters.dockerArgs }}
enableNetwork: true
- ${{ if ne(parameters.use1ESPipelineTemplates, 'true') }}:
- task: Docker@2
Expand All @@ -367,7 +367,7 @@ jobs:
command: build
buildContext: ${{ parameters.docker }}
dockerfile: ${{ parameters.docker }}/Dockerfile
arguments: --tag skiasharp ${{ parameters.dockerArgs }}
arguments: --platform linux/amd64 --tag skiasharp ${{ parameters.dockerArgs }}
- bash: |
echo dotnet tool restore > cmd.sh
echo dotnet cake --target=${{ parameters.target }} --verbosity=${{ parameters.verbosity }} --configuration=${{ coalesce(parameters.configuration, 'Release') }} ${{ parameters.additionalArgs }} >> cmd.sh
Expand Down