fix(ci): install x86_64 glibc cross libraries for qemu user emulation
This commit is contained in:
@@ -34,13 +34,15 @@ jobs:
|
||||
# We install qemu-user-static and generate thin wrappers to run the linux-x64 gen_snapshot seamlessly.
|
||||
if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
|
||||
echo "Setting up ARM64 Flutter gen_snapshot wrappers via QEMU..."
|
||||
apt-get update -qq && apt-get install -y -qq qemu-user-static
|
||||
apt-get update -qq && apt-get install -y -qq qemu-user-static libc6-amd64-cross libstdc++6-amd64-cross
|
||||
mkdir -p /lib64
|
||||
ln -sf /usr/x86_64-linux-gnu/lib/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
|
||||
QEMU_BIN=$(command -v qemu-x86_64-static || command -v qemu-x86_64)
|
||||
flutter precache --android
|
||||
for dir in /sdks/flutter/bin/cache/artifacts/engine/android-*; do
|
||||
if [ -d "$dir/linux-x64" ]; then
|
||||
mkdir -p "$dir/linux-arm64"
|
||||
printf '#!/bin/sh\nSCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"\nexec %s "$SCRIPT_DIR/../linux-x64/gen_snapshot" "$@"\n' "$QEMU_BIN" > "$dir/linux-arm64/gen_snapshot"
|
||||
printf '#!/bin/sh\nSCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"\nexec %s -L /usr/x86_64-linux-gnu "$SCRIPT_DIR/../linux-x64/gen_snapshot" "$@"\n' "$QEMU_BIN" > "$dir/linux-arm64/gen_snapshot"
|
||||
chmod +x "$dir/linux-arm64/gen_snapshot"
|
||||
echo "Configured gen_snapshot wrapper for $(basename "$dir")"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user