Skip to content

[libc++] Re-add a script to trigger the libc++ Buildkite pipeline #146730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2025

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Jul 2, 2025

This was removed in 99cdc26 when the LLVM monorepo Buildkite setup was removed. Libc++ previously relied on the LLVM monorepo pipeline to trigger its own pipeline when needed. Since there is no LLVM monorepo pipeline anymore, we must trigger the libc++ Buildkite pipeline on every pull request and use this script to determine which jobs to actually start based on the files that are touched by the PR.

This was removed in 99cdc26 when the LLVM monorepo Buildkite setup
was removed. Libc++ previously relied on the LLVM monorepo pipeline to
trigger its own pipeline when needed. Since there is no LLVM monorepo
pipeline anymore, we must trigger the libc++ Buildkite pipeline on every
pull request and use this script to determine which jobs to actually
start based on the files that are touched by the PR.
@ldionne ldionne requested a review from a team as a code owner July 2, 2025 15:42
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jul 2, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 2, 2025

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

This was removed in 99cdc26 when the LLVM monorepo Buildkite setup was removed. Libc++ previously relied on the LLVM monorepo pipeline to trigger its own pipeline when needed. Since there is no LLVM monorepo pipeline anymore, we must trigger the libc++ Buildkite pipeline on every pull request and use this script to determine which jobs to actually start based on the files that are touched by the PR.


Full diff: https://github.com/llvm/llvm-project/pull/146730.diff

1 Files Affected:

  • (added) libcxx/utils/ci/buildkite-pipeline-trigger.sh (+34)
diff --git a/libcxx/utils/ci/buildkite-pipeline-trigger.sh b/libcxx/utils/ci/buildkite-pipeline-trigger.sh
new file mode 100755
index 0000000000000..4661cd54fad42
--- /dev/null
+++ b/libcxx/utils/ci/buildkite-pipeline-trigger.sh
@@ -0,0 +1,34 @@
+# ===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+# ===----------------------------------------------------------------------===##
+
+#
+# This script determines whether the libc++ Buildkite pipeline should be triggered
+# on a change. This is required because Buildkite gets notified for every PR in the
+# 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:=}
+
+# Fetch origin to have an up to date merge base for the diff.
+git fetch origin
+# List of files affected by this commit
+: ${MODIFIED_FILES:=$(git diff --name-only origin/${BUILDKITE_PULL_REQUEST_BASE_BRANCH}...HEAD)}
+
+echo "Files modified:" >&2
+echo "$MODIFIED_FILES" >&2
+modified_dirs=$(echo "$MODIFIED_FILES" | cut -d'/' -f1 | sort -u)
+echo "Directories modified:" >&2
+echo "$modified_dirs" >&2
+
+# If libc++ or one of the runtimes directories changed, trigger the libc++ Buildkite pipeline.
+if echo "$modified_dirs" | grep -q -E "^(libcxx|libcxxabi|libunwind|runtimes|cmake)$"; then
+    buildkite-agent pipeline upload libcxx/utils/ci/buildkite-pipeline.yml
+else
+    echo "No Buildkite jobs to trigger"
+fi

@ldionne ldionne merged commit 05ebb36 into llvm:main Jul 2, 2025
16 of 18 checks passed
@ldionne ldionne deleted the review/add-buildkite-trigger-script branch July 2, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants