-
Notifications
You must be signed in to change notification settings - Fork 81
Implement local_config_platform in @platforms #86
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
Conversation
cc @fmeum @katre @brentleyjones @katre specifically, do aliases work with platforms? If they don't, the "canonical" host platform will need to be |
For future reference: context here is bazelbuild/bazel#8766 and https://bazelbuild.slack.com/archives/CA31HN1T3/p1709673438139349 @Wyverald: There are reasons I have been asking for an actual design for this feature from the beginning of bazelbuild/bazel#8766. We very deliberately have resisted putting complex logic in the I'd like to, once again, ask people to step back from the fun part of writing code and move to the less fun part of writing and discussing a design document. |
The test I added is a bit ugly, but it works... except on Windows. Not sure what's going on there... |
Added @aranguyen as an FYI |
I don't think the |
Believe it or not, the shell test was failing because the Windows launcher wasn't built for the shell test, and that's because the isExecutedOnWindows function doesn't work when the root module's name is |
🤯 Thanks, Yun! This is yet another direct dependency on |
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [platforms](https://togithub.com/bazelbuild/platforms) | http_archive | patch | `0.0.8` -> `0.0.9` | --- ### Release Notes <details> <summary>bazelbuild/platforms (platforms)</summary> ### [`v0.0.9`](https://togithub.com/bazelbuild/platforms/releases/tag/0.0.9) [Compare Source](https://togithub.com/bazelbuild/platforms/compare/0.0.8...0.0.9) #### What's Changed - Define constraint for emscripten os by [@​googlewalt](https://togithub.com/googlewalt) in [https://github.com/bazelbuild/platforms/pull/84](https://togithub.com/bazelbuild/platforms/pull/84) - Implement local_config_platform in `@platforms` by [@​Wyverald](https://togithub.com/Wyverald) in [https://github.com/bazelbuild/platforms/pull/86](https://togithub.com/bazelbuild/platforms/pull/86) #### WORKSPACE setup ```bzl load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "platforms", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.9/platforms-0.0.9.tar.gz", "https://github.com/bazelbuild/platforms/releases/download/0.0.9/platforms-0.0.9.tar.gz", ], sha256 = "5eda539c841265031c2f82d8ae7a3a6490bd62176e0c038fc469eabf91f6149b", ) ### To use the new Starlark host platform in @​platforms, also include the following snippet: load("@​platforms//host:extension.bzl", "host_platform_repo") host_platform_repo(name = "host_platform") ``` **Full Changelog**: bazelbuild/platforms@0.0.8...0.0.9 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/secretflow/spu). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI2MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
I am trying to use this and I want to build docs with
The code is in bazel-contrib/rules_python#1827. EDIT: opened #89 to fix the issue I'm having, we can continue discussion there if this is the right fix. |
Per design doc: https://docs.google.com/document/d/1g5JAAOfLsvQKBGqzSLFp1hIYFoQsgOslsjaIGV6P7Tk/edit
plan:
bazel_tools
depend on the new version ofplatforms
.--host_platform
default to@bazel_tools//:host_platform
, which is an alias to@platforms//host
.LocalConfigPlatformFunction.java
in Bazel source to make it produce a@local_config_platform
that forwards everything here:@local_config_platform//:host
becomes an alias to@platforms//host
.@local_config_platform//:constraints.bzl
simply re-exports theHOST_CONSTRAINTS
list from@platforms//host:constraints.bzl
.local_config_platform
.@local_config_platform
directly, and use the stuff in@platforms//host
instead.local_config_platform
(both the repo rule and the built-in module) in Bazel 9.0.