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

Update wasmtime (v24.0.0) #406

Merged
merged 14 commits into from
Sep 4, 2024
Merged

Conversation

keithmattix
Copy link
Contributor

Builds on top of #404 and #402

@martijneken
Copy link
Contributor

martijneken commented Aug 11, 2024

Ran CI. Looks like:

  • bazel/dependencies.bzl needs formatting
  • diffs in cargo vendor:
    • run bazelisk run //bazel/cargo/wasmsign:crates_vendor -- --repin
    • run bazelisk run //bazel/cargo/wasmtime:crates_vendor -- --repin
    • commit above changes
  • CI unhappy (rust panics) with --define engine=v8 and --define engine=wasmtime (might be fixed by above)

bazel/external/rules_rust.patch Outdated Show resolved Hide resolved
bazel/dependencies.bzl Outdated Show resolved Hide resolved
@martijneken
Copy link
Contributor

martijneken commented Aug 12, 2024

Looks like buildifier and wasmtime remain. Wasmtime build error:

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ld.lld: error: undefined symbol: wasm_module_new
>>> referenced by wasmtime.cc
>>>               wasmtime.o:(proxy_wasm::wasmtime::Wasmtime::load(std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::unordered_map<unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::hash<unsigned int>, std::__1::equal_to<unsigned int>, std::__1::allocator<std::__1::pair<unsigned int const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&)) in archive bazel-out/k8-fastbuild/bin/libwasmtime_lib.a

@keithmattix
Copy link
Contributor Author

Yep iterating on it locally. I suspect The wasmtime build failure is related to the fact that wasmtime no longer vendors WASM-c-api so I'm figuring out how to make the new pathing with Bazel

@PiotrSikora
Copy link
Member

Yep iterating on it locally. I suspect The wasmtime build failure is related to the fact that wasmtime no longer vendors WASM-c-api so I'm figuring out how to make the new pathing with Bazel

wasm-c-api is still vendored in Wasmtime (wheras previously it was imported as git submodule).

compile_commands.json Outdated Show resolved Hide resolved
.vscode/settings.json Outdated Show resolved Hide resolved
@keithmattix
Copy link
Contributor Author

keithmattix commented Aug 13, 2024

Looks like CI is pretty much passing except for buildifier (I have the fix staged locally) and this random windows failure. I wonder if it's related to #368 (comment)

@keithmattix
Copy link
Contributor Author

