[libcxx-commits] [libcxx] [libcxx] Default BUILDKITE_PULL_REQUEST_BASE_BRANCH to main when unset (PR #179252)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 2 07:14:53 PST 2026


https://github.com/dive2tech created https://github.com/llvm/llvm-project/pull/179252

The libcxx Buildkite trigger step fails when `BUILDKITE_PULL_REQUEST_BASE_BRANCH` is unset (e.g. for cross-fork PRs), because `git diff origin/...HEAD` is an invalid revision.

Default to `main` when the variable is unset so the script can determine modified files and exit cleanly with "No Buildkite jobs to trigger" when only non-libcxx paths are changed.

This fixes Buildkite CI failures for PRs from forks where the base branch env is not set.

>From cf99620136f01477b7fd206336db608a6b6a77a5 Mon Sep 17 00:00:00 2001
From: Gittensor Miner <miner at gittensor.io>
Date: Mon, 2 Feb 2026 17:14:24 +0200
Subject: [PATCH] [libcxx] Default BUILDKITE_PULL_REQUEST_BASE_BRANCH to main
 when unset

The libcxx Buildkite trigger fails when BUILDKITE_PULL_REQUEST_BASE_BRANCH
is unset (e.g. cross-fork PRs), as 'git diff origin/...HEAD' is invalid.
Default to 'main' so the script can determine modified files and exit
cleanly when only non-libcxx paths are changed.
---
 libcxx/utils/ci/buildkite-pipeline-trigger.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcxx/utils/ci/buildkite-pipeline-trigger.sh b/libcxx/utils/ci/buildkite-pipeline-trigger.sh
index 4661cd54fad42..47128a80b4338 100755
--- a/libcxx/utils/ci/buildkite-pipeline-trigger.sh
+++ b/libcxx/utils/ci/buildkite-pipeline-trigger.sh
@@ -12,8 +12,8 @@
 # LLVM monorepo, and we make it a no-op unless the libc++ pipeline needs to be triggered.
 #
 
-# Set by buildkite
-: ${BUILDKITE_PULL_REQUEST_BASE_BRANCH:=}
+# Set by buildkite (may be unset for cross-fork PRs)
+: ${BUILDKITE_PULL_REQUEST_BASE_BRANCH:=main}
 
 # Fetch origin to have an up to date merge base for the diff.
 git fetch origin



More information about the libcxx-commits mailing list