Skip to content

Derive toolchain include paths from repo labels, not hardcoded external/ strings - #22

Merged
aredman-agtonomy merged 1 commit into
masterfrom
andrew-fix-canonical-repo-paths
Sep 9, 2026
Merged

aredman-agtonomy merged 1 commit into
masterfrom
andrew-fix-canonical-repo-paths

Conversation

@aredman-agtonomy

@aredman-agtonomy aredman-agtonomy commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

cc_linux_gnu_config formatted -isystem paths as "external/{gcc_repo}/{path}"
using plain string attrs. This only works because Bazel's WORKSPACE mode
happens to name external repo directories after their apparent name; under
bzlmod, module-extension-generated repos get canonical names (e.g. with a
"+" separator) that don't match, breaking formatted include paths.

Switch gcc_repo/linux-libc references to label attrs (sysroot, libc_headers)
and derive the on-disk path from label.workspace_root, which Bazel keeps
correct regardless of repo naming scheme or layout. This is compatible
with WORKSPACE and MODULE.bazel.

Tested x86_64 and cross compile on haystack, both succeed.

…al/ strings

cc_linux_gnu_config formatted -isystem paths as "external/{gcc_repo}/{path}"
using plain string attrs. This only works because Bazel's WORKSPACE mode
happens to name external repo directories after their apparent name; under
bzlmod, module-extension-generated repos get canonical names (e.g. with a
"+" separator) that don't match, breaking formatted include paths.

Switch gcc_repo/linux-libc references to label attrs (sysroot, libc_headers)
and derive the on-disk path from label.workspace_root, which Bazel keeps
correct regardless of repo naming scheme or layout. This is compatible
with WORKSPACE and MODULE.bazel.
@aredman-agtonomy
aredman-agtonomy marked this pull request as ready for review September 9, 2026 16:03

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a ci/test for bazel 8/9?

@aredman-agtonomy
aredman-agtonomy merged commit e939420 into master Sep 9, 2026
4 checks passed
@aredman-agtonomy
aredman-agtonomy deleted the andrew-fix-canonical-repo-paths branch November 11, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants