-
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
Use the new singlejar on Windows #2241
Comments
The cc implementation of singlejar actually hasn't been enabled yet. I'm enabling it except on Windows in https://bazel-review.googlesource.com/#/c/11530. I tried to enable it on Windows in patch set 3 https://bazel-review.googlesource.com/#/c/11530/3. The CI failed on Windows, and here is the error message: ERROR: C:/jenkins/workspace/gerrit-bazel-tests/bazel_version/latest/platform_name/windows-x86_64/src/tools/singlejar/BUILD:263:1: C++ compilation of rule '//src/tools/singlejar:input_jar' failed: msvc_cl.bat failed: error executing command It complains that windows is an unknown platform at this line. https://github.com/bazelbuild/bazel/blob/master/src/tools/singlejar/diag.h#L29 |
For the record, 3 reasons why SingleJar doesn't work on Windows:
|
is there updates about this? |
Hey, no updates. @dslomov: we need to set a priority for this bug and put it on our OKRs. Without having looked at the actual state of the code and just speaking from experience, I guess the migration would take me one or two weeks. @cushon: is there any deadline for Bazel-on-Windows to move away from the Java implementation? |
@laszlocsomor from my perspective it would be nice to have a single implementation when we're doing maintenance or adding new features, but I don't know of a particular deadline. |
I found out today that the Android rules in Bazel use a new feature of the C++ SingleJar that the Java SingleJar doesn't support. We'll need to reconsider the priority of this issue. /cc @dslomov |
Regarding the Android feature, we could add that to the java singlejar (and in fact I believe there is an internal pending CL to do so). However, that feature is only enabled internally for now for some reasons dealing with remote execution. So I don’t think that should impact the priority of this work |
Yea the feature is only enabled internally because it breaks remote execution. It won't be added to Bazel until recursive workspaces become supported. |
We can now compile //src/tools/singlejar:token_stream on Windows. See #2241 Change-Id: I98f86e608e5ebaf685e4de26b2dabe75fcca78d2 PiperOrigin-RevId: 185655986
Status update: I'm not actively working on this, even though it's blocking #4148. I'm currently focused on #4460, #4292, and #4319, which all seem to be more important. I'm waiting for replies to #4148 (comment) in determining whether to try and focus on this issue again. |
@laszlocsomor I currently have some patches locally that allows Porting the tests seems more challenging than porting singlejar itself. The tests are sprinkled with some bash commands inside C++ code (like running Is singlejar only used for Android development? |
Thanks!
Yes, there's a better option:
Hm, I don't know. Why do you ask? |
Thanks for solution about C++ runfiles library!
I was thinking about testing |
You're welcome! Keep in mind that this isn't a perfect solution, it just encapsulates the problem. |
`setbuffer` is not available on MSVC, use C-standard `setvbuf` from `stdio.h` instead. `setbuffer` was introduced in b4cf5e3. #2241 /cc @laszlocsomor Closes #5500. PiperOrigin-RevId: 203083781
I introduced these problems while editing the Google-internal copy of bazelbuild#6248 that was later pushed as bazelbuild@68611b3. See bazelbuild#2241 Change-Id: Icd981a0fcdcd451a00cbb2babd107f7abb4d5170
See bazelbuild#2241 Change-Id: Ic41645497e1feeb42eb726ada3417900ef239bb6
@rongjiecomputer : thanks for you awesome contributions! What's the status of the porting? IIUC SingleJar itself is fully ported, and most of the tests too, right? Btw, I just found #6512, and just sent out #6513 |
SingleJar itself is indeed fully ported. I will need to rebase #6251 and fix a few stuffs before saying that all singlejar tests pass (since my previous PR was changed quite a bit). Should I wait for #6513 to be imported first? |
Thanks for the update! If you can wait for #6513, that won't hurt, though you can also do it without I guess. But it'll be merged in 1-2 hours anyway. |
Native SingleJar is enabled for Windows in master branch. For people who are currently being blocked by this issue, please build Bazel at HEAD and test things out! |
This is fantastic news. Thank you for all your efforts @rongjiecomputer , I'm really pleased to see this getting resolved! By using the native SingleJar on Windows we can finally drop the old Java implementation and bring the Android rule support on Windows up to par with Linux and macOS. Thank you so much! |
I think c557399 resolves this issue. |
The Java implementation of singlejar has been replaced by a faster c++ implementation everywhere except Bazel on Windows.
We should use the c++ implementation on Windows, and remove support for the Java singlejar:
bazel/src/main/java/com/google/devtools/build/lib/rules/java/DeployArchiveBuilder.java
Line 269 in df03696
bazel/src/main/java/com/google/devtools/build/lib/rules/java/SingleJarActionBuilder.java
Line 65 in df03696
The text was updated successfully, but these errors were encountered: