Skip to content

go_compat_repo: alias constraint values and settings to bazel_tools or platforms#2275

Merged
jayconrod merged 1 commit intobazel-contrib:masterfrom
jayconrod:migrate-platforms
Nov 7, 2019
Merged

go_compat_repo: alias constraint values and settings to bazel_tools or platforms#2275
jayconrod merged 1 commit intobazel-contrib:masterfrom
jayconrod:migrate-platforms

Conversation

@jayconrod
Copy link
Copy Markdown
Collaborator

os and cpu constraint settings and values are being removed from
@bazel_tools//platforms. They are currently available in the external
@platforms repo (now declared in go_rules_dependencies). So we should
reference those instead of @bazel_tools//platforms.

In order to support old Bazel versions (the current minimum is still
0.23.0), @io_bazel_rules_go_compat//platforms now declares aliases on
either @platforms or @bazel_tools//platforms.

Note that bazel-skylib 1.0.2 (the latest released version) is not
compatible with --incompatible_use_platforms_repo_for_constraints yet,
so not all rules_go tests pass with that flag yet.

Updates bazelbuild/bazel#8622

…r platforms

os and cpu constraint settings and values are being removed from
@bazel_tools//platforms. They are currently available in the external
@platforms repo (now declared in go_rules_dependencies). So we should
reference those instead of @bazel_tools//platforms.

In order to support old Bazel versions (the current minimum is still
0.23.0), @io_bazel_rules_go_compat//platforms now declares aliases on
either @platforms or @bazel_tools//platforms.

Note that bazel-skylib 1.0.2 (the latest released version) is not
compatible with --incompatible_use_platforms_repo_for_constraints yet,
so not all rules_go tests pass with that flag yet.

Updates bazelbuild/bazel#8622
@jayconrod
Copy link
Copy Markdown
Collaborator Author

@hlopko I took a stab at this. Rather than declaring functions in the compat repo, I'm defining aliases in that repo, and anything that needs to refer to a standard constraint_setting or constraint_value will refer to an alias in there instead.

Seems to work with Bazel 0.23.0 and 1.1.0 with --incompatible_use_platforms_repo_for_constraints. I had to comment out some stuff that depended on the Skylib unittest toolchain, which is not compatible yet. Looks like you've already fixed that in bazelbuild/bazel-skylib#214, but it's not released yet.

@hlopko
Copy link
Copy Markdown
Contributor

hlopko commented Nov 8, 2019

Wow this is great, thanks Jay!

jayconrod pushed a commit that referenced this pull request Dec 4, 2019
…r platforms (#2275)

os and cpu constraint settings and values are being removed from
@bazel_tools//platforms. They are currently available in the external
@platforms repo (now declared in go_rules_dependencies). So we should
reference those instead of @bazel_tools//platforms.

In order to support old Bazel versions (the current minimum is still
0.23.0), @io_bazel_rules_go_compat//platforms now declares aliases on
either @platforms or @bazel_tools//platforms.

Note that bazel-skylib 1.0.2 (the latest released version) is not
compatible with --incompatible_use_platforms_repo_for_constraints yet,
so not all rules_go tests pass with that flag yet.

Updates bazelbuild/bazel#8622
jayconrod pushed a commit that referenced this pull request Dec 4, 2019
…r platforms (#2275)

os and cpu constraint settings and values are being removed from
@bazel_tools//platforms. They are currently available in the external
@platforms repo (now declared in go_rules_dependencies). So we should
reference those instead of @bazel_tools//platforms.

In order to support old Bazel versions (the current minimum is still
0.23.0), @io_bazel_rules_go_compat//platforms now declares aliases on
either @platforms or @bazel_tools//platforms.

Note that bazel-skylib 1.0.2 (the latest released version) is not
compatible with --incompatible_use_platforms_repo_for_constraints yet,
so not all rules_go tests pass with that flag yet.

Updates bazelbuild/bazel#8622
yushan26 pushed a commit to yushan26/rules_go that referenced this pull request Jun 16, 2025
…major_minor (bazel-contrib#2275)

With this change the users can simply reuse our internal flag that will
correctly report the `X.Y` version in `select` statements. If users
previously depended on now removed `is_python_config_setting` now they
have an alternative.

Followup to bazel-contrib#2253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants