-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
wasm: enable on Windows. #15252
wasm: enable on Windows. #15252
Conversation
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
21ade78
to
61a4087
Compare
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
61a4087
to
372b50b
Compare
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
@lizan any ideas?
|
Hi Piotr... I stood up our windows build image locally to verify... There are a half dozen envvars which bazel foreign cc cmake infers, which are not being inferred in this case (foreign make?). I'm examining why, this morning, to figure out the straight line solution. |
V8 is using a custom For example, Line 50 in 8ac28e2
before it can be used in envoy/bazel/external/wee8.genrule_cmd Lines 47 to 50 in 8ac28e2
Do you have a list of the missing env variables that should be included here? |
I'm preparing an independent patch that may let non-clang components build on windows by setting up the INCLUDE, LIB and similar variables as part of our envoy-build-tools docker image. Those are not initialized at present, since bazel and cmake components don't need them pre-declared, they are derived from bazel windows rules_cc. More info as I have it. I'm setting this up separately so the CI will incrementally show our progress towards this specific PR. |
Thanks! FWIW, we emit other values needed by |
Yes, that's one piece of it. Rebuilding envoy-build-tools with rules to extract any envvar prereqs of this genrule dependency is another. |
Just to refresh this ticket... I don't have it working, yet, but there is some interesting information if you merge main (or at this point, even rebase it) and cherry pick wrowe@4a07ec5 This at least lets us see the state of the env table to hope to decipher how the VS toolchain logic may be failing. |
I'm a bit jammed on the state of trunk trying to build bazel/external/... - can you shed any insight? |
I'm jammed trying to get //bazel/external/... built, any insight @PiotrSikora ? ERROR: error loading package '': in C:/source/bazel/repositories_extra.bzl: Label '@proxy_wasm_cpp_host//bazel/cargo:crates.bzl' is invalid because 'bazel/cargo' is not a package; perhaps you meant to put the colon here: '@proxy_wasm_cpp_host//:bazel/cargo/crates.bzl'? |
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
- Enable wee8 targets - Emit environment table on failure to detect msvc toolchain - Introduce LIB and INCLUDE bazel envvars from msvc envvars for genrule targets - Disable Google-internal DEPOT_TOOLS_WIN_TOOLCHAIN convention Signed-off-by: William A Rowe Jr <wrowe@vmware.com>
Done, thanks!
But it is a package, and it works for other builds. Perhaps you're using an outdated version of Bazel? |
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
@wrowe doesn't look like it changed anything. It hits the same assertion as before (#15252 (comment)). |
I might have a slightly out of date toolchain, but this error;
I don't know where 19041 is coming from, should remain 18362. That said... It is true that user32.lib doesn't exist, it should be in that last um/x64/ directory, but is distributed as Looks like a silly case-sensitivity bug in the script (however, the correct case should be used, because |
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
I don't think it's about case-sensitivity. V8 seems to hardcode expected VS version for consistency, and it looks that the CI is using an outdated Windows 10 SDK 10.0.18362.0 (from 2019) instead of 10.0.19041.0 (from 2020). I think I managed to revert the requirement, but we should probably upgrade the SDK. What do you think? |
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
waiting does not defeat stalebot. Still waiting on upstream or a workaround to 1 hour timeout |
@PiotrSikora @lizan @wrowe I've been working on adding Windows support to the google bazel build that was added over the summer. I got it working, and then a PR in V8 this morning completely broke the changeset. But I got far enough to check a few things. At least on windows, the bazel build took the same amount of time as the gn build, as least locally. This is mostly because the bazel build still builds everything necessary. Which makes me worry it wouldn't speed up the build enough to solve the build system problem. However, digging through the bazel build makes me realize we could probably actually do it in a different way. At least for now, we only need the wasm code. That is a much smaller subset of code. I think we actually might be better off by manually specifiying the source files needed for wasm, and basically not depend on their build at all. This is the same thing the bazel v8 build does for zlib and icu, and it seems to work well. I'm going to try this out and see if its feasible. If so, I think that might be a better solution for us to discuss. Otherwise, even with a bazel build we'd likely have to get better build systesm. |
@thhous-msft If you have a good way to disentangle the wee8 target to the rest of the V8 codebase, I am happy to upstream the change. The only reason wee8 depends of the entire V8 is that no one took the time to separate the dependencies. Ideally one would want to have this separation expressed in GN as well. Otherwise, we would accidentally introduce dependencies in the future. |
That's expected, since both build systems use exactly the same compiler to compile exactly the same source code. However, that's not an issue. The biggest problem we have with V8 is that Bazel sees the GN build as a single task and dispatches it to a single machine on RBE, whereas with native Bazel support, each file would be dispatched as a separate task.
I think you're underestimating how intermingled Wasm is with JavaScript support in V8. Perhaps you're misguided by the small list of files (guarded by We've talked about having Wasm-only build in the past (mostly to lower the binary size), so that would be amazing if you want to work on that, but it's definitely a lot more work than selecting a small subset of files to compile. |
I started working on the separate wasm build, but yeah I determined that wasn't helpful, everything still had to be built. So back to trying to get the bazel build inside of the V8 repo to work again on Windows. @victorgomes This was the issue I emailed you about last week. I still haven't found a solution to that. Still trying to see if I can get any more verbose logs. Bazel is unfamiliar to me so the error is cryptic. Maybe someone else on this issue can help with the error. Below is the error I get, which is very unhelpful, because it doesn't give any help in what is actually failing.
|
I figured out the issue. Its a bug in bazel. I reported the issue to them as bazelbuild/bazel#14237 I can find a workaround on windows with alias's I think. I'll try. |
The code for doing this was merged into upstream V8 on Monday. So it seems like we have all the bazel support we need to finish this up. It looks like some custom scripts were used to package the existing v8 build and push it to a server. Who owns that script and would be able to rerun it against current upstream main? |
Done: You can generate this archive yourself using wee8-archive.sh linked in bazel/repository_locations.bzl. Note that the |
Thank you! and yeah I know we likely want to wait until beta to merge, but at least now we can test the build. |
Apparently bazel doesn't support recursive workspaces. And the v8 build declares 3 dependent folders with |
I did some digging, and there no solution right now to new_local_respository with http downloaded dependencies. You can't get the dependency folder until its too late in the process. |
@thhous-msft Bazel doesn't support recursive WORKSPACEs, but as of now there are only two local repositories in V8:
so this shouldn't be an issue at all, but need to patch btw: I generated a tarball for the branched |
There's also a 3rd workspace loaded currently. All the configuration files are loaded from a 3rd workspace. https://chromium.googlesource.com/v8/v8/+/refs/heads/main/WORKSPACE#19 I figured I could solve the zlib one, but I couldn't figure out how to solve that one. I was doing all this testing outside of envoy, as the envoy build took too long to be useful for testing this. So I don't have a Work in Progress PR for envoy itself. I can try doing one in January. |
Ah, I had v9.6 checked out locally and I didn't notice |
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
This reverts commit 7c1bdf4. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
@wrowe @thhous-msft @lizan @phlax any ideas why Bazel cannot find |
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
I'm abandoning this change. The remaining changes should be minimal, but trying to debug this using CI is not productive. |
Signed-off-by: Piotr Sikora piotrsikora@google.com