Skip to content
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

Bazel, Windows: Bazel 0.23.1 no longer works when users don't have VC installed #7661

Closed
meteorcloudy opened this issue Mar 7, 2019 · 2 comments
Assignees
Labels
area-Windows Windows-specific issues and feature requests P1 I'll work on this now. (Assignee required) platform: windows team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug

Comments

@meteorcloudy
Copy link
Member

To reproduce with Bazel 0.23.1, you can run the following command without VC installed (or if you do you can do SET BAZEL_VC=C:/foo/bar/VC first)

git clone https://github.com/bazelbuild/examples.git
cd java-maven
bazel build java-maven

You'll get

ERROR: C:/src/tmp/gkx4laok/external/local_config_cc/BUILD:131:1: in cc_toolchain_config rule @local_config_cc//:msvc_x64:
Traceback (most recent call last):
        File "C:/src/tmp/gkx4laok/external/local_config_cc/BUILD", line 131
                cc_toolchain_config(name = 'msvc_x64')
        File "C:/src/tmp/gkx4laok/external/local_config_cc/cc_toolchain_config.bzl", line 1355, in _impl
                _windows_msvc_impl(ctx)
        File "C:/src/tmp/gkx4laok/external/local_config_cc/cc_toolchain_config.bzl", line 235, in _windows_msvc_impl
                feature(name = "msvc_link_env", env_sets =... "")])])
        File "C:/src/tmp/gkx4laok/external/local_config_cc/cc_toolchain_config.bzl", line 238, in feature
                env_set(actions = (all_link_actions + [A...]), ... "")])
        File "C:/src/tmp/gkx4laok/external/local_config_cc/cc_toolchain_config.bzl", line 241, in env_set
                env_entry(key = "LIB", value = "")
        File "C:/src/tmp/gkx4laok/external/bazel_tools/tools/cpp/cc_toolchain_config_lib.bzl", line 57, in env_entry
                _check_is_nonempty_string(value, "value", "env_entry")
        File "C:/src/tmp/gkx4laok/external/bazel_tools/tools/cpp/cc_toolchain_config_lib.bzl", line 29, in _check_is_nonempty_string
                fail("{} parameter of {} must be a no...))
value parameter of env_entry must be a nonempty string.

This happens after we migrated CROSSTOOL definition to Starlark and CROSSTOOL in Starlark is more strict than CROSSTOOL in proto, these must not be empty:

msvc_env_tmp,
msvc_env_path,
msvc_env_include,
msvc_env_lib,

I'll send a fix and add a test for this case.

@meteorcloudy meteorcloudy added type: bug P1 I'll work on this now. (Assignee required) platform: windows release blocker area-Windows Windows-specific issues and feature requests labels Mar 7, 2019
@meteorcloudy meteorcloudy self-assigned this Mar 7, 2019
@laurentlb
Copy link
Contributor

Is it a regression from 0.22 to 0.23? If so, we might want to cherrypick it.

@meteorcloudy
Copy link
Member Author

Yes, the fix is coming soon.

laurentlb pushed a commit that referenced this issue Mar 7, 2019
Fixes #7661

RELNOTES: None
PiperOrigin-RevId: 237246257
laurentlb pushed a commit that referenced this issue Mar 7, 2019
Fixes #7661

RELNOTES: None
PiperOrigin-RevId: 237246257
katre pushed a commit that referenced this issue Mar 7, 2019
Fixes #7661

RELNOTES: None
PiperOrigin-RevId: 237246257
katre pushed a commit that referenced this issue Mar 7, 2019
Fixes #7661

RELNOTES: None
PiperOrigin-RevId: 237246257
katre pushed a commit that referenced this issue Mar 8, 2019
Fixes #7661

RELNOTES: None
PiperOrigin-RevId: 237246257
katre pushed a commit that referenced this issue Mar 13, 2019
Fixes #7661

RELNOTES: None
PiperOrigin-RevId: 237246257
katre pushed a commit that referenced this issue Mar 19, 2019
Fixes #7661

RELNOTES: None
PiperOrigin-RevId: 237246257
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests P1 I'll work on this now. (Assignee required) platform: windows team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug
Projects
None yet
Development

No branches or pull requests

3 participants