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 fails if workspace is not on C: #1463

Closed
tomzx opened this issue Jul 1, 2016 · 48 comments
Closed

bazel fails if workspace is not on C: #1463

tomzx opened this issue Jul 1, 2016 · 48 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) platform: windows type: bug
Milestone

Comments

@tomzx
Copy link

tomzx commented Jul 1, 2016

Hi,

I'm trying to build master (a18add1) following the instruction provided and I'm getting the error below. The path to my java jdk is correct and the folder does indeed exist. Furthermore, I can see that the first part of the compile script calls javac from that directory without any issue.

I'm willing to try and debug this out if someone is willing to provide me with some guidance.

Thanks!

$ ./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh compile /path/to/bazel
🍃  Building Bazel from scratch......
🍃  Building Bazel with Bazel.
.WARNING: C:/tools/msys64/tmp/bazel.jR1zd19q/out/external/bazel_tools/WORKSPACE:1: Workspace name in C:/tools/msys64/tmp/bazel.jR1zd19q/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions.
ERROR: no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_73 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).
ERROR: no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_73 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).
INFO: Elapsed time: 1.048s

Building output/bazel
@aehlig aehlig added type: bug P1 I'll work on this now. (Assignee required) platform: windows labels Jul 4, 2016
@aehlig
Copy link
Contributor

aehlig commented Jul 4, 2016

Assigning to @dslomov who has more knowledge about Windows.

CC @kchodorow

@Lunarsong
Copy link

I'm seeing the same error here when trying to build 89484da .

@petemounce
Copy link
Contributor

petemounce commented Aug 17, 2016

I am able to compile bazel tags 0.3.0 and 0.3.1, and current master (60af9db) on Windows 10, but I get the same error when trying to compile (with either version) my in-house project.

Sample output:

$ bazel build --verbose_failures --cpu='x64_windows_msvc' --host_cpu='x64_windows_msvc' cpp/protocgenfabric/...                .
ERROR: no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_102 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).
ERROR: no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_102 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).
INFO: Elapsed time: 1.948s

(There's also a reference to running blaze clean which I guess is a typo)

I should mention - that JDK directory definitely exists.

To try to eliminate the space in the Program Files being an issue, I've used an admin prompt to do mklink /j prfi "c:\Program Files". That hasn't helped:

Pete@petemounce-win-imp MSYS /s/e
$ echo $JAVA_HOME
C:/Program Files/Java/jdk1.8.0_102

Pete@petemounce-win-imp MSYS /s/e
$ export JAVA_HOME=c:/prfi/Java/jdk1.8.0_102

Pete@petemounce-win-imp MSYS /s/e
$ $JAVA_HOME/bin/java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

Pete@petemounce-win-imp MSYS /s/e
$ $JAVA_HOME/bin/javac -version
javac 1.8.0_102

Pete@petemounce-win-imp MSYS /s/e
$ bazel build --verbose_failures --cpu='x64_windows_msvc' --host_cpu='x64_windows_msvc' cpp/protocgenfabric/...
ERROR: in target '//external:jdk-default': no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_102 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).
INFO: Elapsed time: 0.280s

Where is it that bazel is deciding to use that JDK if not the JAVA_HOME variable?

@divydal
Copy link

divydal commented Aug 25, 2016

Hi, I have the same problem when trying to build 7b5e1af

@sunsided
Copy link

sunsided commented Sep 6, 2016

Same here, trying to build Bazel master (180d1b5) or 0.3.1 on a German Windows 10 Version 1607, using msys2 x64 and jdk1.8.0_74:

$ ./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh compile /path/to/bazel
🍃  Building Bazel from scratch.......
D:\dev\FremdeSources\bazel>call "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/VCVARSALL.BAT" amd64
Microsoft (R) C/C++-Optimierungscompiler Version 19.00.24210 für x64
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

