-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Comments
Assigning to @dslomov who has more knowledge about Windows. CC @kchodorow |
I'm seeing the same error here when trying to build 89484da . |
I am able to compile bazel tags Sample output:
(There's also a reference to running I should mention - that JDK directory definitely exists. To try to eliminate the space in the
Where is it that bazel is deciding to use that JDK if not the |
Hi, I have the same problem when trying to build 7b5e1af |
Same here, trying to build Bazel
and on subsequent calls to
|
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 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. |
@petemounce Yes, installed. Didn't try it though because I need Windows binaries. |
This is also an issue for me on Windows 10, using the nightly built here
|
We were able to repro this when a workspace is not on |
Yes, my source is on my s: drive. Good thought! |
Yes , my workspace is on d:. |
Same, sources on D: |
@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? |
@tomzx how did you create the symlink (ie, exact command)? There are a couple of different types on Windows, with differing characteristics. |
@petemounce IIRC, |
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? |
FTR i just did
I'll dive into that part of the code and see what I find. |
c484f19: When I run bazel commands on my I tested this by running 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 |
@petemounce : Thanks for reporting it. I'm seeing the same. Looking for the root cause and fixing soon. |
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. 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 No These factors lead to more problems down the road, for example in
Which means that we attempt to evaluate |
One more factor: when a |
Out for review. If all goes well, we can push the fix to GH today or tomorrow. |
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. |
Hey @petemounce , it's not yet submitted, sorry about that. It should be in today or Monday, if not I'll ping this thread. |
seems java.exe path problem set JAVA_HOME=C:/Program\ Files/Java/jdk1.8.0_101&c:\bazel.exe |
@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.
|
For later reference, I'm able to work around this by
|
FYI I'm still working on this change, still not submitted. |
Submitted internally, will push it to GitHub in the next 24 hours. |
Looks like I made a mistake in WindowsFileSystem.java retrieving |
If not, then in the meantime the workaround will be to pass |
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
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
*** 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
I figured out why the bootstrapping job was broken and why we had to roll this change back. The |
Fix is out for review, stay tuned. |
@laszlocsomor Thanks! Just tried this out with 0.4.0-rc3; works great. |
@laszlocsomor Actually, weirdly, this just failed from within powershell and msys2. I'm not sure how I tested, above, coming back to this.
|
@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:
|
@laszlocsomor in the docs, BAZEL_SH wants path separators to be |
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. |
*** 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
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
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!
The text was updated successfully, but these errors were encountered: