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

Allow building for wasm32-wasi target using Bazel. #50

Merged
merged 1 commit into from
Nov 7, 2020

Conversation

PiotrSikora
Copy link
Member

While there, update Bazel to 3.7.0.

Signed-off-by: Piotr Sikora piotrsikora@google.com

While there, update Bazel to 3.7.0.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
@PiotrSikora PiotrSikora requested a review from gbrail November 6, 2020 01:51
@PiotrSikora PiotrSikora marked this pull request as ready for review November 6, 2020 01:51
Copy link
Contributor

@gbrail gbrail left a comment

Choose a reason for hiding this comment

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

This is fine but are we sure we're ready to change the default target in .bazelrc?

# Force Bazel to use --target=wasm32-unknown-unknown.
build --platforms=@io_bazel_rules_rust//rust/platform:wasm
# Force Bazel to use --target=wasm32-wasi
build --platforms=@io_bazel_rules_rust//rust/platform:wasi
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we ready to change this by default? I've only ever used Rust and Wasm with the "wasm32-unknown-unknown" target and I'm not sure how well WASI works.

Copy link
Member Author

Choose a reason for hiding this comment

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

Proxy-Wasm C++ SDK (Emscripten) already emits WASI calls, and we have the basic ones implemented in Envoy already (e.g. wasi_args_get, wasi_environ_get, wasi_fd_write, wasi_proc_exit, and more recently wasi_clock_get_time and wasi_random_get).

We're not losing any functionality by switching to it, and only gaining access to features exposed by WASI-capable crates (see: #51).

Copy link
Member Author

Choose a reason for hiding this comment

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

Does the change to default make sense for you?

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense to me -- when I built locally I also got an import of some super long mangled name, but perhaps thats' changed. As long as WASI builds work with a recent Envoy then I think this change is fine.

