diff --git a/.forgejo/workflows/build-apple.yml b/.forgejo/workflows/build-apple.yml index 460b6b8..7fce5ca 100644 --- a/.forgejo/workflows/build-apple.yml +++ b/.forgejo/workflows/build-apple.yml @@ -33,6 +33,7 @@ jobs: CARGO_INCREMENTAL: 0 RUST_BACKTRACE: short RUSTC_WRAPPER: sccache + SCCACHE_CACHE_SIZE: 20G steps: - name: Checkout uses: https://code.forgejo.org/actions/checkout@v4 @@ -82,6 +83,12 @@ jobs: "${cache_root}/apple/PackageCache" \ "${cache_root}/apple/SourcePackages" \ "${cache_root}/apple/DerivedData/${{ matrix.cache-id }}" + rm -rf \ + "${cache_root}/cargo-target/${{ matrix.cache-id }}" \ + "${cache_root}/apple/DerivedData/${{ matrix.cache-id }}" + mkdir -p \ + "${cache_root}/cargo-target/${{ matrix.cache-id }}" \ + "${cache_root}/apple/DerivedData/${{ matrix.cache-id }}" echo "CARGO_HOME=${cache_root}/cargo" >> "${GITHUB_ENV}" echo "CARGO_TARGET_DIR=${cache_root}/cargo-target/${{ matrix.cache-id }}" >> "${GITHUB_ENV}" echo "RUSTUP_HOME=${cache_root}/rustup" >> "${GITHUB_ENV}" @@ -90,6 +97,7 @@ jobs: echo "APPLE_PACKAGE_CACHE=${cache_root}/apple/PackageCache" >> "${GITHUB_ENV}" echo "APPLE_SOURCE_PACKAGES=${cache_root}/apple/SourcePackages" >> "${GITHUB_ENV}" echo "APPLE_DERIVED_DATA=${cache_root}/apple/DerivedData/${{ matrix.cache-id }}" >> "${GITHUB_ENV}" + df -h "${cache_root}" || true - name: Install Rust shell: bash diff --git a/Apple/NetworkExtension/libburrow/build-rust.sh b/Apple/NetworkExtension/libburrow/build-rust.sh index d54bd71..d3886fe 100755 --- a/Apple/NetworkExtension/libburrow/build-rust.sh +++ b/Apple/NetworkExtension/libburrow/build-rust.sh @@ -79,6 +79,14 @@ if [[ -n "${RUSTC_WRAPPER:-}" && "${RUSTC_WRAPPER}" != /* ]]; then fi fi +if [[ -x "$(command -v rustup)" ]]; then + for TARGET in "${RUST_TARGETS[@]}"; do + if ! rustup target list --installed | grep -qx "${TARGET}"; then + rustup target add "${TARGET}" + fi + done +fi + # Run cargo without the various environment variables set by Xcode. # Those variables can confuse cargo and the build scripts it runs. EXTRA_ENV=()