tensorflow icon indicating copy to clipboard operation
tensorflow copied to clipboard

TensorFlow Windows Bazel build is failing

Open meteorcloudy opened this issue 9 years ago • 10 comments

http://ci.tensorflow.org/job/tf-master-win-bzl/709/console

ERROR: C:/jenkins/workspace/tensorflow/bazel_version/head/platform_name/windows-x86_64/tensorflow/tools/pip_package/BUILD:61:1: error loading package 'tensorflow/python': Encountered error while reading extension file 'protobuf.bzl': no such package '@protobuf//': Traceback (most recent call last):
	File "C:/jenkins/workspace/tensorflow/bazel_version/head/platform_name/windows-x86_64/tensorflow/workspace.bzl", line 88
		_apply_patch(repo_ctx, repo_ctx.attr.patch_file)
	File "C:/jenkins/workspace/tensorflow/bazel_version/head/platform_name/windows-x86_64/tensorflow/workspace.bzl", line 79, in _apply_patch
		_execute_and_check_ret_code(repo_ctx, ["patch", "-p1", "-d", r...), <2 more arguments>])
	File "C:/jenkins/workspace/tensorflow/bazel_version/head/platform_name/windows-x86_64/tensorflow/workspace.bzl", line 71, in _execute_and_check_ret_code
		fail("Non-zero return code({1}) when ..., <2 more arguments>))
Non-zero return code(256) when executing 'patch -p1 -d C:/tmp/_bazel_system/wgutbc48/external/protobuf -i C:/jenkins/workspace/tensorflow/bazel_version/head/platform_name/windows-x86_64/third_party/protobuf/add_noinlines.patch':
Stdout: 
Stderr: java.io.IOException: CreateProcess(): The system cannot find the file specified.

Culprit: 8d393ea2fab0ea88ecd11e36d89f186cbc884dbe Reason: patch command is not installed in MSYS Solution: run pacman -Syuu --noconfirm patch @gunan

meteorcloudy avatar Apr 03 '17 08:04 meteorcloudy

@gunan @av8ramit @yifeif : Seems like we need to install patch on Windows. Could one of you take a look?

asimshankar avatar Apr 03 '17 18:04 asimshankar

Running the installation on all machines. Also started a test: http://ci.tensorflow.org/job/tf-master-win-bzl/711/

gunan avatar Apr 03 '17 19:04 gunan

The build is past this issue.

gunan avatar Apr 03 '17 19:04 gunan

I installed patch using pacman -Syuu --noconfirm patch but still facing same issue on windows 7 64 bit

DeepakDonde avatar Jul 18 '17 09:07 DeepakDonde

@DeepakDonde Can you provide more information? Can you run patch in MSYS directly?

meteorcloudy avatar Jul 18 '17 09:07 meteorcloudy

@meteorcloudy So, This is what i tried: 1)Download tensorflow using git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git 2)Edit WORKSPACE file to set android SDK and NDK path. 3)Download and install bazel using chocolatey 4)Go to msys64 directory, open msys2.exe and execute pacman -Syuu --noconfirm patch command 5)Go to tensorflow directory and execute bazel build -c opt //tensorflow/contrib/android:libtensorflow_inference.so --crosstool_top=//external:android/crosstool --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --cpu=armeabi-v7a command using cmd

After this command I get following issue: ERROR: D:/ocr/tensorflow/tensorflow/contrib/android/BUILD:72:1: error loading pa ckage 'tensorflow/core': Encountered error while reading extension file 'protobu f.bzl': no such package '@protobuf//': Traceback (most recent call last): File "D:/ocr/tensorflow/tensorflow/workspace.bzl", line 116 _apply_patch(repo_ctx, repo_ctx.attr.patch_file) File "D:/ocr/tensorflow/tensorflow/workspace.bzl", line 107, in _apply_p atch _execute_and_check_ret_code(repo_ctx, cmd) File "D:/ocr/tensorflow/tensorflow/workspace.bzl", line 91, in _execute_ and_check_ret_code fail("Non-zero return code({1}) when ..., <2 more arguments>)) Non-zero return code(127) when executing 'c:/tools/msys64/usr/bin/bash.exe -c pa tch -p1 -d C:/users/deepakd/appdata/local/temp/_bazel_deepakd/rqaligb5/external/ protobuf -i D:/ocr/tensorflow/third_party/protobuf/add_noinlines.patch': Stdout: Stderr: /usr/bin/bash: patch: command not found and referenced by '//tensorflow/contrib/android:libtensorflow_inference.so'. ERROR: Analysis of target '//tensorflow/contrib/android:libtensorflow_inference. so' failed; build aborted.

I tried to run patch command in msys2 but it gives no output and the console remains blank.

System Configuration: Window 7 - 64 bit JDK version -1.8.0_60 NDK version -r14b

P.S: I followed this tutorial

DeepakDonde avatar Jul 18 '17 11:07 DeepakDonde

@DeepakDonde Unfortunately, Bazel current doesn't support building Android app on Windows yet, but we are actively working on it.

meteorcloudy avatar Jul 18 '17 12:07 meteorcloudy

@meteorcloudy Ok. Please let us know if you found solution for this.

DeepakDonde avatar Jul 19 '17 05:07 DeepakDonde

I have a similar issue, installed patch in MSYS (64) in Windows with pacman -Syuu --noconfirm patch but fails. I can use patch --help from MSYS shell (C:...\msys64\msys2_shell.cmd -mingw64) but the command based on the BAZEL_SH env variable (C:\msys64\usr\bin\bash.exe -c patch --help) doesn't work.

However, if in the cmd I run the bash.exe (enters bash) and then bash (actually starts the MINGW64 shell) then I see patch (and all other stuff) available.

AVCarreiro avatar Sep 19 '17 16:09 AVCarreiro

Managed to make it work by installing patch using choco (choco install patch), running a cmd as administrator. (Windows 7)

ciprianflow avatar Nov 20 '17 00:11 ciprianflow