Skip to content

Commit 7c12a73

Browse files
Fix Docker platform directives and add explicit OpenSSL paths to toolchain
Co-authored-by: ReenigneArcher <[email protected]>
1 parent 2467c1b commit 7c12a73

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

cmake/toolchains/aarch64-linux-gnu.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,14 @@ set(ENV{PKG_CONFIG_SYSROOT_DIR} "/usr/aarch64-linux-gnu")
2929

3030
# Set compiler flags for cross-compilation
3131
set(CMAKE_C_FLAGS_INIT "-march=armv8-a")
32-
set(CMAKE_CXX_FLAGS_INIT "-march=armv8-a")
32+
set(CMAKE_CXX_FLAGS_INIT "-march=armv8-a")
33+
34+
# Explicitly set OpenSSL paths for cross-compilation
35+
set(OPENSSL_ROOT_DIR "/usr/aarch64-linux-gnu")
36+
set(OPENSSL_INCLUDE_DIR "/usr/aarch64-linux-gnu/include")
37+
set(OPENSSL_CRYPTO_LIBRARY "/usr/aarch64-linux-gnu/lib/libcrypto.so")
38+
set(OPENSSL_SSL_LIBRARY "/usr/aarch64-linux-gnu/lib/libssl.so")
39+
40+
# Additional library paths
41+
set(CMAKE_LIBRARY_PATH "/usr/aarch64-linux-gnu/lib" ${CMAKE_LIBRARY_PATH})
42+
set(CMAKE_INCLUDE_PATH "/usr/aarch64-linux-gnu/include" ${CMAKE_INCLUDE_PATH})

docker/debian-trixie.dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ FROM sunshine-base AS sunshine-deps
1414
ARG BUILDPLATFORM
1515
ARG TARGETPLATFORM
1616

17+
# Force this stage to run on the build platform for cross-compilation setup
18+
FROM --platform=$BUILDPLATFORM debian:trixie AS sunshine-deps-native
19+
20+
ENV DEBIAN_FRONTEND=noninteractive
21+
1722
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1823

1924
# Copy only the build script and necessary files first for better layer caching
@@ -69,7 +74,7 @@ apt-get clean
6974
rm -rf /var/lib/apt/lists/*
7075
_DEPS
7176

72-
FROM sunshine-deps AS sunshine-build
77+
FROM --platform=$BUILDPLATFORM sunshine-deps-native AS sunshine-build
7378

7479
ARG BUILDPLATFORM
7580
ARG TARGETPLATFORM
@@ -147,7 +152,7 @@ fi
147152
${target_tuple:+--target-tuple=${target_tuple}}
148153
_BUILD
149154

150-
FROM sunshine-build AS sunshine-test
155+
FROM --platform=$TARGETPLATFORM sunshine-build AS sunshine-test
151156

152157
# This stage runs on the target architecture to avoid qemu overhead for tests
153158
ARG TARGETPLATFORM
@@ -162,7 +167,7 @@ Xvfb ${DISPLAY} -screen 0 1024x768x24 &
162167
./test_sunshine --gtest_color=yes
163168
_TEST
164169

165-
FROM sunshine-base AS sunshine
170+
FROM --platform=$TARGETPLATFORM sunshine-base AS sunshine
166171

167172
ARG BASE
168173
ARG TAG

docker/ubuntu-22.04.dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ FROM sunshine-base AS sunshine-deps
1414
ARG BUILDPLATFORM
1515
ARG TARGETPLATFORM
1616

17+
# Force this stage to run on the build platform for cross-compilation setup
18+
FROM --platform=$BUILDPLATFORM ubuntu:22.04 AS sunshine-deps-native
19+
20+
ENV DEBIAN_FRONTEND=noninteractive
21+
1722
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1823

1924
# Copy only the build script first for better layer caching
@@ -68,7 +73,7 @@ apt-get clean
6873
rm -rf /var/lib/apt/lists/*
6974
_DEPS
7075

71-
FROM sunshine-deps AS sunshine-build
76+
FROM --platform=$BUILDPLATFORM sunshine-deps-native AS sunshine-build
7277

7378
ARG BUILDPLATFORM
7479
ARG TARGETPLATFORM
@@ -146,7 +151,7 @@ fi
146151
${target_tuple:+--target-tuple=${target_tuple}}
147152
_BUILD
148153

149-
FROM sunshine-build AS sunshine-test
154+
FROM --platform=$TARGETPLATFORM sunshine-build AS sunshine-test
150155

151156
# This stage runs on the target architecture to avoid qemu overhead for tests
152157
ARG TARGETPLATFORM
@@ -161,7 +166,7 @@ Xvfb ${DISPLAY} -screen 0 1024x768x24 &
161166
./test_sunshine --gtest_color=yes
162167
_TEST
163168

164-
FROM sunshine-base AS sunshine
169+
FROM --platform=$TARGETPLATFORM sunshine-base AS sunshine
165170

166171
ARG BASE
167172
ARG TAG

docker/ubuntu-24.04.dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ FROM sunshine-base AS sunshine-deps
1414
ARG BUILDPLATFORM
1515
ARG TARGETPLATFORM
1616

17+
# Force this stage to run on the build platform for cross-compilation setup
18+
FROM --platform=$BUILDPLATFORM ubuntu:24.04 AS sunshine-deps-native
19+
20+
ENV DEBIAN_FRONTEND=noninteractive
21+
1722
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1823

1924
# Copy only the build script first for better layer caching
@@ -67,7 +72,7 @@ apt-get clean
6772
rm -rf /var/lib/apt/lists/*
6873
_DEPS
6974

70-
FROM sunshine-deps AS sunshine-build
75+
FROM --platform=$BUILDPLATFORM sunshine-deps-native AS sunshine-build
7176

7277
ARG BUILDPLATFORM
7378
ARG TARGETPLATFORM
@@ -145,7 +150,7 @@ fi
145150
${target_tuple:+--target-tuple=${target_tuple}}
146151
_BUILD
147152

148-
FROM sunshine-build AS sunshine-test
153+
FROM --platform=$TARGETPLATFORM sunshine-build AS sunshine-test
149154

150155
# This stage runs on the target architecture to avoid qemu overhead for tests
151156
ARG TARGETPLATFORM
@@ -160,7 +165,7 @@ Xvfb ${DISPLAY} -screen 0 1024x768x24 &
160165
./test_sunshine --gtest_color=yes
161166
_TEST
162167

163-
FROM sunshine-base AS sunshine
168+
FROM --platform=$TARGETPLATFORM sunshine-base AS sunshine
164169

165170
ARG BASE
166171
ARG TAG

0 commit comments

Comments
 (0)