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

Wrong CWD while executing build_windows_jni.sh #3906

Closed
snnn opened this issue Oct 16, 2017 · 4 comments
Closed

Wrong CWD while executing build_windows_jni.sh #3906

snnn opened this issue Oct 16, 2017 · 4 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) platform: windows type: bug

Comments

@snnn
Copy link
Contributor

snnn commented Oct 16, 2017

Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.

Description of the problem / feature request / question:

Building Bazel from scratch failed.

If possible, provide a minimal example to reproduce the problem:

set PATH=C:\msys64\usr\bin;C:\jdk\bin;C:\python35;C:\python35\scripts;%PATH%
set BAZEL_SH=C:/msys64/usr/bin/bash.exe
set JAVA_HOME=C:\jdk
set BAZEL_PYTHON=C:/python35/python.exe
set BAZEL_VS=C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise
set JAVA_HOME=C:\jdk
bash compile.sh

Environment info

  • Operating System:
    Windows 10

  • Bazel version (output of bazel info release):
    0.6.1

Have you found anything relevant by searching the web?

None

Anything else, information or logs or outputs that would be helpful?

Build log:

Building Bazel from scratch......**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.4.0
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25547 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

file-jni.cc
D:\os\bazel-0.6.1-dist\src\main\native\windows\file-jni.cc(25): fatal error C1083: Cannot open include file: 'src/main/native/windows/file.h': No such file or directory
file.cc
D:\os\bazel-0.6.1-dist\src\main\native\windows\file.cc(21): fatal error C1083: Cannot open include file: 'src/main/native/windows/file.h': No such file or directory
jni-util.cc
D:\os\bazel-0.6.1-dist\src\main\native\windows\jni-util.cc(20): fatal error C1083: Cannot open include file: 'src/main/native/windows/jni-util.h': No such file or directory
processes-jni.cc
D:\os\bazel-0.6.1-dist\src\main\native\windows\processes-jni.cc(26): fatal error C1083: Cannot open include file: 'src/main/native/windows/jni-util.h': No such file or directory
util.cc
D:\os\bazel-0.6.1-dist\src\main\native\windows\util.cc(24): fatal error C1083: Cannot open include file: 'src/main/native/windows/util.h': No such file or directory
Generating Code...

The content of generated "windows_jni.bat" is something like:

@echo OFF
@call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Auxiliary/Build/VCVARSALL.BAT" amd64
@cd D:\os\bazel-0.6.1-dist
@set TMP=D:\aaa
@CL /O2 /EHsc /LD /Fe

However, after invoking "VCVARSALL.BAT", current working directory would be under C:\xxxx, so "cd D:\xxxxx" doesn't take effect immediately. you need to call "D:" after that.

@buchgr
Copy link
Contributor

buchgr commented Oct 16, 2017

@meteorcloudy @laszlocsomor can you take a look please?

@laszlocsomor
Copy link
Contributor

Looks like a duplicate of #3863, which was fixed by e79a110.

@laszlocsomor
Copy link
Contributor

Oh wait, no this is different.

@laszlocsomor laszlocsomor reopened this Oct 16, 2017
@laszlocsomor
Copy link
Contributor

Oh dear, this behavior of cmd.exe is new to me. Thanks for reporting and figuring it out, @snnn !
Let me fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) platform: windows type: bug
Projects
None yet
Development

No branches or pull requests

4 participants