Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ci): give sccache a minute to start against a slow cache backend (#9784)

teod7ec094f9e2e
diff --git a/.github/workflows/build_agent_daemon_on_tag.yml b/.github/workflows/build_agent_daemon_on_tag.yml
index acaa181cb6..eaeb19f3b4 100644
--- a/.github/workflows/build_agent_daemon_on_tag.yml
+++ b/.github/workflows/build_agent_daemon_on_tag.yml
@@ -119,6 +119,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
@@ -348,6 +353,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
diff --git a/.github/workflows/build_web_app.yml b/.github/workflows/build_web_app.yml
index da872b49f2..40b74b56d1 100644
--- a/.github/workflows/build_web_app.yml
+++ b/.github/workflows/build_web_app.yml
@@ -60,6 +60,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
diff --git a/.github/workflows/cargo_workspace_dependency_check.yml b/.github/workflows/cargo_workspace_dependency_check.yml
index aac7b46ad3..aeb3b23312 100644
--- a/.github/workflows/cargo_workspace_dependency_check.yml
+++ b/.github/workflows/cargo_workspace_dependency_check.yml
@@ -60,6 +60,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
@@ -116,6 +121,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
diff --git a/.github/workflows/code_check_cloud_storage.yml b/.github/workflows/code_check_cloud_storage.yml
index 6d111a71c4..86bf02c7c8 100644
--- a/.github/workflows/code_check_cloud_storage.yml
+++ b/.github/workflows/code_check_cloud_storage.yml
@@ -286,6 +286,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
@@ -455,6 +460,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
@@ -590,6 +600,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
diff --git a/.github/workflows/deploy_preview.yml b/.github/workflows/deploy_preview.yml
index c3a0a691ca..9e302925c0 100644
--- a/.github/workflows/deploy_preview.yml
+++ b/.github/workflows/deploy_preview.yml
@@ -72,6 +72,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
diff --git a/.github/workflows/test_macrod_update.yml b/.github/workflows/test_macrod_update.yml
index 47fa0dc079..cf13366b5e 100644
--- a/.github/workflows/test_macrod_update.yml
+++ b/.github/workflows/test_macrod_update.yml
@@ -60,6 +60,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
diff --git a/.github/workflows/web-app-check-main.yml b/.github/workflows/web-app-check-main.yml
index 41ce717388..97627bacd7 100644
--- a/.github/workflows/web-app-check-main.yml
+++ b/.github/workflows/web-app-check-main.yml
@@ -374,6 +374,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
@@ -596,6 +601,11 @@ jobs:
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs
index 419cc064ea..aaef0ebd9f 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/steps.rs
@@ -326,6 +326,11 @@ if nsc cache sccache setup --cache_name {cache_name} > "$env_file"; then
esac
done < "$env_file"
cat "$env_file" >> "$GITHUB_ENV"
+ # The server checks the WebDAV backend before it reports ready, and the
+ # client's default 10s wait can run out. This limit has no env var.
+ sccache_conf="$RUNNER_TEMP/sccache.toml"
+ echo 'server_startup_timeout_ms = 60000' > "$sccache_conf"
+ echo "SCCACHE_CONF=$sccache_conf" >> "$GITHUB_ENV"
# Force the next compiler invocation to start a server with the new remote
# backend even if a setup hook happened to launch one already.
sccache --stop-server >/dev/null 2>&1 || true
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/steps/test.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/steps/test.rs
index 358b2c690b..428a68a537 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/steps/test.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/steps/test.rs
@@ -70,3 +70,23 @@ fn web_build_cache_volume_includes_wasm_pack_and_cargo() {
Some("nix")
);
}
+
+#[test]
+fn namespace_sccache_allows_a_slow_backend_check_at_startup() {
+ let run = configure_namespace_sccache("test-cache")
+ .value
+ .run
+ .expect("Namespace sccache setup should be a run step");
+
+ let write = run
+ .find("echo 'server_startup_timeout_ms = 60000' > \"$sccache_conf\"")
+ .expect("the startup limit should be written to a config file");
+ let export = run
+ .find("echo \"SCCACHE_CONF=$sccache_conf\" >> \"$GITHUB_ENV\"")
+ .expect("later steps should read the config file");
+ let stop = run
+ .find("sccache --stop-server")
+ .expect("the server should restart with the new backend");
+
+ assert!(write < export && export < stop);
+}