windows_error_handling.cc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xlocale(341): warning C4530: C++-Handler verwendet, aber Entladesemantik ist nicht aktiviert. Geben Sie /EHsc an.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\exception(359): warning C4577: "noexcept" wird ohne angegebenen Ausnahmebehandlungsmodus verwendet. Die Beendigung bei einer Ausnahme ist nicht sichergestellt. Geben Sie "/EHsc" an.
windows_file_operations.cc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xlocale(341): warning C4530: C++-Handler verwendet, aber Entladesemantik ist nicht aktiviert. Geben Sie /EHsc an.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\exception(359): warning C4577: "noexcept" wird ohne angegebenen Ausnahmebehandlungsmodus verwendet. Die Beendigung bei einer Ausnahme ist nicht sichergestellt. Geben Sie "/EHsc" an.
windows_processes.cc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xlocale(341): warning C4530: C++-Handler verwendet, aber Entladesemantik ist nicht aktiviert. Geben Sie /EHsc an.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\iosfwd(343): warning C4577: "noexcept" wird ohne angegebenen Ausnahmebehandlungsmodus verwendet. Die Beendigung bei einer Ausnahme ist nicht sichergestellt. Geben Sie "/EHsc" an.
Code wird generiert...
Microsoft (R) Incremental Linker Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/dll
/implib:D:\dev\msys64\tmp\bazel_N9GyDiSO\jni\windows_jni.lib
/out:D:\dev\msys64\tmp\bazel_N9GyDiSO\jni\windows_jni.dll
windows_error_handling.obj
windows_file_operations.obj
windows_processes.obj
   Bibliothek "D:\dev\msys64\tmp\bazel_N9GyDiSO\jni\windows_jni.lib" und Objekt "D:\dev\msys64\tmp\bazel_N9GyDiSO\jni\windows_jni.exp" werden erstellt.
.
🍃  Building Bazel with Bazel.
.WARNING: D:/dev/msys64/tmp/bazel_vSsqtL7b/out/external/bazel_tools/WORKSPACE:1: Workspace name in D:/dev/msys64/tmp/bazel_vSsqtL7b/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions.
ERROR: in target '//external:jdk-default': no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_74 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).
INFO: Elapsed time: 0,832s

and on subsequent calls to compile.sh:

$ ./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh compile /path/to/bazel
🍃  Building Bazel from scratch......
🍃  Building Bazel with Bazel.
.WARNING: D:/dev/msys64/tmp/bazel_cJf7e10a/out/external/bazel_tools/WORKSPACE:1: Workspace name in D:/dev/msys64/tmp/bazel_cJf7e10a/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions.
ERROR: no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_74 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).
ERROR: no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_74 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).
INFO: Elapsed time: 0,798s

@petemounce
Copy link
Contributor

petemounce commented Sep 17, 2016

