-
-
Notifications
You must be signed in to change notification settings - Fork 555
copy hlopko@'s platforms examples to this repo #111
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
… where to place the index from https://docs.google.com/document/d/1UZaVcL08wePB41ATZHcxQV4Pu1YfA1RvvWm8FbZHuW8/edit#heading=h.r33iyda45sjm into the site (or a different site?).
|
LGTM. Care to also migrate Julie's hlopko/bazel_platforms_examples#1? |
agoulti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just realized the whole thread was hidden.
I'd like to rework the examples a little bit before exposing them in a central place, since I'm afraid that they are occasionally misleading.
In the first example, HOST_CONSTRAINTS is used - and I don't think they'll do what it looks like they will do.
It creates a toolchain that would match a platform compatible with the host platform, but it doesn't guarantee that it selects the host platform.
For example, if you set linux_platform in the list of execution platforms, it will select that.
The toolchain, however, prints out pre-specified values and the example would seem to indicate that the host platform was still chosen.
- I'm not sure if this is a good example for using HOST_CONSTRAINTS (I don't actually know of a good case to ever use them in your platform).
- The fact that the examples print the strings hardcoded in the toolchain and not the actual platforms make this dangerous if people play with them in unexpected ways. I wonder if we could instead use the experimental Skylark API to print which platforms are actually selected.
| ## Structure | ||
|
|
||
| ``` | ||
| ├── .bazelrc # Setting defaults until https://github.com/bazelbuild/bazel/issues/7081 is fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find this file, am I looking in the wrong place?
|
|
||
| # Tell Bazel that //:linux_platform is allowed execution platform - that our | ||
| # host system or remote execution service can handle that platform. | ||
| register_execution_platforms("//:linux_platform") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a plan to handle examples that don't want to register this platform?
|
Is there work planned to merge this? These examples are super helpful but where very hard to find. |
See comments above. There's some issues with these examples.
I don't think there's anyone actively working on this at the moment. |
|
Yes. The problem is that no one quite has the time to keep the samples
running.
Tyler: Now that you have found them, would you be willing to contribute by
coming up with a PR brought up to current Bazel?
…On Wed, Feb 26, 2020 at 11:00 AM agoulti ***@***.***> wrote:
Is there work planned to merge this? These examples are super helpful but
where very hard to find.
See comments above. There's some issues with these examples.
-
yolo_library is not examining the platform that got selected, but only
prints what the toolchain gave it. So executing_on_cpu etc are the
toolchain's "wishful thinking" and may or may not match the platform that's
actually selected. This could lead to misunderstandings.
-
the use of HOST_CONSTRAINTS is wrong. It seems to think that this
would pick the host platform, where in reality it would pick any platform
with the same constraints as host.
I don't think there's anyone actively working on this at the moment.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#111?email_source=notifications&email_token=AAXHHHGTGRVHMKGM6ACTG6TRE2G2JA5CNFSM4ILNEQWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENAZYUI#issuecomment-591502417>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHFD4IRBNJTLBDUKVADRE2G2JANCNFSM4ILNEQWA>
.
|
I am just moving the code over in this PR. I still have to figure out where to place the index from https://docs.google.com/document/d/1UZaVcL08wePB41ATZHcxQV4Pu1YfA1RvvWm8FbZHuW8/edit#heading=h.r33iyda45sjm into the site (or a different site?).