Skip to content

Render TOOLS only if supported on host#80

Merged
markelliot merged 2 commits intobazel-contrib:mainfrom
hofbi:tools-label-platform-support
Jul 11, 2025
Merged

Render TOOLS only if supported on host#80
markelliot merged 2 commits intobazel-contrib:mainfrom
hofbi:tools-label-platform-support

Conversation

@hofbi
Copy link
Copy Markdown
Contributor

@hofbi hofbi commented Jun 4, 2025

Fixes #79

The TOOLS constant was added to be used with bazel_env.bzl. For this we should only add tools that are supported on the host platform.

@hofbi hofbi force-pushed the tools-label-platform-support branch from 3581823 to 66fec1d Compare June 12, 2025 16:17
@hofbi hofbi force-pushed the tools-label-platform-support branch from 66fec1d to c26b87e Compare June 12, 2025 16:19
@hofbi
Copy link
Copy Markdown
Contributor Author

hofbi commented Jun 12, 2025

Is it possible that the new platform version dropped WORKSPACE support

@fmeum
Copy link
Copy Markdown
Member

fmeum commented Jun 12, 2025

Is it possible that the new platform version dropped WORKSPACE support

It requires additional setup that isn't documented:

load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@platforms//host:extension.bzl", "host_platform_repo")

maybe(
	host_platform_repo,
	name = "host_platform",
)

The alternative is to load the constraints from @local_config_platform//:constraints.bzl, but that no longer works with Bazel@HEAD and the next rolling release.

@hofbi hofbi force-pushed the tools-label-platform-support branch 3 times, most recently from 237291b to e5111ed Compare June 13, 2025 17:30
@hofbi hofbi force-pushed the tools-label-platform-support branch from e5111ed to 597def2 Compare June 16, 2025 13:52
@hofbi
Copy link
Copy Markdown
Contributor Author

hofbi commented Jul 1, 2025

Ping @apalmer-theorem

@markelliot markelliot merged commit d6d5203 into bazel-contrib:main Jul 11, 2025
16 checks passed
@hofbi hofbi deleted the tools-label-platform-support branch July 11, 2025 17:33
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.

TOOLS constant should only list tools available for that platform

3 participants