Files
DroidDeck/tools/rockstar-launcher/build-container.sh
T
Kurt Himebauch b2687701c1 build: run the local macOS build natively, with no emulation (#2999)
build: make the local macOS build run natively, with no emulation

On an arm64 Mac the x86/i386 session preloads were built in a linux/amd64
container under emulation, and the Rockstar launcher failed to link against
Homebrew's SJLJ i686 mingw. Both now build on the host's own architecture.

- build_local.sh: on arm64 build the x86 preloads in a native arm64 Debian
  bullseye container with the x86_64/i686 cross toolchains (glibc 2.31, as
  before); x86 hosts keep the native gcc-multilib path.
- build-x86-preloads.sh: X86_CROSS=1 selects the cross toolchains.
- rockstar-launcher/build-container.sh: build the launcher in a native
  Ubuntu container with a DWARF2 mingw, used on macOS only.
- vr/build.sh: stop aborting silently when ANDROID_NDK_HOME names an NDK
  that is not installed.
- build_local.sh: expand the empty stores_check array safely on bash 3.2 so
  the script reaches its signing step.
2026-11-21 22:51:27 -05:00

29 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Builds the Rockstar launcher in a container, on the host's own architecture. Rust's
# i686-pc-windows-gnu target needs a DWARF2 mingw; Homebrew's i686 mingw uses SJLJ and fails to link.
set -euo pipefail
here=$(cd "$(dirname "$0")" && pwd)
repo=$(cd "$here/../.." && pwd)
out=${1:?usage: build-container.sh <output directory>}
. "$repo/tools/docker_platform.sh"
cache=${DROIDDECK_BUILD_CACHE:-$HOME/.cache/droiddeck-build}/rockstar-container
mkdir -p "$out" "$cache/cargo" "$cache/target"
out=$(cd "$out" && pwd)
image=droiddeck-rockstar-build:v2-${docker_platform#linux/}
if ! docker image inspect "$image" >/dev/null 2>&1; then
docker build --platform "$docker_platform" -t "$image" - <<'EOF'
FROM public.ecr.aws/docker/library/ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive RUSTUP_HOME=/opt/rustup CARGO_HOME=/opt/cargo PATH=/opt/cargo/bin:$PATH
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends ca-certificates curl gcc libc6-dev \
gcc-mingw-w64-i686-posix gcc-mingw-w64-x86-64-posix >/dev/null
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal --default-toolchain stable \
-t i686-pc-windows-gnu -t x86_64-pc-windows-gnu && chmod -R a+rX /opt/rustup /opt/cargo
EOF
fi
docker run --rm --platform "$docker_platform" --user "$(id -u):$(id -g)" \
-e CARGO_HOME=/cache/cargo -e CARGO_TARGET_DIR=/cache/target -e HOME=/tmp \
-v "$repo:/src" -v "$out:/out" -v "$cache:/cache" -w /src "$image" \
bash tools/rockstar-launcher/build.sh /out