-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Config setting with msvc compiler constraint appears to be never selected #7730
Comments
@katre : Could you please help triaging? |
The How are you selecting the msvc compiler in the first place? If you are using the |
@katre Of course I tested various variants.
Ok, another try:
Works, but there's no constraint to select Let's try to create a custom constraint value:
No errors reported, but config is not selected - default select clause gets triggered. Which brings me to a more general question: is there a setting or aspect to make bazel print the state of constraints and selected configs? |
I am sorry that I was not clear: do not use the msvc constraint value as part of your config_setting. Since you are setting the flag
This config_setting will match whenever the build has the flag |
@katre : Thanks for answering! Is there a Bazel bug here? |
No, there is no bug. I should probably work with @hlopko to remove the confusing compiler constraint_setting, however. |
Thanks! |
If there's no bug, then the whole thing should be branded as "confusing feature implementation". Allow me to repeat:
But it does appears to work if compiler is specified as "msvc-cl" (this should be at least documented). In general, though, the diagnostics offered by the Bazel regarding selected config values must be somehow improved (or documented!). |
Re-opening and assigning to @laszlocsomor to figure out why the |
@oakad I think you have to use If you want to decouple your select from whether we use Does that help? |
@hlopko : Please help triaging this bug. Shall we improve documentation? If so, how? |
@hlopko, What shall we do here? Is "type: documentation" accurate? |
@oakad anything needs to be done here? |
Don't know. I'm avoiding msvc now (clang on msys will be much welcome, though, as mentioned in my other ticket). |
The macro utilises bazel "transitions" to set the `make` toolchain to be the preinstalled `nmake` tool. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macro utilises bazel "transitions" to set the `make` toolchain to be the preinstalled `nmake` tool. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
Note that the msvc constraint was removed from the exec_compatible_with attribute of preinstalled_nmake_toolchain as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR bazel-contrib#729
The macro utilises bazel "transitions" to set the `make` toolchain to be the preinstalled `nmake` tool. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macro utilises bazel "transitions" to set the `make` toolchain to a given make variant toolchain, e.g. preinstalled_nmake. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macro utilises bazel "transitions" to set the `make` toolchain used in the configure_make() or make() rules to a given make variant toolchain, e.g. preinstalled_nmake. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macro utilises bazel "transitions" to set the `make` toolchain used in the configure_make() or make() rules to a given make variant toolchain, e.g. preinstalled_nmake. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macros utilise bazel "transitions" to set the `make` toolchain used in the configure_make(), cmake() or make() rules to a given make variant toolchain, e.g. preinstalled_nmake. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macros utilise bazel "transitions" to set the `make` toolchain used in the configure_make(), cmake() or make() rules to a given make variant toolchain, e.g. preinstalled_nmake. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macros utilise bazel "transitions" to set the `make` toolchain used in the configure_make(), cmake() or make() rules to a given make variant toolchain, e.g. preinstalled_nmake. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macros utilise bazel "transitions" to set the `make` toolchain used in the configure_make(), cmake() or make() rules to a given make variant toolchain, e.g. preinstalled_nmake. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macros utilise bazel "transitions" to set the `make` toolchain used in the configure_make(), cmake() or make() rules to a given make variant toolchain, e.g. preinstalled_nmake. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
The macros utilise bazel "transitions" to set the `make` toolchain used in the configure_make(), cmake() or make() rules to a given make variant toolchain, e.g. preinstalled_nmake. Note that the msvc constraint was removed from the `exec_compatible_with` attribute of `preinstalled_nmake_toolchain` as the condition is not actually met even when building with msvc. See bazelbuild/bazel#7730. This will be tested in PR#729
Tested with bazel 0.23.1
I'm trying to use the following construct to
select
compiler specific code:Unfortunately, it appears that select clauses predicated with ":windows_msvc" are never selected. No errors are being reported and I have tried several compiler/cpu command line flag combinations as well as some custom
...cpp:cc_compiler
constraint values to no avail.If I comment out the "msvc" line everything works as expected, apart from the fact that the build becomes unsuitable for msys.
It appears to me that a minor bug of some sort may exist within the msvc toolchain definitions.
The text was updated successfully, but these errors were encountered: