1. ProblemFor user convenience, I would like to use --platforms=HardwareA with constraint_values, but in transition mode I have to use build_settings. How to combine?
2. ProblemTransitions does not support toolchain --features. How should it be possible to package with different --features activated in a one-to-many transition, e.g. opt and dbg? (This specific example is possible today because compilation_mode is still a built in command line flag, but I wonder about the more general concept and our internal --features.)
3. ProblemI cannot get transition to change label_flags. There is no test for it in the Bazel source code either.
4. SuggestionLet platforms take a build_settings dictionary, not just a constraint_values list.Does this suggestion mean that constraint_settings and constraint_values can be removed all together? What other purpose do they fulfill?Also, build_settings are more flexible in supporting string, int, bool and labels, but constraint_settings only support string.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/dac5be84-165f-4abe-b11b-51301c2f245e%40googlegroups.com.
5. Problem (transitions and toolchain resolution)The toolchain rule's exec_compatible_with and target_compatible_with only takes constraint_values whereas transitions do not support changing contraint_settings. That means that we cannot change to another cross compiler over a transition. How is this thought to work? Can config_settings be allowed as well?
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/90bc586c-1229-4be2-97ea-a329d591923f%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-...@googlegroups.com.
From another discussion with Greg I got the following guideline that I will remember:
We generally recommend trying to stay pure to the intention of platforms: something belongs in a platform if running the same build on two different machines might produce different results ("exec platform" differences) or running the same built binary on different machines produces different output ("target platform" differences).
We have identified a diamond graph with different transitions on each side, so the common bottom of the graph ends up in two configurations. It turns out that the common piece does not use the build_settings that differs between the paths and should therefore only be built once. Then we have four alternatives:
Alternative 1 and 2 are feasible for us. Would 3 be a short term solution until 4 is in place?
Also, will the clever output path handling results in too many file operations on Windows? Otherwise number 3 might be a good enough solution.
Another useful feature would
be to apply a transition on an alias rule. I’ll write a feature request on
GitHub.
/Fredrik
From another discussion with Greg I got the following guideline that I will remember:
We generally recommend trying to stay pure to the intention of platforms: something belongs in a platform if running the same build on two different machines might produce different results ("exec platform" differences) or running the same built binary on different machines produces different output ("target platform" differences).
We have identified a diamond graph with different transitions on each side, so the common bottom of the graph ends up in two configurations. It turns out that the common piece does not use the build_settings that differs between the paths and should therefore only be built once. Then we have four alternatives:
- Transition into the common bottom and reset all unused build_settings to a constant (empty string). This requires us to maintain a global list of all build_settings in the whole system, so not ideal, but it is working. (A built in way of accessing the default values of a build_setting/label_flag in Starlark would be handy here, but not necessary.)
- Set the outputDirectoryName to a specific name, https://github.com/bazelbuild/bazel/issues/7477. The --platform_suffix=/../foo hack does not work because “-ST-<hash>” is appended after platform_suffix. (I might just move platform_suffix last for a quick fix.)
- Let Bazel look through all dependencies to determine what build_settings and label_flags are actually used transitively. Only those configurations should be hashed into the output directory name. Basically, let each node in the analysis phase propagate used configurations up in the graph.
- Use your clever output path solution per action.
Alternative 1 and 2 are feasible for us. Would 3 be a short term solution until 4 is in place?
Also, will the clever output path handling results in too many file operations on Windows? Otherwise number 3 might be a good enough solution.
Another useful feature would be to apply a transition on an alias rule. I’ll write a feature request on GitHub.
/Fredrik
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/006b1a5a-3912-4d49-8775-893723cd892e%40googlegroups.com.