This is still a problem for me in my own source tree (but not bazel's) at current HEAD, c484f19.

I have Windows 10 Anniversary Update, Bash-on-Windows is installed. I have jdk1.8.0_102

I get the same error with powershell (since #1453 allows its use) and msys2 x64. Edit: I get the same error regardless of whether b-o-w bash.exe appears first or later than msys2's in PATH I think.

@sunsided @divydal do you have b-o-w too...?

@sunsided
Copy link

@petemounce Yes, installed. Didn't try it though because I need Windows binaries.

@jared-improbable
Copy link

This is also an issue for me on Windows 10, using the nightly built here

$ bazel-nightly.exe info
WARNING: C:/Users/jared/AppData/Local/Temp/Bazel/9ncInwMl/external/io_bazel_rules_scala/scala/scala.bzl:473:12: Argument `cfg = "host"` or `cfg = "data"` is required if `executable = True` is provided for a label.
WARNING: C:/Users/jared/AppData/Local/Temp/Bazel/9ncInwMl/external/io_bazel_rules_scala/scala/scala.bzl:474:13: Argument `cfg = "host"` or `cfg = "data"` is required if `executable = True` is provided for a label.
WARNING: C:/Users/jared/AppData/Local/Temp/Bazel/9ncInwMl/external/io_bazel_rules_scala/scala/scala.bzl:475:14: Argument `cfg = "host"` or `cfg = "data"` is required if `executable = True` is provided for a label.
WARNING: C:/Users/jared/AppData/Local/Temp/Bazel/9ncInwMl/external/io_bazel_rules_scala/scala/scala.bzl:480:12: Argument `cfg = "host"` or `cfg = "data"` is required if `executable = True` is provided for a label.
WARNING: C:/Users/jared/AppData/Local/Temp/Bazel/9ncInwMl/external/io_bazel_rules_scala/scala/scala.bzl:481:13: Argument `cfg = "host"` or `cfg = "data"` is required if `executable = True` is provided for a label.
WARNING: C:/Users/jared/AppData/Local/Temp/Bazel/9ncInwMl/external/io_bazel_rules_scala/scala/scala.bzl:482:11: Argument `cfg = "host"` or `cfg = "data"` is required if `executable = True` is provided for a label.
WARNING: C:/Users/jared/AppData/Local/Temp/Bazel/9ncInwMl/external/io_bazel_rules_scala/scala/scala.bzl:493:11: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
WARNING: C:/Users/jared/AppData/Local/Temp/Bazel/9ncInwMl/external/io_bazel_rules_scala/scala/scala.bzl:545:21: Argument `cfg = "host"` or `cfg = "data"` is required if `executable = True` is provided for a label.
ERROR: in target '//external:jdk-default': no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_102 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).```

`C:/Program Files/Java/jdk1.8.0_102` does exist.

@dslomov
Copy link
Contributor

dslomov commented Oct 4, 2016

We were able to repro this when a workspace is not on C: drive. Fix for that will hopefully be coming soon, but is it the case for everyone reporting this?

@petemounce
Copy link
Contributor

Yes, my source is on my s: drive. Good thought!

@divydal
Copy link

divydal commented Oct 4, 2016

Yes , my workspace is on d:.

@sunsided
Copy link

sunsided commented Oct 4, 2016

Same, sources on D:

@tomzx
Copy link
Author

tomzx commented Oct 4, 2016

@dslomov Yes mine isn't stored on the C: drive. However I did try to create a symlink on the C:, assuming it might related to that, but that didn't work either. I'm assuming symlinks are resolved?

@petemounce
Copy link
Contributor

@tomzx how did you create the symlink (ie, exact command)? There are a couple of different types on Windows, with differing characteristics.

@tomzx
Copy link
Author

tomzx commented Oct 4, 2016

@petemounce IIRC, mklink /D C:\bazel E:\bazel.

@petemounce
Copy link
Contributor

Ah ok. That's what I would have tried too. Do any of the methods listed in http://superuser.com/questions/752538/mklink-vs-junction-exe allow workaround?

@dslomov dslomov assigned laszlocsomor and unassigned dslomov Oct 5, 2016
@dslomov dslomov added this to the 0.4 milestone Oct 5, 2016
@laszlocsomor
Copy link
Contributor

FTR i just did subst d: c:\d_drive and that works too (bonus: good old #1744 still around):

$ bazel info
ERROR: CreateFile(C:\tools\msys64\var\tmp\Bazel\WLSiXh7n\install): The system cannot find the file specified.
 (2)
...........
ERROR: in target '//external:jdk-default': no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_102 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build)

I'll dive into that part of the code and see what I find.

@petemounce
Copy link
Contributor

petemounce commented Oct 6, 2016

c484f19: When I run bazel commands on my c: drive, they work; when I run them from my d: drive then I get this.

I tested this by running bazel build and bazel info in the root of this repo while on c: and d:, same system as I reported from. I get this error when on d:.

I get it inside msys2 shell and powershell. Unfortunately I can't easily test this against my in-house project because that would currently mean moving it to an unencrypted drive, which I won't do. Still, pretty indicative.

(Also, same when I run the bazel.exe that lives on c: from my d: drive, fwiw, by fully qualifying the path to the exe)

@laszlocsomor
Copy link
Contributor

@petemounce : Thanks for reporting it. I'm seeing the same. Looking for the root cause and fixing soon.

@laszlocsomor
Copy link
Contributor

laszlocsomor commented Oct 6, 2016

The problem is rooted in a design limitation of Bazel, namely that a file system is assumed to have a single root. That's not true on Windows, and so the hack we've been using is treating "C:" as a top-level directory, not a root. WindowsFileSystem.getFilesystemRoot() reports / as the root.

This is breaking down if the workspace is on another drive, and we have to fix this design flaw properly.

This hack also means that all RootedPath objects are incorrect in the sense that their root is / and not the drive letter, so the RootedPath for C:\ itself is [/]/[C:].

No PathFragment objects are absolute on Windows because C: is just a directory, / is the root.

These factors lead to more problems down the road, for example in FileFunction.resolveFromAncestors where:

rootedPath = "/C:"  // root="/", relative="C:"
relativePath = "C:"
baseName = "C:"
parentRealRootedPath = "/"  // root="/", relative=""
parentRealRootedPath.getRelativePath() = ""
parentRealRootedPath.getRelativePath().getRelative(baseName) = ""
---> thus realRootedPath = "/"  // root="/", relative=""

Which means that we attempt to evaluate C:-relative paths relative to the current drive (D:), and this manifests as incorrect-looking missing file errors.

@laszlocsomor
Copy link
Contributor

One more factor: when a PathFragment is just C:, then its segments are empty, though isAbsolute = false, and driveLetter = 'C'. When it's a path like C:/Program Files, then the driveLetter = 'C' (fine), isAbsolute = false (still not fine I guess) but segments = ["C:", "Program Files"]. This discrepancy is bad, this is what's causing parentRealRootedPath.getRelativePath().getRelative(baseName) in my previous comment to be "/", because parentRealRootedPath.getRelativePath() returns the empty PathFragment, and baseName is PathFragment("C:"), and the .getRelative call joins the segments which neither of these PathFragments have any of.

@laszlocsomor
Copy link
Contributor

Out for review. If all goes well, we can push the fix to GH today or tomorrow.

@petemounce
Copy link
Contributor

Hi @laszlocsomor - I didn't spot this on [gerrit|https://bazel.googlesource.com/bazel/]. Is it somewhere else? Happy to try it out, since it's the next thing to a blocker for us.

@laszlocsomor
Copy link
Contributor

Hey @petemounce , it's not yet submitted, sorry about that. It should be in today or Monday, if not I'll ping this thread.

@youkpan
Copy link

youkpan commented Oct 15, 2016

seems java.exe path problem

set JAVA_HOME=C:/Program\ Files/Java/jdk1.8.0_101&c:\bazel.exe
Couldn't find java at 'C:/Program\ Files/Java/jdk1.8.0_101/bin/java'.

@dslomov
Copy link
Contributor

dslomov commented Oct 15, 2016

@youkpan this is not really related to this bug, is it? In the future, please file a separate issue if the problem is unrelated to the problem discussed in the thread.
Anyhow, in your case the content of JAVA_HOME variable after your command is literally C:/Program\ Files/Java/jdk1.8.0_101/bin/java, including a \ before the space. The following should work:

C:> set JAVA_HOME=C:/Program Files/Java/jdk1.8.0_101
C:> bazel.exe

@petemounce
Copy link
Contributor

For later reference, I'm able to work around this by

  • having my source code inside a sub directory on my separate drive (s:\whatever\here)
  • create a junction to that from inside a directory on c:
    • mklink /j c:\src\s-drive s:\whatever\here

@laszlocsomor
Copy link
Contributor

FYI I'm still working on this change, still not submitted.

@laszlocsomor
Copy link
Contributor

Submitted internally, will push it to GitHub in the next 24 hours.

@laszlocsomor
Copy link
Contributor

Looks like I made a mistake in WindowsFileSystem.java retrieving UNIX_ROOT (if you don't see that then the change is not on GitHub yet), but I sent out a fix for it. If I'm lucky we'll push both changes to GH in the same run.

@laszlocsomor
Copy link
Contributor

If not, then in the meantime the workaround will be to pass --host_jvm_args=-Dbazel.windows_unix_root="C:/tools/msys64/" to bazel.

bazel-io pushed a commit that referenced this issue Oct 18, 2016
The new subclass WindowsFileSystem.WindowsPath is
aware of Windows drives.

This change:
- introduces a new factory for Path objects so
  FileSystems can return a custom implementation
  that instantiates filesystem-specific Paths
- implements the WindowsPath subclass of Path that
  is aware of Windows drives
- introduces the bazel.windows_unix_root JVM
  argument that defines the MSYS root, which
  defines the absolute Windows path that is the
  root of all Unix paths that Bazel creates (e.g.
  "/usr/lib" -> "C:/tools/msys64/usr/lib") except
  if the path is of the form "/c/foo" which is
  treated as "C:/foo"
- removes all Windows-specific logic from Path

PathFragment is still aware of drive letters and
it has to remain so because it is unaware of file
systems.

WindowsPath restricts the allowed path strings to
absolute Unix paths where the first segment, if
any, is a volume specifier. From now on if Bazel
attempts to create a WindowsPath from an absolute
Unix path, Bazel will make it relative to
WindowsPath.UNIX_ROOT, unless the first component
is a single-letter name (e.g. "/c/foo" which is
"C:/foo").

Subclassing Path is necessary because a Unix-style
absolute path doesn't sufficiently define a full
Windows path, as it may be relative to any drive.

Fixes #1463

--
MOS_MIGRATED_REVID=136350304
bazel-io pushed a commit that referenced this issue Oct 18, 2016
Executing bash.exe directly instead of through
cmd.exe doesn't seem to work. This change fixes
that problem.

Fixes #1463 (again)

--
MOS_MIGRATED_REVID=136364606
bazel-io pushed a commit that referenced this issue Oct 19, 2016
*** Reason for rollback ***

Suspected root cause for Windows bootstrap on Bazel CI breakage:

java.lang.NullPointerException
	at com.google.devtools.build.lib.vfs.Path$1.run(Path.java:123)

http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/922/JAVA_VERSION=1.8,PLATFORM_NAME=windows-x86_64/console

*** Original change description ***

VFS, WindowsFileSystem: fix UNIX_ROOT retrieval

Executing bash.exe directly instead of through
cmd.exe doesn't seem to work. This change fixes
that problem.

Fixes #1463 (again)

--
MOS_MIGRATED_REVID=136581532
@laszlocsomor laszlocsomor reopened this Oct 20, 2016
@laszlocsomor
Copy link
Contributor

I figured out why the bootstrapping job was broken and why we had to roll this change back. The WindowsPath.translateParent call returned a different parent for top-level directories (UNIX_ROOT instead of /), but we registered the child with the old parent, not the new one.

@laszlocsomor
Copy link
Contributor

Fix is out for review, stay tuned.

@petemounce
Copy link
Contributor

@laszlocsomor Thanks! Just tried this out with 0.4.0-rc3; works great.

@petemounce
Copy link
Contributor

@laszlocsomor Actually, weirdly, this just failed from within powershell and msys2. I'm not sure how I tested, above, coming back to this.

λ bazel build //Cpp/WorkerSdk:WorkerSdk
.....
ERROR: in target '//external:jdk': no such package '@local_jdk//': com.google.devtools.build.lib.skyframe.InconsistentFilesystemException: Inconsistent filesystem operations. C:/Program Files/Java/jdk1.8.0_102 is no longer an existing directory. Did you delete it during the build? The results of the build are not guaranteed to be correct. You should probably run 'blaze clean' and investigate the filesystem inconsistency (likely due to filesytem updates concurrent with the build).
INFO: Elapsed time: 0.234s
s:\everything [feature/WIT-761-bazel-for-cpp-on-windows ≡ +2 ~2 -0 !]
λ bazel version
Build label: 0.4.0rc3
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Oct 26 13:40:38 2016 (1477489238)
Build timestamp: 1477489238
Build timestamp as int: 1477489238

@laszlocsomor
Copy link
Contributor

@petemounce : Indeed, the 0.4.0-rc3 doesn't contain this change. I assume it was rolled back at the time we cut the canary; we had to roll it back and forward a couple of times. It works for me at 9b61b0f, both under msys and powershell.

For powershell I have to set some envvars and bazel prints some errors -- i don't know if it's normal, i never used bazel under PS:

PS C:\work\bazel2> $global:PATH = $env:Path

PS C:\work\bazel2> $global:BAZEL_SH = "c:\tools\msys64\usr\bin\bash.exe"

PS C:\work\bazel2> cd d:\bazel_ws

PS D:\bazel_ws> C:/tools/msys64/var/tmp/Bazel/MGAgSgPx/execroot/bazel2/bazel-out/local-fastbuild/bin/src/bazel.exe --batch info --color=no --curses=no
ERROR: 'null' is not recognized as an internal or external command,
operable program or batch file.
 (exit code: 1)
WARNING: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
Auto-Configuration Warning: 'BAZEL_PYTHON' is not set, start looking for python in PATH.
WARNING: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
Auto-Configuration Warning: Python found at C:/Python27/python.exe
WARNING: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
Auto-Configuration Warning: 'BAZEL_VS' is not set, start looking for the latest Visual Studio installed.
WARNING: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
Auto-Configuration Warning: 'BAZEL_SH' is not set, start looking for bash in PATH.
WARNING: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
Auto-Configuration Warning: Bash binary found at C:/tools/msys64/usr/bin/bash.exe
WARNING: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/external/bazel_tools/tools/cpp/cc_configure.bzl:57:3:
Auto-Configuration Warning: Visual Studio found at C:\Program Files (x86)/Microsoft Visual Studio 14.0
bazel-bin: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/execroot/bazel_ws/bazel-out/local-fastbuild/bin
bazel-genfiles: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/execroot/bazel_ws/bazel-out/local-fastbuild/genfiles
bazel-testlogs: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/execroot/bazel_ws/bazel-out/local-fastbuild/testlogs
command_log: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/command.log
committed-heap-size: 301MB
execution_root: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/execroot/bazel_ws
gc-count: 4
gc-time: 59ms
install_base: C:/tools/msys64/var/tmp/_bazel_laszlocsomor/install/e456d4f6cf0d1a673f1ea38bb8525ecf
max-heap-size: 7621MB
message_log: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/message.log
output_base: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n
output_path: C:/tools/msys64/var/tmp/Bazel/WLSiXh7n/execroot/bazel_ws/bazel-out
package_path: %workspace%
release: development version
server_pid: 1644
used-heap-size: 73MB
workspace: D:/bazel_ws

@petemounce
Copy link
Contributor

petemounce commented Oct 31, 2016

@laszlocsomor in the docs, BAZEL_SH wants path separators to be / not \. That's what my own var is set with. Also, I set those via $env:BAZEL_SH if I do them manually within a powershell, rather than $global:BAZEL_SH.

@jdubz93
Copy link

jdubz93 commented Sep 3, 2021

still not fixed till this day. Cannot build of an sdcard on linux IOT device. Have to use sdcard because space on the board is limited. really disliking the whole java build system idea.

luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 5, 2022
    *** Reason for rollback ***

    Suspected root cause for Windows bootstrap on Bazel CI breakage:

    java.lang.NullPointerException
            at com.google.devtools.build.lib.vfs.Path$1.run(Path.java:123)

    http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/922/JAVA_VERSION=1.8,PLATFORM_NAME=windows-x86_64/console

    *** Original change description ***

    VFS, WindowsFileSystem: fix UNIX_ROOT retrieval

    Executing bash.exe directly instead of through
    cmd.exe doesn't seem to work. This change fixes
    that problem.

    Fixes bazelbuild/bazel#1463 (again)

    --
    MOS_MIGRATED_REVID=136581532
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 5, 2022
    Executing bash.exe directly instead of through
    cmd.exe doesn't seem to work. This change fixes
    that problem.

    Fixes bazelbuild/bazel#1463 (again)

    --
    MOS_MIGRATED_REVID=136364606
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