chore: sync workspace changes

This commit is contained in:
Nathan Flurry 2026-01-25 01:57:16 -08:00
parent 30d3aca1ee
commit f92ecd9b9a
38 changed files with 4829 additions and 1219 deletions

54
docker/release/build.sh Executable file
View file

@ -0,0 +1,54 @@
#!/bin/bash
set -euo pipefail
TARGET=${1:-x86_64-unknown-linux-musl}
case $TARGET in
x86_64-unknown-linux-musl)
echo "Building for Linux x86_64 musl"
DOCKERFILE="linux-x86_64.Dockerfile"
TARGET_STAGE="builder"
BINARY="sandbox-daemon-$TARGET"
;;
x86_64-pc-windows-gnu)
echo "Building for Windows x86_64"
DOCKERFILE="windows.Dockerfile"
TARGET_STAGE=""
BINARY="sandbox-daemon-$TARGET.exe"
;;
x86_64-apple-darwin)
echo "Building for macOS x86_64"
DOCKERFILE="macos-x86_64.Dockerfile"
TARGET_STAGE="x86_64-builder"
BINARY="sandbox-daemon-$TARGET"
;;
aarch64-apple-darwin)
echo "Building for macOS aarch64"
DOCKERFILE="macos-aarch64.Dockerfile"
TARGET_STAGE="aarch64-builder"
BINARY="sandbox-daemon-$TARGET"
;;
*)
echo "Unsupported target: $TARGET"
exit 1
;;
esac
DOCKER_BUILDKIT=1
if [ -n "$TARGET_STAGE" ]; then
docker build --target "$TARGET_STAGE" -f "docker/release/$DOCKERFILE" -t "sandbox-daemon-builder-$TARGET" .
else
docker build -f "docker/release/$DOCKERFILE" -t "sandbox-daemon-builder-$TARGET" .
fi
CONTAINER_ID=$(docker create "sandbox-daemon-builder-$TARGET")
mkdir -p dist
docker cp "$CONTAINER_ID:/artifacts/$BINARY" "dist/"
docker rm "$CONTAINER_ID"
if [[ "$BINARY" != *.exe ]]; then
chmod +x "dist/$BINARY"
fi
echo "Binary saved to: dist/$BINARY"

View file

@ -0,0 +1,27 @@
# syntax=docker/dockerfile:1.10.0
FROM rust:1.91.0 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y \
musl-tools \
pkg-config \
ca-certificates \
git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN rustup target add x86_64-unknown-linux-musl
WORKDIR /build
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/build/target \
RUSTFLAGS="-C target-feature=+crt-static" \
cargo build -p sandbox-daemon-core --release --target x86_64-unknown-linux-musl && \
mkdir -p /artifacts && \
cp target/x86_64-unknown-linux-musl/release/sandbox-daemon /artifacts/sandbox-daemon-x86_64-unknown-linux-musl
CMD ["ls", "-la", "/artifacts"]

View file

