Skip to content

Commit f5894d1

Browse files
committed
tools: create print_defined_toolchains.sh utility script
- Added shell script under tools/private/toolchains to query all toolchain rules inside the Bzlmod pythons_hub repository. - Enabled executable permission on the script. - Updated bazel query to filter specifically for '//python:toolchain_type' attribute, excluding CC and Exec Tools toolchains.
1 parent 0ffa5d8 commit f5894d1

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Programmatically probe which repository target name is resolved successfully inside this workspace
5+
if bazel query @pythons_hub//... >/dev/null 2>&1; then
6+
HUB_REPO="@pythons_hub"
7+
elif bazel query @@rules_python++python+pythons_hub//... >/dev/null 2>&1; then
8+
HUB_REPO="@@rules_python++python+pythons_hub"
9+
else
10+
HUB_REPO="@@+python+pythons_hub"
11+
fi
12+
13+
# Query standard toolchains inside the resolved hub repository, excluding CC and Exec Tools toolchains.
14+
bazel query "kind('toolchain', ${HUB_REPO}//...) - filter('_py_cc_toolchain$', ${HUB_REPO}//...) - filter('_py_exec_tools_toolchain$', ${HUB_REPO}//...)" "$@"

0 commit comments

Comments
 (0)