-
-
Notifications
You must be signed in to change notification settings - Fork 591
[WIP] Add Windows to the Bazel CI environment. #6
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
Conversation
@dslomov @meteorcloudy @laszlocsomor This doesn't look like my bug. Here's what I'm seeing in the Bazel CI logs once I fix the path delimiters in ...
INFO: Building...
[0 / 18] Writing file rules_python/piptool.zip-2.params
[12 / 126] Compiling external/protobuf/src/google/protobuf/compiler/js/embed.cc [for host]
[12 / 140] Executing genrule @protobuf//:protos_python_genrule [for host]
[13 / 179] Compiling external/protobuf/src/google/protobuf/io/gzip_stream.cc [for host]
ERROR: C:/temp/_bazel_system/_wrknaru/external/protobuf/BUILD:113:1: C++ compilation of rule '@protobuf//:protobuf' failed (Exit 2): cl.exe failed: error executing command
cd C:/temp/_bazel_system/_wrknaru/execroot/io_bazel_rules_python
SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\\shared;C:\Program Files (x86)\Windows Kits\8.1\include\\um;C:\Program Files (x86)\Windows Kits\8.1\include\\winrt;
SET LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;
SET PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64;C:\windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\;c:\tools\msys64\usr\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Google\Compute Engine\sysprep\;C:\Program Files\Google\Compute Engine\metadata_scripts\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\ProgramData\chocolatey\bin;;;C:\ProgramData\chocolatey\bin;;c:\python_27_amd64\files;C:\Program Files\Java\jdk1.8.0_144\bin;;C:\windows\system32
SET PWD=/proc/self/cwd
SET TEMP=c:\TEMP
SET TMP=c:\TEMP
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0600 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS /bigobj /Zm500 /J /Gy /GF /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /nologo /Iexternal/protobuf /Ibazel-out/host/genfiles/external/protobuf /Iexternal/bazel_tools /Ibazel-out/host/genfiles/external/bazel_tools /Iexternal/protobuf/src /Ibazel-out/host/genfiles/external/protobuf/src /Iexternal/bazel_tools/tools/cpp/gcc3 /showIncludes /MT /O2 /c external/protobuf/src/google/protobuf/io/gzip_stream.cc /Fobazel-out/host/bin/external/protobuf/_objs/protobuf/external/protobuf/src/google/protobuf/io/gzip_stream.o -DHAVE_PTHREAD -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function.
cl : Command line error D8021 : INFO: Building complete. I think the |
skydoc haven't been tested on Windows so far...
…On Mon, Sep 18, 2017 at 8:08 PM mattmoor ***@***.***> wrote:
@dslomov <https://github.com/dslomov> @meteorcloudy
<https://github.com/meteorcloudy> @laszlocsomor
<https://github.com/laszlocsomor> This doesn't look like my bug.
Here's what I'm seeing in the Bazel CI logs once I fix the path delimiters
in zipfile:
...
INFO: Building...
[0 / 18] Writing file rules_python/piptool.zip-2.params
[12 / 126] Compiling external/protobuf/src/google/protobuf/compiler/js/embed.cc [for host]
[12 / 140] Executing genrule @protobuf//:protos_python_genrule [for host]
[13 / 179] Compiling external/protobuf/src/google/protobuf/io/gzip_stream.cc [for host]
ERROR: C:/temp/_bazel_system/_wrknaru/external/protobuf/BUILD:113:1: C++ compilation of rule ***@***.***//:protobuf' failed (Exit 2): cl.exe failed: error executing command
cd C:/temp/_bazel_system/_wrknaru/execroot/io_bazel_rules_python
SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\\shared;C:\Program Files (x86)\Windows Kits\8.1\include\\um;C:\Program Files (x86)\Windows Kits\8.1\include\\winrt;
SET LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;
SET PATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64;C:\windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x64;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\;c:\tools\msys64\usr\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Google\Compute Engine\sysprep\;C:\Program Files\Google\Compute Engine\metadata_scripts\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\ProgramData\chocolatey\bin;;;C:\ProgramData\chocolatey\bin;;c:\python_27_amd64\files;C:\Program Files\Java\jdk1.8.0_144\bin;;C:\windows\system32
SET PWD=/proc/self/cwd
SET TEMP=c:\TEMP
SET TMP=c:\TEMP
C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0600 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS /bigobj /Zm500 /J /Gy /GF /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /nologo /Iexternal/protobuf /Ibazel-out/host/genfiles/external/protobuf /Iexternal/bazel_tools /Ibazel-out/host/genfiles/external/bazel_tools /Iexternal/protobuf/src /Ibazel-out/host/genfiles/external/protobuf/src /Iexternal/bazel_tools/tools/cpp/gcc3 /showIncludes /MT /O2 /c external/protobuf/src/google/protobuf/io/gzip_stream.cc /Fobazel-out/host/bin/external/protobuf/_objs/protobuf/external/protobuf/src/google/protobuf/io/gzip_stream.o -DHAVE_PTHREAD -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function.
cl : Command line error D8021 : INFO: Building complete.
I *think* the protobuf dependency is coming from skydoc. /cc @davidzchen
<https://github.com/davidzchen> @damienmg <https://github.com/damienmg>
Does that work on Windows?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADjHf9KShvlR8ToxVA-hljyiu2K4y-1Pks5sjrG0gaJpZM4PbSzD>
.
|
@duggelz FYI I wasn't gonna merge it before it works, I wanted to use this as a place to triage and discuss issues in the related tooling. |
@mattmoor The error is because you have invalid warning arguments in your command line, such as |
@meteorcloudy This repo has zero C++ code, this is coming through a dependency ( Have you guys done any outreach to the owners of common dependencies yet? |
We do compile protobuf as part of building Bazel, so there is at some version that should build on Windows. |
Disabling ...
ERROR: C:/temp/_bazel_system/_wrknaru/external/subpar/compiler/BUILD:40:1: Building par file @subpar//compiler:compiler.par failed (Exit 1): compiler.cmd failed: error executing command
cd C:/temp/_bazel_system/_wrknaru/execroot/io_bazel_rules_python
bazel-out/host/bin/external/subpar/compiler/compiler.cmd --manifest_file bazel-out/host/bin/external/subpar/compiler/compiler.par_SOURCES --outputpar bazel-out/host/bin/external/subpar/compiler/compiler.par --stub_file bazel-out/host/bin/external/subpar/compiler/compiler.cmd external/subpar/compiler/compiler.py.
'"python"' is not recognized as an internal or external command,
operable program or batch file. It looks like the On a local box, here's what that contains:
|
I can work around this locally by supplying: However, the next thing I run into is (very likely) a PAR issue, where the PAR compiler seems to parse the |
I opened this to track |
If I comment out the build of However, all of the tests fail with (variations of):
@dslomov Do you guys have anything planned to address this? |
@laszlocsomor I think the other major one you guys should make sure is on your radar is |
@laszlocsomor To be clear, I don't think the long path has anything to do with |
@mattmoor Can you give me some instructions on how to reproduce your failure? |
@meteorcloudy IIRC on top of my windows branch I had to comment out the bazel test --python_path=c:\Python27\python.exe ... |
I believe the paths that ultimately fail are all coming through here. Would it make sense to use the weird trick in |
It would only work with Python 3. To be clear, the |
@mattmoor
This is because we don't have runfiles on Windows, but I believe you can still access |
ugh, I feel like I just figured out runfiles, and now you are changing it on me! ;-) Are you suggesting that this relative path is the portable way to access files from tests? |
On Linux/macOS, we can create symlinks, so Bazel creates the runfiles directory tree with symlinks in the directories, and the symlinks point to the actual files. Binaries and tests can access the runfiles via On Windows, we can't create symlinks, so Bazel just writes a manifest file, which describes where the symlinks would be and where they'd point to. Binaries and tests can access the runfiles by |
@meteorcloudy , this is new to me -- is this logic implemented in the rule, or in Bazel? |
@mattmoor @laszlocsomor Basically, there are two ways of accessing runfiles in Bazel's native python rule.
I prefer users to go with the first way, because it's the general way to access runfiles on Windows, which also works for other rules(cc_binary, java_binary). Look how we access runfiles in our python tests, _LoadRunfiles and Rlocation |
@dslomov @meteorcloudy @laszlocsomor So after the recent Is there a reason the Bazel CI on Windows isn't passing this? Is 0.6 expected to fix this? Does |
@mattmoor Unfortunately, bazelbuild/bazel@213a52a didn't make it into 0.6. |
@meteorcloudy Should Bazel CI be passing |
@mattmoor You can also add |
Cool, do you know the path to Python on the CI setup? |
Should be |
Finally got a chance to update the CI config, and it looks like the next issue is coming from PAR (I don't recall hitting this locally): ERROR: C:/windows/temp/_bazel_system/fkfyb_ar/external/subpar/compiler/BUILD:40:1: Building par file @subpar//compiler:compiler.par failed (Exit 1): compiler.cmd failed: error executing command
cd C:/windows/temp/_bazel_system/fkfyb_ar/execroot/io_bazel_rules_python
bazel-out/host/bin/external/subpar/compiler/compiler.cmd --manifest_file bazel-out/host/bin/external/subpar/compiler/compiler.par_SOURCES --outputpar bazel-out/host/bin/external/subpar/compiler/compiler.par --stub_file bazel-out/host/bin/external/subpar/compiler/compiler.cmd external/subpar/compiler/compiler.py.
Traceback (most recent call last):
File "C:\Program Files\Anaconda3\lib\site.py", line 570, in <module>
main()
File "C:\Program Files\Anaconda3\lib\site.py", line 561, in main
os.environ["PATH"])
File "C:\Program Files\Anaconda3\lib\os.py", line 725, in __getitem__
raise KeyError(key) from None
KeyError: 'PATH'
Failed to import the site module The |
retest this please. |
…ort-purelib-platlib
Fixes: #2