@ -0,0 +1,62 @@
# syntax=docker/dockerfile:1.10.0
FROM rust:1.91.0 AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
clang \
cmake \
patch \
libxml2-dev \
wget \
xz-utils \
curl \
git && \
rm -rf /var/lib/apt/lists/*
# Install osxcross
RUN git config --global --add safe.directory '*' && \
git clone https://github.com/tpoechtrager/osxcross /root/osxcross && \
cd /root/osxcross && \
wget -nc https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz && \
mv MacOSX11.3.sdk.tar.xz tarballs/ && \
UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh
ENV PATH="/root/osxcross/target/bin:$PATH"
ENV OSXCROSS_SDK=MacOSX11.3.sdk \
SDKROOT=/root/osxcross/target/SDK/MacOSX11.3.sdk \
BINDGEN_EXTRA_CLANG_ARGS_aarch64_apple_darwin="--sysroot=/root/osxcross/target/SDK/MacOSX11.3.sdk -isystem /root/osxcross/target/SDK/MacOSX11.3.sdk/usr/include" \
CFLAGS_aarch64_apple_darwin="-B/root/osxcross/target/bin" \
CXXFLAGS_aarch64_apple_darwin="-B/root/osxcross/target/bin" \
CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=aarch64-apple-darwin20.4-clang \
CC_aarch64_apple_darwin=aarch64-apple-darwin20.4-clang \
CXX_aarch64_apple_darwin=aarch64-apple-darwin20.4-clang++ \
AR_aarch64_apple_darwin=aarch64-apple-darwin20.4-ar \
RANLIB_aarch64_apple_darwin=aarch64-apple-darwin20.4-ranlib \
MACOSX_DEPLOYMENT_TARGET=10.14 \
CARGO_INCREMENTAL=0 \
CARGO_NET_GIT_FETCH_WITH_CLI=true
WORKDIR /build
FROM base AS aarch64-builder
RUN rustup target add aarch64-apple-darwin
RUN mkdir -p /root/.cargo && \
echo '\
[target.aarch64-apple-darwin]\n\
linker = "aarch64-apple-darwin20.4-clang"\n\
ar = "aarch64-apple-darwin20.4-ar"\n\
' > /root/.cargo/config.toml
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/build/target \
cargo build -p sandbox-daemon-core --release --target aarch64-apple-darwin && \
mkdir -p /artifacts && \
cp target/aarch64-apple-darwin/release/sandbox-daemon /artifacts/sandbox-daemon-aarch64-apple-darwin
CMD ["ls", "-la", "/artifacts"]

View file

@ -0,0 +1,62 @@
# syntax=docker/dockerfile:1.10.0
FROM rust:1.91.0 AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
clang \
cmake \
patch \
libxml2-dev \
wget \
xz-utils \
curl \
git && \
rm -rf /var/lib/apt/lists/*
# Install osxcross
RUN git config --global --add safe.directory '*' && \
git clone https://github.com/tpoechtrager/osxcross /root/osxcross && \
cd /root/osxcross && \
wget -nc https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz && \
mv MacOSX11.3.sdk.tar.xz tarballs/ && \
UNATTENDED=yes OSX_VERSION_MIN=10.7 ./build.sh
ENV PATH="/root/osxcross/target/bin:$PATH"
ENV OSXCROSS_SDK=MacOSX11.3.sdk \
SDKROOT=/root/osxcross/target/SDK/MacOSX11.3.sdk \
BINDGEN_EXTRA_CLANG_ARGS_X86_64_apple_darwin="--sysroot=/root/osxcross/target/SDK/MacOSX11.3.sdk -isystem /root/osxcross/target/SDK/MacOSX11.3.sdk/usr/include" \
CFLAGS_X86_64_apple_darwin="-B/root/osxcross/target/bin" \
CXXFLAGS_X86_64_apple_darwin="-B/root/osxcross/target/bin" \
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=x86_64-apple-darwin20.4-clang \
CC_x86_64_apple_darwin=x86_64-apple-darwin20.4-clang \
CXX_x86_64_apple_darwin=x86_64-apple-darwin20.4-clang++ \
AR_X86_64_apple_darwin=x86_64-apple-darwin20.4-ar \
RANLIB_X86_64_apple_darwin=x86_64-apple-darwin20.4-ranlib \
MACOSX_DEPLOYMENT_TARGET=10.14 \
CARGO_INCREMENTAL=0 \
CARGO_NET_GIT_FETCH_WITH_CLI=true
WORKDIR /build
FROM base AS x86_64-builder
RUN rustup target add x86_64-apple-darwin
RUN mkdir -p /root/.cargo && \
echo '\
[target.x86_64-apple-darwin]\n\
linker = "x86_64-apple-darwin20.4-clang"\n\
ar = "x86_64-apple-darwin20.4-ar"\n\
' > /root/.cargo/config.toml
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/build/target \
cargo build -p sandbox-daemon-core --release --target x86_64-apple-darwin && \
mkdir -p /artifacts && \
cp target/x86_64-apple-darwin/release/sandbox-daemon /artifacts/sandbox-daemon-x86_64-apple-darwin
CMD ["ls", "-la", "/artifacts"]

View file

@ -0,0 +1,49 @@
# syntax=docker/dockerfile:1.10.0
FROM rust:1.91.0
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
llvm-14-dev \
libclang-14-dev \
clang-14 \
gcc-mingw-w64-x86-64 \
g++-mingw-w64-x86-64 \
binutils-mingw-w64-x86-64 \
ca-certificates \
curl \
git && \
rm -rf /var/lib/apt/lists/*
# Switch MinGW-w64 to the POSIX threading model toolchain
RUN update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix && \
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
RUN rustup target add x86_64-pc-windows-gnu
RUN mkdir -p /root/.cargo && \
echo '\
[target.x86_64-pc-windows-gnu]\n\
linker = "x86_64-w64-mingw32-gcc"\n\
' > /root/.cargo/config.toml
ENV CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc \
CC_x86_64_pc_windows_gnu=x86_64-w64-mingw32-gcc \
CXX_x86_64_pc_windows_gnu=x86_64-w64-mingw32-g++ \
CC_x86_64-pc-windows-gnu=x86_64-w64-mingw32-gcc \
CXX_x86_64-pc-windows-gnu=x86_64-w64-mingw32-g++ \
LIBCLANG_PATH=/usr/lib/llvm-14/lib \
CLANG_PATH=/usr/bin/clang-14 \
CARGO_INCREMENTAL=0 \
CARGO_NET_GIT_FETCH_WITH_CLI=true
WORKDIR /build
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/build/target \
cargo build -p sandbox-daemon-core --release --target x86_64-pc-windows-gnu && \
mkdir -p /artifacts && \
cp target/x86_64-pc-windows-gnu/release/sandbox-daemon.exe /artifacts/sandbox-daemon-x86_64-pc-windows-gnu.exe
CMD ["ls", "-la", "/artifacts"]