Skip to content

Windows: Bazel 0.20.0rc1 won't build Protobuf 3.6.1 #6675

Closed

Description

@meteorcloudy

To reproduce:

WORKSPACE:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
  name = "com_google_protobuf",
  urls = ["https://github.com/google/protobuf/archive/v3.6.1.tar.gz"],
  strip_prefix = "protobuf-3.6.1",
  sha256 = "3d4e589d81b2006ca603c1ab712c9715a76227293032d05b26fca603f90b3f5b",
)
$ bazel-0.20.0rc1 build @com_google_protobuf//:protobuf
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
C:\Users\pcloudy/.bazelrc
INFO: Invocation ID: eddb47db-809a-41e2-923f-5a910dac2d1d
INFO: Analysed target @com_google_protobuf//:protobuf (3 packages loaded, 335 targets configured).
INFO: Found 1 target...
ERROR: C:/src/tmp/mq2tevho/external/com_google_protobuf/BUILD:105:1: C++ compilation of rule '@com_google_protobuf//:protobuf' failed (Exit 2): cl.exe failed: error executing command
  cd C:/src/tmp/mq2tevho/execroot/__main__
  SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt;
    SET PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64;C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319;C:\WINDOWS\Microsoft.NET\Framework64\;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\;;C:\WINDOWS\system32
    SET PWD=/proc/self/cwd
    SET TEMP=C:\Users\pcloudy\AppData\Local\Temp
    SET TMP=C:\Users\pcloudy\AppData\Local\Temp
  C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /Iexternal/com_google_protobuf /Ibazel-out/x64_windows-fastbuild/genfiles/external/com_google_protobuf /Ibazel-out/x64_windows-fastbuild/bin/external/com_google_protobuf /Iexternal/bazel_tools /Ibazel-out/x64_windows-fastbuild/genfiles/external/bazel_tools /Ibazel-out/x64_windows-fastbuild/bin/external/bazel_tools /Iexternal/com_google_protobuf/src /Ibazel-out/x64_windows-fastbuild/genfiles/external/com_google_protobuf/src /Ibazel-out/x64_windows-fastbuild/bin/external/com_google_protobuf/src /showIncludes /MD /Od /Z7 /wd4117 -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" -w -DHAVE_PTHREAD -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -Wno-writable-strings /Fobazel-out/x64_windows-fastbuild/bin/external/com_google_protobuf/_objs/protobuf/utility.obj /c external/com_google_protobuf/src/google/protobuf/util/internal/utility.cc
Execution platform: @bazel_tools//platforms:host_platform
cl : Command line error D8021 : invalid numeric argument '/Wwrite-strings'
Target @com_google_protobuf//:protobuf failed to build
INFO: Elapsed time: 1.135s, Critical Path: 0.22s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

To fix this issue, @scentini has submitted https://github.com/protocolbuffers/protobuf/commits?author=scentini, but they are not in any protobuf release yet.

This means, with Bazel 0.20.0, all projects depends on released protobuf will be broken (TensorFlow, rules_go, rules_typescript, etc) on Windows. Due to this issue, those projects are also removed from Bazel CI's downstream projects currently.

@acozzette Is it possible to cherry pick the fixes and have a protobuf 3.6.2 release?

@dslomov Do you consider this as a release blocker?

Activity

  1. added
    P1
    on Nov 14, 2018
  2. acozzette commented on Nov 14, 2018

    @acozzette

    We're going to do a 3.7 release in the new few weeks, so maybe we can just get the fix into 3.7 instead of doing another 3.6 release. @meteorcloudy How soon do you expect to release Bazel 0.20?

  3. scentini commented on Nov 15, 2018

    @scentini
    Contributor

    Apologies for the trouble caused. For some reason I was under the illusion that 3.6.1 was released after my fix, and that I had confirmed that that is the case. Obviously, both are not true.

    As it happens, the flag flip related to the incompatible change made the cut for 0.20, and the removal of the code didn't. If we could rollback 664e02d for 0.20, we'd preserve the old behavior and 0.20 would be able to build protobuf 3.6.1 on Windows. @dslomov, @meteorcloudy, does that sound good?

    That will not help with CI downstream projects though.
    And 0.21 will be released in approximately a month time, if 3.7 is released before that, we'd run into the issue of having to upgrade everybody who depends on protobuf immediately, or they won't build on Windows. And if 3.7 is released later, we'd have the same issue we're having now. @acozzette, would you please consider a 3.6.2 release?

    Thank you all

  4. meteorcloudy commented on Nov 15, 2018

    @meteorcloudy
    MemberAuthor

    @scentini Thanks for suggesting the solution, rollback 664e02d only for 0.20 sounds good to me, @dslomov does it make sense to you, you'll have to do the rollback manually on the branch of 0.20.

    @acozzette 0.20.0 will be released in 1~2 week, I also prefer a protobuf 3.6.2, so that people have more time to upgrade.

  5. dslomov commented on Nov 15, 2018

    @dslomov
    Contributor

    Rolling back 664e02d to fix this sounds good to me.

  6. acozzette commented on Nov 15, 2018

    @acozzette

    I hesitate a bit to do another minor release for 3.6. The problem is just that even releases with tiny changes are a lot of work, because our release process isn't fully automated yet and we usually have to build and publish many artifacts.

    But in this case is it correct that the only changes we need are just edits to a BUILD file and .bzl file? If that is true then maybe we could get away with tagging a new 3.6.2 release just for Bazel and not necessarily publishing artifacts for every language we support.

  7. meteorcloudy commented on Nov 16, 2018

    @meteorcloudy
    MemberAuthor

    @acozzette

    tagging a new 3.6.2 release just for Bazel

    This sounds like a good solution! Because the change in BUILD file and .bzl file won't affect the built binaries. Thanks for suggesting this!

  8. acozzette commented on Nov 16, 2018

    @acozzette

    @meteorcloudy OK, let me check with the rest of the protobuf team at our meeting on Monday. If no one has any objections to tagging a 3.6.2 release then we can go with that solution.

  9. meteorcloudy commented on Nov 19, 2018

    @meteorcloudy
    MemberAuthor

    @acozzette Thank you!

  10. meteorcloudy commented on Nov 21, 2018

    @meteorcloudy
    MemberAuthor

    Hi @acozzette, any progress on this? Is it OK to tagging a 3.6.2 release? It will help us enabling more projects (including TensorFlow) in downstream.

  11. acozzette commented on Nov 21, 2018

    @acozzette

    @meteorcloudy I'm just waiting on an LGTM to cherry-pick the fixes onto our 3.6.x branch. I am taking the afternoon off today but I'll try to get that merged and tag a release before I head out for the holiday. I'll tag a 3.6.1.1 version for this fix.

  12. acozzette commented on Nov 21, 2018

    @acozzette

    @meteorcloudy I just tagged a 3.6.1.1 release with the fix, so let me know if that works.

  13. meteorcloudy commented on Nov 22, 2018

    @meteorcloudy
    MemberAuthor

    @acozzette Works like a charm! Thank you so much, have a nice holiday!

  14. aleda8622 commented on Apr 11, 2019

    @aleda8622

    Hi there. I am experiencing this exact problem with later versions of bazel (versions 0.23.2 and 0.24.1) when building on Windows. This update to point to protobuf 3.6.1.1 (instead of 3.6.1). Is there a binary that can be dowloaded for Windows or do I have to check out a tag and build it myself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1platform: windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions