Skip to content

Commit ccacd7d

Browse files
authored
chore: disable remote Tuist caching (#239)
1 parent f8972db commit ccacd7d

8 files changed

Lines changed: 19 additions & 57 deletions

File tree

.github/workflows/compatibility_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
install: false
4343
cache: false
44-
- name: Set up Tuist cache
44+
- name: Set up Tuist
4545
run: |
4646
source Scripts/Tuist/common.sh
4747
tuist_ci_setup

.github/workflows/compute.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
with:
8989
install: false
9090
cache: false
91-
- name: Set up Tuist cache
91+
- name: Set up Tuist
9292
run: |
9393
source Scripts/Tuist/common.sh
9494
tuist_ci_setup

.github/workflows/ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
install: false
4545
cache: false
46-
- name: Set up Tuist cache
46+
- name: Set up Tuist
4747
run: |
4848
source Scripts/Tuist/common.sh
4949
tuist_ci_setup

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
install: false
3232
cache: false
33-
- name: Set up Tuist cache
33+
- name: Set up Tuist
3434
run: |
3535
source Scripts/Tuist/common.sh
3636
tuist_ci_setup

.github/workflows/xcframework.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
with:
3636
install: false
3737
cache: false
38-
- name: Set up Tuist cache
38+
- name: Set up Tuist
3939
run: |
4040
source Scripts/Tuist/common.sh
4141
tuist_ci_setup

Example/Tuist.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import ProjectDescription
22

3+
// Keep remote caches disabled to reduce metered network traffic.
34
let tuist = Tuist(
45
fullHandle: "OpenSwiftUIProject/openattributegraph",
56
xcodeCache: .xcodeCache(
6-
upload: Environment.isCI
7+
upload: false
78
),
89
project: .tuist(
910
generationOptions: .options(
1011
optionalAuthentication: true,
11-
enableCaching: Environment.isCI,
12+
enableCaching: false,
1213
manifestEnvironment: [
1314
"OPENSWIFTUI_*",
1415
"OPENATTRIBUTEGRAPH_*",
1516
]
16-
)
17+
),
18+
cacheOptions: .options(storages: [.local])
1719
)
1820
)

Scripts/Tuist/common.sh

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,6 @@ TUIST_REPOSITORY_ROOT="$(
44
cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null 2>&1
55
pwd -P
66
)"
7-
TUIST_CACHE_SOCKET_PATH="${TUIST_CACHE_SOCKET_PATH:-${XDG_STATE_HOME:-$HOME/.local/state}/tuist/OpenSwiftUIProject_openattributegraph.sock}"
8-
9-
tuist_cache_service_is_ready() {
10-
[[ -S "$TUIST_CACHE_SOCKET_PATH" ]] || return 1
11-
12-
if command -v lsof >/dev/null 2>&1; then
13-
lsof "$TUIST_CACHE_SOCKET_PATH" >/dev/null 2>&1
14-
fi
15-
}
16-
17-
tuist_wait_for_cache_service() {
18-
local attempt
19-
for ((attempt = 0; attempt < 40; attempt++)); do
20-
if tuist_cache_service_is_ready; then
21-
return 0
22-
fi
23-
sleep 0.25
24-
done
25-
26-
echo "Tuist cache service is not listening at $TUIST_CACHE_SOCKET_PATH." >&2
27-
echo "If Tuist reported a different socket, set TUIST_CACHE_SOCKET_PATH to that path." >&2
28-
return 69
29-
}
307

318
tuist_ci_setup() (
329
set -e
@@ -35,8 +12,6 @@ tuist_ci_setup() (
3512
mise trust mise.toml
3613
mise install
3714
mise exec -- tuist auth login
38-
mise exec -- tuist setup cache --path "$TUIST_REPOSITORY_ROOT"
39-
tuist_wait_for_cache_service
4015
)
4116

4217
tuist_xcodebuild() (
@@ -60,29 +35,12 @@ tuist_xcodebuild() (
6035
result_bundle_path="$PWD/$result_bundle_path"
6136
fi
6237

63-
local cache_settings=()
64-
if tuist_cache_service_is_ready; then
65-
cache_settings=(
66-
COMPILATION_CACHE_ENABLE_CACHING=YES
67-
"COMPILATION_CACHE_REMOTE_SERVICE_PATH=$TUIST_CACHE_SOCKET_PATH"
68-
COMPILATION_CACHE_ENABLE_PLUGIN=YES
69-
COMPILATION_CACHE_ENABLE_DIAGNOSTIC_REMARKS=YES
70-
)
71-
elif [[ -n "${CI:-}" ]]; then
72-
echo "Tuist cache service is unavailable at $TUIST_CACHE_SOCKET_PATH." >&2
73-
return 69
74-
else
75-
echo "Tuist cache service is unavailable; building without compilation caching." >&2
76-
echo "Run 'mise exec -- tuist setup cache' to enable it locally." >&2
77-
cache_settings=(
78-
COMPILATION_CACHE_ENABLE_CACHING=NO
79-
COMPILATION_CACHE_ENABLE_PLUGIN=NO
80-
)
81-
fi
82-
8338
rm -rf "$result_bundle_path"
39+
# Override remote cache settings from existing generated projects.
8440
mise exec -- tuist xcodebuild "$action" \
8541
-resultBundlePath "$result_bundle_path" \
8642
"$@" \
87-
"${cache_settings[@]}"
43+
COMPILATION_CACHE_ENABLE_CACHING=NO \
44+
COMPILATION_CACHE_REMOTE_SERVICE_PATH= \
45+
COMPILATION_CACHE_ENABLE_PLUGIN=NO
8846
)

Tuist.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import ProjectDescription
22

3+
// Keep remote caches disabled to reduce metered network traffic.
34
let tuist = Tuist(
45
fullHandle: "OpenSwiftUIProject/openattributegraph",
56
xcodeCache: .xcodeCache(
6-
upload: Environment.isCI
7+
upload: false
78
),
89
project: .tuist(
910
generationOptions: .options(
1011
optionalAuthentication: true,
11-
enableCaching: Environment.isCI,
12+
enableCaching: false,
1213
manifestEnvironment: [
1314
"OPENSWIFTUI_*",
1415
"OPENATTRIBUTEGRAPH_*",
1516
]
16-
)
17+
),
18+
cacheOptions: .options(storages: [.local])
1719
)
1820
)

0 commit comments

Comments
 (0)