You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I remember a design doc by @brentleyjones that (if I recall correctly) gave meaning to a multi-valued --platforms flag: A target is built for the first platform in the list that it is target_compatible_with, which allows for pretty clean flagless multi-platform builds. I am noting this here to make sure that if we migrate, we are very sure that we aren't going to migrate back eventually.
Yes, I would like to confirm if this means we will never adopt something like my proposal. And if so, if there are any future plans at all to support multi-platform builds in a nice way?
The reason to handle this now are to reduce confusion, both for Bazel users (who frequently ask about what happens when they pass multiple values to --platforms) and for Bazel developers (who keep having to add defensive code around PlatformOptions.platforms).
If we decide to implement either @brentleyjones's proposal or something similar, we can change the flag semantics again to match whatever we decide to implement.
@katre Would step 1 include making it single-valued within transition implementation functions as well? I could see that being very breaking.
Could we keep //command_line_option:platforms list-valued until it is removed and introduce //command_line_option:platform as the separate single-valued alternative?
Yes, that's part of why we're not moving on this faster.
Having two different flags also seems confusing. When we pick this up we'll consider which is less bad.
I consider multi-valued --platforms as one of the two biggest mistakes I made when starting the platforms project (the other was a separate toolchains parameter to rule instead of a new attr.toolchain attribute type).
Any news about this? The --platformS flag is still very confusing and over 1 year there seems to not have been any progress for multiplatform builds either (sadly).
We don't have any news, or any plans to prioritize renaming the flag.
If you want multiplatform builds, you should write a custom transition to correctly encode the logic you need, because there's no consensus on a global multiplatform strategy for all use cases.
Activity
katre commentedon Oct 12, 2023
@sdtwigg We discussed this recently
chaselatta commentedon Oct 12, 2023
I put together a quick repro case which shows the issue we discussed. https://github.com/chaselatta/platform_bug_repro
fmeum commentedon Oct 12, 2023
I remember a design doc by @brentleyjones that (if I recall correctly) gave meaning to a multi-valued
--platformsflag: A target is built for the first platform in the list that it istarget_compatible_with, which allows for pretty clean flagless multi-platform builds. I am noting this here to make sure that if we migrate, we are very sure that we aren't going to migrate back eventually.brentleyjones commentedon Oct 12, 2023
Yes, I would like to confirm if this means we will never adopt something like my proposal. And if so, if there are any future plans at all to support multi-platform builds in a nice way?
katre commentedon Oct 13, 2023
@brentleyjones: Your proposal was very interesting, and we may decide to take it up in the future. At this point, however, I think the best approach is the one from https://github.com/bazelbuild/proposals/blob/main/designs/2023-06-08-standard-platform-transitions.md, where the controls are in BUILD files and Starlark rules.
The reason to handle this now are to reduce confusion, both for Bazel users (who frequently ask about what happens when they pass multiple values to
--platforms) and for Bazel developers (who keep having to add defensive code aroundPlatformOptions.platforms).If we decide to implement either @brentleyjones's proposal or something similar, we can change the flag semantics again to match whatever we decide to implement.
katre commentedon Nov 27, 2023
Copying parts of my comment from #6519:
Steps for cleaning up
--platforms:--platform(flag migrations are hard, sorry), leaving--platformsas a deprecated legacy name.--platforms.fmeum commentedon Nov 27, 2023
@katre Would step 1 include making it single-valued within transition implementation functions as well? I could see that being very breaking.
Could we keep
//command_line_option:platformslist-valued until it is removed and introduce//command_line_option:platformas the separate single-valued alternative?katre commentedon Nov 27, 2023
Yes, that's part of why we're not moving on this faster.
Having two different flags also seems confusing. When we pick this up we'll consider which is less bad.
I consider multi-valued
--platformsas one of the two biggest mistakes I made when starting the platforms project (the other was a separatetoolchainsparameter to rule instead of a newattr.toolchainattribute type).ansonos commentedon Feb 12, 2025
Any news about this? The
--platformSflag is still very confusing and over 1 year there seems to not have been any progress for multiplatform builds either (sadly).katre commentedon Feb 12, 2025
We don't have any news, or any plans to prioritize renaming the flag.
If you want multiplatform builds, you should write a custom transition to correctly encode the logic you need, because there's no consensus on a global multiplatform strategy for all use cases.