@PiotrSikora PiotrSikora merged commit b8921ba into proxy-wasm:master Nov 7, 2020
unleashed added a commit to 3scale/proxy-wasm-rust-sdk that referenced this pull request Nov 13, 2020
* upstream/master:
  Use cargo-raze's gen_buildrs for trusted crates. (proxy-wasm#53)
  Show getrandom and chrono/time usage in examples. (proxy-wasm#51)
  Allow building for wasm32-wasi target using Bazel. (proxy-wasm#50)
  Update cargo-raze to latest and regenerate artifacts. (proxy-wasm#47)
  Update rules_rust to latest. (proxy-wasm#46)
nullpo-head pushed a commit to nullpo-head/proxy-wasm-rust-sdk that referenced this pull request Mar 2, 2021
While there, update Bazel to 3.7.0.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
yskopets added a commit to yskopets/proxy-wasm-rust-sdk that referenced this pull request Mar 2, 2021
* Use Rust toolchains with working components. (#16)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Split licenses check into a separate test target. (#17)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Help other developers get started using this SDK. (#15)

Signed-off-by: DazWilkin <daz.wilkin@gmail.com>

* Add Bazel support. (#18)

Signed-off-by: Shikugawa <Shikugawa@gmail.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting HTTP bodies. (#2)

Signed-off-by: Gregory Brail <gregbrail@google.com>

* Release v0.1.1. (#20)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update MapType values to match updated Proxy-Wasm ABI v0.1.0. (#7)

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>

* Release v0.1.2. (#21)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown to v0.8.2. (#22)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add cargo audit and cargo outdated checks. (#23)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update chrono to v0.4.15. (proxy-wasm#33)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move optional checks to the end. (proxy-wasm#28)

While there, align style with the test framework.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move Bazel to //bazel. (proxy-wasm#29)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Fix HTTP body example. (proxy-wasm#32)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting network buffers. (proxy-wasm#31)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add metrics. (proxy-wasm#30)

Fixes #4.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown and transitive dependencies. (proxy-wasm#45)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target. (proxy-wasm#42)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Make wee-alloc an optional feature. (proxy-wasm#38)

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>

* Update rules_rust to latest. (proxy-wasm#46)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update cargo-raze to latest and regenerate artifacts. (proxy-wasm#47)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target using Bazel. (proxy-wasm#50)

While there, update Bazel to 3.7.0.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Show getrandom and chrono/time usage in examples. (proxy-wasm#51)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Use cargo-raze's gen_buildrs for trusted crates. (proxy-wasm#53)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for nested HTTP callouts. (proxy-wasm#56)

Signed-off-by: Svetlin Zarev <svetlin.zarev@sap.com>

* Allow RootContext to create child contexts for streams. (proxy-wasm#34)

Fixes #6.

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>

* Fix warnings from Clippy v1.50.0 (nightly). (proxy-wasm#58)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Release v0.1.3. (proxy-wasm#59)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup instructions for updating dependencies. (proxy-wasm#60)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup WORKSPACE. (proxy-wasm#61)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup examples. (proxy-wasm#62)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update libc (transitive dependency) to v0.2.81. (proxy-wasm#63)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update the declared ABI version to 0.2.0

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update the examples so that they use the latest API

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Remove ChildContext for now, which is not used anymore

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Bump the version to 0.0.8

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix bazel build for the fork's crate

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix clippy erros in bytestring.rs

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update dependencies

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix Cargo.toml

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* outdated should check only root deps

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix inconsistent derived traits

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

Co-authored-by: Piotr Sikora <piotrsikora@google.com>
Co-authored-by: Daz Wilkin <DazWilkin@users.noreply.github.com>
Co-authored-by: Greg Brail <gbrail@users.noreply.github.com>
Co-authored-by: Yaroslav Skopets <y.skopets@gmail.com>
Co-authored-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Co-authored-by: SvetlinZarev-SAP <43135961+SvetlinZarev-SAP@users.noreply.github.com>
Co-authored-by: Daniel Grimm <dgrimm@redhat.com>
github-actions bot pushed a commit to yskopets/proxy-wasm-rust-sdk that referenced this pull request Mar 2, 2021
* Use Rust toolchains with working components. (#16)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Split licenses check into a separate test target. (#17)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Help other developers get started using this SDK. (#15)

Signed-off-by: DazWilkin <daz.wilkin@gmail.com>

* Add Bazel support. (#18)

Signed-off-by: Shikugawa <Shikugawa@gmail.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting HTTP bodies. (#2)

Signed-off-by: Gregory Brail <gregbrail@google.com>

* Release v0.1.1. (#20)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update MapType values to match updated Proxy-Wasm ABI v0.1.0. (#7)

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>

* Release v0.1.2. (#21)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown to v0.8.2. (#22)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add cargo audit and cargo outdated checks. (#23)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update chrono to v0.4.15. (proxy-wasm#33)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move optional checks to the end. (proxy-wasm#28)

While there, align style with the test framework.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move Bazel to //bazel. (proxy-wasm#29)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Fix HTTP body example. (proxy-wasm#32)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting network buffers. (proxy-wasm#31)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add metrics. (proxy-wasm#30)

Fixes #4.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown and transitive dependencies. (proxy-wasm#45)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target. (proxy-wasm#42)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Make wee-alloc an optional feature. (proxy-wasm#38)

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>

* Update rules_rust to latest. (proxy-wasm#46)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update cargo-raze to latest and regenerate artifacts. (proxy-wasm#47)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target using Bazel. (proxy-wasm#50)

While there, update Bazel to 3.7.0.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Show getrandom and chrono/time usage in examples. (proxy-wasm#51)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Use cargo-raze's gen_buildrs for trusted crates. (proxy-wasm#53)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for nested HTTP callouts. (proxy-wasm#56)

Signed-off-by: Svetlin Zarev <svetlin.zarev@sap.com>

* Allow RootContext to create child contexts for streams. (proxy-wasm#34)

Fixes #6.

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>

* Fix warnings from Clippy v1.50.0 (nightly). (proxy-wasm#58)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Release v0.1.3. (proxy-wasm#59)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup instructions for updating dependencies. (proxy-wasm#60)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup WORKSPACE. (proxy-wasm#61)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup examples. (proxy-wasm#62)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update libc (transitive dependency) to v0.2.81. (proxy-wasm#63)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update the declared ABI version to 0.2.0

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update the examples so that they use the latest API

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Remove ChildContext for now, which is not used anymore

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Bump the version to 0.0.8

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix bazel build for the fork's crate

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix clippy erros in bytestring.rs

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update dependencies

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix Cargo.toml

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* outdated should check only root deps

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix inconsistent derived traits

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

Co-authored-by: Piotr Sikora <piotrsikora@google.com>
Co-authored-by: Daz Wilkin <DazWilkin@users.noreply.github.com>
Co-authored-by: Greg Brail <gbrail@users.noreply.github.com>
Co-authored-by: Yaroslav Skopets <y.skopets@gmail.com>
Co-authored-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Co-authored-by: SvetlinZarev-SAP <43135961+SvetlinZarev-SAP@users.noreply.github.com>
Co-authored-by: Daniel Grimm <dgrimm@redhat.com>
github-actions bot pushed a commit to nullpo-head/proxy-wasm-rust-sdk that referenced this pull request Apr 20, 2021
…opets#19)

* Use Rust toolchains with working components. (yskopets#16)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Split licenses check into a separate test target. (yskopets#17)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Help other developers get started using this SDK. (yskopets#15)

Signed-off-by: DazWilkin <daz.wilkin@gmail.com>

* Add Bazel support. (yskopets#18)

Signed-off-by: Shikugawa <Shikugawa@gmail.com>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting HTTP bodies. (yskopets#2)

Signed-off-by: Gregory Brail <gregbrail@google.com>

* Release v0.1.1. (yskopets#20)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update MapType values to match updated Proxy-Wasm ABI v0.1.0. (yskopets#7)

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>

* Release v0.1.2. (yskopets#21)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown to v0.8.2. (yskopets#22)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add cargo audit and cargo outdated checks. (yskopets#23)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update chrono to v0.4.15. (proxy-wasm#33)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move optional checks to the end. (proxy-wasm#28)

While there, align style with the test framework.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Move Bazel to //bazel. (proxy-wasm#29)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Fix HTTP body example. (proxy-wasm#32)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for setting network buffers. (proxy-wasm#31)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add metrics. (proxy-wasm#30)

Fixes yskopets#4.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update hashbrown and transitive dependencies. (proxy-wasm#45)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target. (proxy-wasm#42)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Make wee-alloc an optional feature. (proxy-wasm#38)

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>

* Update rules_rust to latest. (proxy-wasm#46)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update cargo-raze to latest and regenerate artifacts. (proxy-wasm#47)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Allow building for wasm32-wasi target using Bazel. (proxy-wasm#50)

While there, update Bazel to 3.7.0.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Show getrandom and chrono/time usage in examples. (proxy-wasm#51)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Use cargo-raze's gen_buildrs for trusted crates. (proxy-wasm#53)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Add support for nested HTTP callouts. (proxy-wasm#56)

Signed-off-by: Svetlin Zarev <svetlin.zarev@sap.com>

* Allow RootContext to create child contexts for streams. (proxy-wasm#34)

Fixes yskopets#6.

Signed-off-by: Daniel Grimm <dgrimm@redhat.com>

* Fix warnings from Clippy v1.50.0 (nightly). (proxy-wasm#58)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Release v0.1.3. (proxy-wasm#59)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup instructions for updating dependencies. (proxy-wasm#60)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup WORKSPACE. (proxy-wasm#61)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Cleanup examples. (proxy-wasm#62)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update libc (transitive dependency) to v0.2.81. (proxy-wasm#63)

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

* Update the declared ABI version to 0.2.0

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update the examples so that they use the latest API

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Remove ChildContext for now, which is not used anymore

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Bump the version to 0.0.8

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix bazel build for the fork's crate

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix clippy erros in bytestring.rs

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Update dependencies

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix Cargo.toml

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* outdated should check only root deps

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

* Fix inconsistent derived traits

Signed-off-by: Takaya Saeki <takaya@tetrate.io>

Co-authored-by: Piotr Sikora <piotrsikora@google.com>
Co-authored-by: Daz Wilkin <DazWilkin@users.noreply.github.com>
Co-authored-by: Greg Brail <gbrail@users.noreply.github.com>
Co-authored-by: Yaroslav Skopets <y.skopets@gmail.com>
Co-authored-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Co-authored-by: SvetlinZarev-SAP <43135961+SvetlinZarev-SAP@users.noreply.github.com>
Co-authored-by: Daniel Grimm <dgrimm@redhat.com>
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.

2 participants