Skip to content

Commit 4334f8c

Browse files
committed
Configure CARGO_TARGET_DIR to be inside of DerivedData
1 parent 0fe6308 commit 4334f8c

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/actions/build-for-testing/action.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ runs:
2424
path: |
2525
Apple/PackageCache
2626
Apple/SourcePackages
27+
Apple/DerivedData
2728
key: ${{ runner.os }}-${{ inputs.scheme }}-${{ hashFiles('**/Package.resolved') }}
2829
restore-keys: |
2930
${{ runner.os }}-${{ inputs.scheme }}-
@@ -33,17 +34,18 @@ runs:
3334
run: |
3435
echo "${{ inputs.app-store-key }}" > AuthKey_${{ inputs.app-store-key-id }}.p8
3536
36-
xcodebuild clean build-for-testing \
37+
xcodebuild build-for-testing \
3738
-allowProvisioningUpdates \
3839
-allowProvisioningDeviceRegistration \
40+
-skipPackagePluginValidation \
41+
-skipMacroValidation \
42+
-onlyUsePackageVersionsFromResolvedFile \
3943
-authenticationKeyID ${{ inputs.app-store-key-id }} \
4044
-authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \
4145
-authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \
42-
-onlyUsePackageVersionsFromResolvedFile \
4346
-clonedSourcePackagesDirPath SourcePackages \
4447
-packageCachePath $PWD/PackageCache \
45-
-skipPackagePluginValidation \
46-
-skipMacroValidation \
48+
-derivedDataPath $PWD/DerivedData \
4749
-scheme '${{ inputs.scheme }}' \
4850
-destination '${{ inputs.destination }}' \
4951
-resultBundlePath BuildResults.xcresult

.github/actions/export/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ runs:
3737
-exportArchive \
3838
-allowProvisioningUpdates \
3939
-allowProvisioningDeviceRegistration \
40+
-skipPackagePluginValidation \
41+
-skipMacroValidation \
42+
-onlyUsePackageVersionsFromResolvedFile \
4043
-authenticationKeyID ${{ inputs.app-store-key-id }} \
4144
-authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \
4245
-authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \

Apple/NetworkExtension/libburrow/build-rust.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ CARGO_ARGS+=("--lib")
5656

5757
# Pass the configuration (Debug or Release) through to cargo
5858
if [[ $SWIFT_ACTIVE_COMPILATION_CONDITIONS == *DEBUG* ]]; then
59-
CARGO_DIR="debug"
59+
CARGO_TARGET_SUBDIR="debug"
6060
else
6161
CARGO_ARGS+=("--release")
62-
CARGO_DIR="release"
62+
CARGO_TARGET_SUBDIR="release"
6363
fi
6464

6565
if [[ -x "$(command -v rustup)" ]]; then
@@ -70,11 +70,11 @@ fi
7070

7171
# Run cargo without the various environment variables set by Xcode.
7272
# Those variables can confuse cargo and the build scripts it runs.
73-
env -i PATH="$CARGO_PATH" cargo build "${CARGO_ARGS[@]}"
73+
env -i PATH="$CARGO_PATH" CARGO_TARGET_DIR="${CONFIGURATION_TEMP_DIR}/target" cargo build "${CARGO_ARGS[@]}"
7474

7575
mkdir -p "${BUILT_PRODUCTS_DIR}"
7676

7777
# Use `lipo` to merge the architectures together into BUILT_PRODUCTS_DIR
7878
/usr/bin/xcrun --sdk $PLATFORM_NAME lipo \
79-
-create $(printf "${PROJECT_DIR}/../target/%q/${CARGO_DIR}/libburrow.a " "${RUST_TARGETS[@]}") \
79+
-create $(printf "${CONFIGURATION_TEMP_DIR}/target/%q/${CARGO_TARGET_SUBDIR}/libburrow.a " "${RUST_TARGETS[@]}") \
8080
-output "${BUILT_PRODUCTS_DIR}/libburrow.a"

0 commit comments

Comments
 (0)