-
Notifications
You must be signed in to change notification settings - Fork 207
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
Fail to build on Windows #27
Comments
This is likely down to path seperator issues. I’ll try my best to fix them but I do not have a windows machine to test with. PR welcome :) |
It will be a while till I get around to this, waiting on the Bazel CI system to support windows. Also #40 prints pretty colours to the console -- need to find a suitable lib or something in Bazel core that abstracts console printing. |
@hsyed what's the blocker here? We do support Windows on Buildkite. |
@hsyed I'm trying to have a look at this but I have trouble connecting the dots. Is the https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt file supposed to somehow "fix" the classpath when running a command? Is it not possible to check if we are on a windows or on a linux machine to change the separator in the piece of code you linked in the other thread? I suppose that would be a hack? rules_kotlin/kotlin/internal/utils.bzl Line 187 in 740b962
|
@IljaKroonen You are very brave ! If you are planning to work on the code I should push my current refactors. I've completely reorganized the skylark code. There is an issue open in bazel core -- I couldn't figure out how to debug this particular script, it's like magic. I had to park the task and delete windows from virtualbox (80 gigs!). It does more than just path replacements, it compensates for the lack of symlinks in windows. I'll try to help you as best as I can but I recommend chasing up the issue in bazel core. |
@IljaKroonen ok I've just pushed my current refactor changes. |
@hsyed I'm new to bazel and I'm having trouble navigating all of this. Until now I haven't really observed the java_stub_template.txt file not working - it seems it is used many times successfuly. Instead, one thing I have trouble undestanding is how _fold_jars_action is supposed to work (or _maybe_make_srcsjar_action for that matter)
In my environment, ctx.executable._singlejar is a jar file. Bazel tries to use CreateProcessW with the jar as a target, which fails because jar files are not executables. I fail to see how that could work on Linux.
I'll be trying to setup a linux box to compare behavior. EDIT: I hacked it to run to run the jar with java (IljaKroonen@dbb69d8), I now see the problem with the template :) |
@alex-chung Cool ! Things have moved on quite a bit since the WIP pr. I've been working on making the builder testable without the rules. Those tests are in here If you want you could get these tests green on windows. Very little changes should be required for this, just ensuring that the right path separators are used when joining classpath is all that is required. We can merge this in and then look at the changes needed to the rules. WDYT ? |
@hsyed Sounds good. I noticed something while trying to hack your macro in I'll take another look this evening. EDIT: https://docs.bazel.build/versions/master/be/make-variables.html says temporary variables should be written to $(@d), which seems to fix this issue. The current error i'm encountering is:
|
@IljaKroonen strange. I had the builder building correctly with the changes here Give that version a try -- it looks more idiomatic compared to the current one. |
My new laptop arrived. I'll start the lengthy process of installing windows in virtualbox again. |
the temp jar issue is likely ocuring because the file is unknown to Bazel. I just create it in the genrule without declaring it. The temp jar is only needed because I am normalizing the jar created by the kotlin compiler. Normalization is not needed here so i'll remove it for now. i'll cherry pick some of the changes from wip after I get an environment up. stay tuned. |
@buchgr @cushon I'm trying to cherry pick previous windows fixes into the main branch. I am using bazel 0.16.1 and have tried both msys2 and cmd. This is the target I want to build:
I can't even do a fetch on a something in
the workspace Any idea what the problem might be ? I am going to try bazel 0.15.2. |
@hsyed I don't think I ever saw this error, can you please give me a commit hash I can checkout to try and reproduce this? |
@IljaKroonen current master should give you the error p.s., I don't have a jdk installed, but I don't think that is needed. |
@hsyed On master, I get the following output for both commands:
And when doing the other command:
I am on windows 1803. I also have symlinks enabled on my computer, could that make a difference? And of course as you mentionned, I got plenty of stuff installed on it, including a JDK. Probably unrelated because I don't think it gets called here, but java is called directly from the template in |
Apologies, I was not using the latest version I got this:
|
ok it's because I am trying to do this over a mapped virtualbox drive. sigh. |
So, with the following changes: I got to the point where I can start making the builder tests work on windows. The list of issues I know of so far are:
|
I started looking at JdepsParser. It looks like in this case, the main code is windows compatible, but not the test.
I'll try to find some time tomorrow to fix the test. |
@IljaKroonen I've fixed the tests, i'll integrate your changes to bootstrap.bzl and commit it tomorrow. |
|
@cushon what is the best way to execute singlejar in a portable way ? Single Jar JVM version seems to have different semantics -- I can't add stamp lines to the jar (see above). I used [this] approach for the bootstrap scripts. |
Update README.md
Update README.md
When I run
bazel build //examples/dagger:coffee_app
on Windows 10, it fails with the following error message:Error: Could not find or load main class org.jetbrains.kotlin.preloading.Preloader
I am running Bazel 0.10.1.
The text was updated successfully, but these errors were encountered: