From 4f1fcabfdc6a9e9cd39fc7ac5f70f0cc74f8297a Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Thu, 19 Mar 2026 00:33:37 +0100 Subject: [PATCH] use capability-based runner detection instead of RUNNER_ENVIRONMENT Third-party runner providers (Depot, Blacksmith, Namespace, BuildJet) mirror GitHub's official runner images but set `RUNNER_ENVIRONMENT=self-hosted`. The existing detection treats this as a bare self-hosted runner, routing PHP installation through the slower php-builder path (~>1min) instead of the fast pre-built php-ubuntu binaries (few seconds). Replace the `RUNNER_ENVIRONMENT` check with capability-based detection: if both `ImageOS` and `ImageVersion` are set (and not ACT/container), classify as github. This restores the pre-df8d1233 approach of trusting image markers over hosting metadata. Also replace the fail-fast guard with an informational log for third-party runner visibility. --- src/scripts/unix.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/scripts/unix.sh b/src/scripts/unix.sh index f0f45fea..f2259107 100644 --- a/src/scripts/unix.sh +++ b/src/scripts/unix.sh @@ -54,16 +54,17 @@ read_env() { [ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release [[ "${phpts:-${PHPTS:-nts}}" = "ts" || "${phpts:-${PHPTS:-nts}}" = "zts" ]] && ts=zts && update=true || ts=nts fail_fast="${fail_fast:-${FAIL_FAST:-false}}" - [[ ( -z "$ImageOS" && -z "$ImageVersion" ) || - ( -n "$RUNNER_ENVIRONMENT" && "$RUNNER_ENVIRONMENT" = "self-hosted" ) || - -n "$ACT" || -n "$CONTAINER" ]] && _runner=self-hosted || _runner=github + if [[ -n "$ImageOS" && -n "$ImageVersion" && -z "$ACT" && -z "$CONTAINER" ]]; then + _runner=github + else + _runner=self-hosted + fi runner="${runner:-${RUNNER:-$_runner}}" tool_path_dir="${setup_php_tools_dir:-${SETUP_PHP_TOOLS_DIR:-/usr/local/bin}}" tool_cache_path_dir="${setup_php_tool_cache_dir:-${SETUP_PHP_TOOL_CACHE_DIR:-${RUNNER_TOOL_CACHE:-/opt/hostedtoolcache}/setup-php/tools}}" - if [[ "$runner" = "github" && $_runner = "self-hosted" ]]; then - fail_fast=true - add_log "$cross" "Runner" "Runner set as github in self-hosted environment" + if [[ "$runner" = "github" && -n "$RUNNER_ENVIRONMENT" && "$RUNNER_ENVIRONMENT" = "self-hosted" ]]; then + add_log "$tick" "Runner" "GitHub-compatible image detected on third-party runner" fi # Set Update to true if the ubuntu github image does not have PHP PPA.