Getting closer....I tried to repro the Windows issue on a local machine but no dice (rust-lld isn't happy for whatever reason). If anyone has a clue what's happening please let me know. I should also mention that Windows isn't actively supported in Envoy anymore; not sure what proxy-wasm's stance is on Windows

image

@keithmattix
Copy link
Contributor Author

Looks like rules_rust no longer aims to support Windows: https://github.com/bazelbuild/rules_rust/blob/main/docs/index.md#supported-platforms. The current Windows failure seems to be a weird interaction with the Windows linker and path escaping: all of the file paths be linked use a combination of backslashes and escaped forward slashes

bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/cu__wasmtime-versioned-export-macros-23.0.1\wasmtime_versioned_export_macros-1891060849.wasmtime_versioned_export_macros.92cc13fa569db95f-cgu.[0-9].rcgu.o

but the final error has all forward slashes

note: LINK : fatal error LNK1181: cannot open input file 'bazel-out\x64_windows-opt-exec-2B5CBBC6\bin\external\cu__wasmtime-versioned-export-macros-23.0.1\wasmtime_versioned_export_macros-1891060849.wasmtime_versioned_export_macros.92cc13fa569db95f-cgu.0.rcgu.o'

@PiotrSikora @martijneken @mpwarres can you advise on the support goals for Wasmtime windows in this repo? With Envoy and rules_rust turning down CI, does it make sense to do the same here?

@martijneken
Copy link
Contributor

martijneken commented Aug 14, 2024

I don't feel strongly about supporting Wasmtime for Windows, since our dependencies don't support it. Could we keep NullVM on Windows (no Rust, passing) while ditching Wasmtime on Windows (depends on Rust)? @PiotrSikora WDYT

@PiotrSikora
Copy link
Member

Could we keep NullVM on Windows (no Rust, passing) while ditching Wasmtime on Windows (depends on Rust)?

There is a big gap here - all Wasm engines other than Wasmtime. Notably, Wasmtime on Windows is the only build on the CI executing real WasmVM code paths (because it is the fastest to compile), so it would be helpful to add tests using another Wasm engine on Windows, before removing Wasmtime on Windows... assuming that you want to support it at all.

cc @shukitchan for ATS, which relies on proxy-wasm-cpp-host.

@keithmattix
Copy link
Contributor Author

If any other proxy implementations have windows expertise, I'd appreciate the help/guidance!

Copy link
Member

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking as usual, but could this be split into rules_rust update followed by Wasmtime update?

.gitignore Outdated Show resolved Hide resolved
@keithmattix
Copy link
Contributor Author

Nitpicking as usual, but could this be split into rules_rust update followed by Wasmtime update?

I can give it a try

@keithmattix
Copy link
Contributor Author

#410 opened. @mpwarres @PiotrSikora @martijneken can one of you kick off CI?

@PiotrSikora
Copy link
Member

Could you rebase this on top of main branch and update Wasmtime to v24.0.0? Thanks!

martijneken and others added 5 commits August 21, 2024 13:26
This requires extracting WORKSPACE phases into more phases:
- dependencies -- py_repositories() and toolchains
- dependencies_python() -- pip_parse module loading
- dependencies_import() -- python/fuzzing/other deps

The new structure roughly matches Envoy WORKSPACE:
- envoy_dependencies()
- envoy_dependencies_extra() -- not needed here
- envoy_python_dependencies()
- envoy_dependency_imports()

Signed-off-by: Martijn Stevenson <mstevenson@google.com>
Signed-off-by: Martijn Stevenson <mstevenson@google.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
@keithmattix keithmattix changed the title Update wasmtime and Rust Update wasmtime (v24.0.0) Aug 21, 2024
@keithmattix
Copy link
Contributor Author

CI looks mostly good after the rebase + update. @PiotrSikora @mpwarres @martijneken what's the final verdict on Windows support?

@PiotrSikora
Copy link
Member

PiotrSikora commented Aug 22, 2024

@PiotrSikora @mpwarres @martijneken what's the final verdict on Windows support?

I think it would be useful to have something working, even if it's not Wasmtime, but I don't have a horse in this race, so the final decision is up to @mpwarres and @martijneken who are the current maintainers.

@mpwarres
Copy link
Contributor

CI looks mostly good after the rebase + update. @PiotrSikora @mpwarres @martijneken what's the final verdict on Windows support?

My individual opinion is that the same considerations that led Bazel and Envoy to drop support for Windows CI (insufficient Windows expertise + lack of resources to track down Windows issues) apply here as well, plus the way that we build Wasmtime depends on rules_rust which no longer supports Windows, so we'd be on shaky ground. I'm in favor of dropping the Wasmtime Windows CI action, but keeping NullVm as a safeguard against total bitrot on Windows, leaving the option of reintroducing support in the future should circumstances change. @martijneken WDYT?

@keithmattix
Copy link
Contributor Author

Looks like WAMR on windows still passes in CI (confirmed in #413). Can I get some reviews on that and I'll rebase once that merges

Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
bazel/cargo/wasmtime/Cargo.toml Show resolved Hide resolved
bazel/cargo/wasmtime/Cargo.toml Outdated Show resolved Hide resolved
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
Copy link
Member

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

bazel/cargo/wasmtime/Cargo.toml Show resolved Hide resolved
@keithmattix
Copy link
Contributor Author

keithmattix commented Aug 30, 2024

@mpwarres @martijneken is this in a good enough state to merge?

Copy link
Contributor

@martijneken martijneken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the wasmtime-windows CI action as required. Should be good to merge now.

@martijneken martijneken merged commit 21a5b08 into proxy-wasm:main Sep 4, 2024
30 checks passed
@@ -1,60 +0,0 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke builds with --define=engine=multi, see #418.

@keithmattix keithmattix deleted the update-wasmtime branch September 26, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants