From 861b33b9fd4e976713cf1059a396a3d2b68165ad Mon Sep 17 00:00:00 2001 From: Takaya Saeki Date: Wed, 3 Mar 2021 08:25:39 +0900 Subject: [PATCH] Update the ABI to version 0.2.0 so that it works with Envoy 1.17 (#19) * Use Rust toolchains with working components. (#16) Signed-off-by: Piotr Sikora * Split licenses check into a separate test target. (#17) Signed-off-by: Piotr Sikora * Help other developers get started using this SDK. (#15) Signed-off-by: DazWilkin * Add Bazel support. (#18) Signed-off-by: Shikugawa Signed-off-by: Piotr Sikora * Add support for setting HTTP bodies. (#2) Signed-off-by: Gregory Brail * Release v0.1.1. (#20) Signed-off-by: Piotr Sikora * Update MapType values to match updated Proxy-Wasm ABI v0.1.0. (#7) Signed-off-by: Yaroslav Skopets * Release v0.1.2. (#21) Signed-off-by: Piotr Sikora * Update hashbrown to v0.8.2. (#22) Signed-off-by: Piotr Sikora * Add cargo audit and cargo outdated checks. (#23) Signed-off-by: Piotr Sikora * Update chrono to v0.4.15. (#33) Signed-off-by: Piotr Sikora * Move optional checks to the end. (#28) While there, align style with the test framework. Signed-off-by: Piotr Sikora * Move Bazel to //bazel. (#29) Signed-off-by: Piotr Sikora * Fix HTTP body example. (#32) Signed-off-by: Piotr Sikora * Add support for setting network buffers. (#31) Signed-off-by: Piotr Sikora * Add metrics. (#30) Fixes #4. Signed-off-by: Piotr Sikora * Update hashbrown and transitive dependencies. (#45) Signed-off-by: Piotr Sikora * Allow building for wasm32-wasi target. (#42) Signed-off-by: Piotr Sikora * Make wee-alloc an optional feature. (#38) Signed-off-by: Yuval Kohavi * Update rules_rust to latest. (#46) Signed-off-by: Piotr Sikora * Update cargo-raze to latest and regenerate artifacts. (#47) Signed-off-by: Piotr Sikora * Allow building for wasm32-wasi target using Bazel. (#50) While there, update Bazel to 3.7.0. Signed-off-by: Piotr Sikora * Show getrandom and chrono/time usage in examples. (#51) Signed-off-by: Piotr Sikora * Use cargo-raze's gen_buildrs for trusted crates. (#53) Signed-off-by: Piotr Sikora * Add support for nested HTTP callouts. (#56) Signed-off-by: Svetlin Zarev * Allow RootContext to create child contexts for streams. (#34) Fixes #6. Signed-off-by: Daniel Grimm * Fix warnings from Clippy v1.50.0 (nightly). (#58) Signed-off-by: Piotr Sikora * Release v0.1.3. (#59) Signed-off-by: Piotr Sikora * Cleanup instructions for updating dependencies. (#60) Signed-off-by: Piotr Sikora * Cleanup WORKSPACE. (#61) Signed-off-by: Piotr Sikora * Cleanup examples. (#62) Signed-off-by: Piotr Sikora * Update libc (transitive dependency) to v0.2.81. (#63) Signed-off-by: Piotr Sikora * Update the declared ABI version to 0.2.0 Signed-off-by: Takaya Saeki * Update the examples so that they use the latest API Signed-off-by: Takaya Saeki * Remove ChildContext for now, which is not used anymore Signed-off-by: Takaya Saeki * Bump the version to 0.0.8 Signed-off-by: Takaya Saeki * Fix bazel build for the fork's crate Signed-off-by: Takaya Saeki * Fix clippy erros in bytestring.rs Signed-off-by: Takaya Saeki * Update dependencies Signed-off-by: Takaya Saeki * Fix Cargo.toml Signed-off-by: Takaya Saeki * outdated should check only root deps Signed-off-by: Takaya Saeki * Fix inconsistent derived traits Signed-off-by: Takaya Saeki Co-authored-by: Piotr Sikora Co-authored-by: Daz Wilkin Co-authored-by: Greg Brail Co-authored-by: Yaroslav Skopets Co-authored-by: Yuval Kohavi Co-authored-by: SvetlinZarev-SAP <43135961+SvetlinZarev-SAP@users.noreply.github.com> Co-authored-by: Daniel Grimm --- .bazelrc | 2 + .bazelversion | 1 + .github/workflows/rust.yml | 364 ++++++++++----- .gitignore | 3 +- BUILD | 12 + CHANGELOG.md | 44 ++ Cargo.toml | 36 +- README.md | 22 + WORKSPACE | 9 + bazel/BUILD | 0 bazel/cargo/BUILD.bazel | 76 +++ bazel/cargo/Cargo.lock | 396 ++++++++++++++++ bazel/cargo/crates.bzl | 442 ++++++++++++++++++ bazel/cargo/remote/BUILD.ahash-0.4.7.bazel | 62 +++ bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel | 62 +++ bazel/cargo/remote/BUILD.bazel | 0 bazel/cargo/remote/BUILD.bitflags-1.2.1.bazel | 55 +++ bazel/cargo/remote/BUILD.bstr-0.2.14.bazel | 76 +++ .../cargo/remote/BUILD.byteorder-1.4.2.bazel | 54 +++ bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel | 54 +++ bazel/cargo/remote/BUILD.chrono-0.4.19.bazel | 87 ++++ .../remote/BUILD.form_urlencoded-1.0.0.bazel | 54 +++ .../cargo/remote/BUILD.getrandom-0.2.2.bazel | 102 ++++ .../cargo/remote/BUILD.hashbrown-0.9.1.bazel | 66 +++ bazel/cargo/remote/BUILD.idna-0.2.0.bazel | 59 +++ .../remote/BUILD.lazy_static-1.4.0.bazel | 56 +++ bazel/cargo/remote/BUILD.libc-0.2.85.bazel | 86 ++++ bazel/cargo/remote/BUILD.log-0.4.14.bazel | 87 ++++ bazel/cargo/remote/BUILD.matches-0.1.8.bazel | 54 +++ bazel/cargo/remote/BUILD.memchr-2.3.4.bazel | 57 +++ .../remote/BUILD.num-integer-0.1.44.bazel | 65 +++ .../remote/BUILD.num-traits-0.2.14.bazel | 56 +++ .../remote/BUILD.percent-encoding-2.1.0.bazel | 52 +++ .../remote/BUILD.proc-macro2-1.0.24.bazel | 68 +++ .../remote/BUILD.pulldown-cmark-0.7.2.bazel | 98 ++++ bazel/cargo/remote/BUILD.quote-1.0.8.bazel | 58 +++ bazel/cargo/remote/BUILD.regex-1.4.3.bazel | 92 ++++ .../remote/BUILD.regex-automata-0.1.9.bazel | 55 +++ .../remote/BUILD.regex-syntax-0.6.22.bazel | 62 +++ .../remote/BUILD.semver-parser-0.9.0.bazel | 52 +++ bazel/cargo/remote/BUILD.serde-1.0.123.bazel | 56 +++ bazel/cargo/remote/BUILD.syn-1.0.60.bazel | 121 +++++ bazel/cargo/remote/BUILD.time-0.1.43.bazel | 64 +++ bazel/cargo/remote/BUILD.tinyvec-1.1.1.bazel | 62 +++ .../remote/BUILD.tinyvec_macros-0.1.0.bazel | 52 +++ bazel/cargo/remote/BUILD.toml-0.5.8.bazel | 62 +++ bazel/cargo/remote/BUILD.unicase-2.6.0.bazel | 54 +++ .../remote/BUILD.unicode-bidi-0.3.4.bazel | 54 +++ .../BUILD.unicode-normalization-0.1.16.bazel | 57 +++ .../remote/BUILD.unicode-xid-0.2.1.bazel | 55 +++ bazel/cargo/remote/BUILD.url-2.2.0.bazel | 58 +++ .../remote/BUILD.version-sync-0.9.1.bazel | 61 +++ .../remote/BUILD.version_check-0.9.2.bazel | 52 +++ ...D.wasi-0.10.2+wasi-snapshot-preview1.bazel | 54 +++ bazel/cargo/remote/BUILD.winapi-0.3.9.bazel | 61 +++ ...ILD.winapi-i686-pc-windows-gnu-0.4.0.bazel | 54 +++ ...D.winapi-x86_64-pc-windows-gnu-0.4.0.bazel | 54 +++ bazel/dependencies.bzl | 20 + bazel/repositories.bzl | 23 + examples/BUILD | 66 +++ examples/hello_world.rs | 18 +- examples/http_body.rs | 72 +++ examples/http_config.rs | 70 +++ examples/http_headers.rs | 18 +- src/allocator.rs | 12 +- src/bytestring.rs | 4 +- src/dispatcher.rs | 133 +++--- src/hostcalls.rs | 63 +++ src/lib.rs | 4 +- src/traits.rs | 34 +- src/types.rs | 15 + 71 files changed, 4487 insertions(+), 232 deletions(-) create mode 100644 .bazelrc create mode 100644 .bazelversion create mode 100644 BUILD create mode 100644 WORKSPACE create mode 100644 bazel/BUILD create mode 100644 bazel/cargo/BUILD.bazel create mode 100644 bazel/cargo/Cargo.lock create mode 100644 bazel/cargo/crates.bzl create mode 100644 bazel/cargo/remote/BUILD.ahash-0.4.7.bazel create mode 100644 bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel create mode 100644 bazel/cargo/remote/BUILD.bazel create mode 100644 bazel/cargo/remote/BUILD.bitflags-1.2.1.bazel create mode 100644 bazel/cargo/remote/BUILD.bstr-0.2.14.bazel create mode 100644 bazel/cargo/remote/BUILD.byteorder-1.4.2.bazel create mode 100644 bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel create mode 100644 bazel/cargo/remote/BUILD.chrono-0.4.19.bazel create mode 100644 bazel/cargo/remote/BUILD.form_urlencoded-1.0.0.bazel create mode 100644 bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel create mode 100644 bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel create mode 100644 bazel/cargo/remote/BUILD.idna-0.2.0.bazel create mode 100644 bazel/cargo/remote/BUILD.lazy_static-1.4.0.bazel create mode 100644 bazel/cargo/remote/BUILD.libc-0.2.85.bazel create mode 100644 bazel/cargo/remote/BUILD.log-0.4.14.bazel create mode 100644 bazel/cargo/remote/BUILD.matches-0.1.8.bazel create mode 100644 bazel/cargo/remote/BUILD.memchr-2.3.4.bazel create mode 100644 bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel create mode 100644 bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel create mode 100644 bazel/cargo/remote/BUILD.percent-encoding-2.1.0.bazel create mode 100644 bazel/cargo/remote/BUILD.proc-macro2-1.0.24.bazel create mode 100644 bazel/cargo/remote/BUILD.pulldown-cmark-0.7.2.bazel create mode 100644 bazel/cargo/remote/BUILD.quote-1.0.8.bazel create mode 100644 bazel/cargo/remote/BUILD.regex-1.4.3.bazel create mode 100644 bazel/cargo/remote/BUILD.regex-automata-0.1.9.bazel create mode 100644 bazel/cargo/remote/BUILD.regex-syntax-0.6.22.bazel create mode 100644 bazel/cargo/remote/BUILD.semver-parser-0.9.0.bazel create mode 100644 bazel/cargo/remote/BUILD.serde-1.0.123.bazel create mode 100644 bazel/cargo/remote/BUILD.syn-1.0.60.bazel create mode 100644 bazel/cargo/remote/BUILD.time-0.1.43.bazel create mode 100644 bazel/cargo/remote/BUILD.tinyvec-1.1.1.bazel create mode 100644 bazel/cargo/remote/BUILD.tinyvec_macros-0.1.0.bazel create mode 100644 bazel/cargo/remote/BUILD.toml-0.5.8.bazel create mode 100644 bazel/cargo/remote/BUILD.unicase-2.6.0.bazel create mode 100644 bazel/cargo/remote/BUILD.unicode-bidi-0.3.4.bazel create mode 100644 bazel/cargo/remote/BUILD.unicode-normalization-0.1.16.bazel create mode 100644 bazel/cargo/remote/BUILD.unicode-xid-0.2.1.bazel create mode 100644 bazel/cargo/remote/BUILD.url-2.2.0.bazel create mode 100644 bazel/cargo/remote/BUILD.version-sync-0.9.1.bazel create mode 100644 bazel/cargo/remote/BUILD.version_check-0.9.2.bazel create mode 100644 bazel/cargo/remote/BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel create mode 100644 bazel/cargo/remote/BUILD.winapi-0.3.9.bazel create mode 100644 bazel/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel create mode 100644 bazel/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel create mode 100644 bazel/dependencies.bzl create mode 100644 bazel/repositories.bzl create mode 100644 examples/BUILD create mode 100644 examples/http_body.rs create mode 100644 examples/http_config.rs diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 00000000..38ca0fbf --- /dev/null +++ b/.bazelrc @@ -0,0 +1,2 @@ +# Force Bazel to use --target=wasm32-wasi +build --platforms=@io_bazel_rules_rust//rust/platform:wasi diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 00000000..7c69a55d --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +3.7.0 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b7d242ad..d36fd619 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,174 +15,284 @@ name: Rust on: - pull_request: branches: - - '**' + - "**" push: branches: - - proxy-wasm-spec-0.1.0 + - proxy-wasm-spec-0.1.0 tags: - - '**' + - "**" + + schedule: + - cron: "0 0 * * *" jobs: + licenses: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Check licenses + run: | + go get -u github.com/google/addlicense + export PATH=$PATH:$(go env GOPATH)/bin + addlicense -check . + + bazel: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Cache + uses: actions/cache@v2 + with: + path: | + ~/.cache/bazel + ~/.cache/bazelisk + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/bin + ~/.cargo/registry + key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} + + - name: Build (wasm32-unknown-unknown) + run: bazelisk --bazelrc=/dev/null build --platforms=@io_bazel_rules_rust//rust/platform:wasm //... + + - name: Build (wasm32-wasi) + run: bazelisk --bazelrc=/dev/null build --platforms=@io_bazel_rules_rust//rust/platform:wasi //... + + - name: Format (buildifier) + run: | + GO111MODULE=on go get -u github.com/bazelbuild/buildtools/buildifier@3.4.0 + export PATH=$PATH:$(go env GOPATH)/bin + buildifier -mode=check WORKSPACE + buildifier -mode=check BUILD + buildifier -mode=check examples/BUILD + + - name: Format (cargo raze) + run: | + cargo install cargo-raze --version 0.7.0 + cp -p bazel/cargo/Cargo.lock . + rm -rf bazel/cargo/ + cargo raze --output=bazel/cargo + mv Cargo.lock bazel/cargo/ + git diff --exit-code stable: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Update Rust - run: | - rustup update - rustup target add wasm32-unknown-unknown + - name: Update Rust + run: | + rustup toolchain install stable --component clippy --component rustfmt + rustup target add wasm32-unknown-unknown + rustup target add wasm32-wasi - - name: Build - env: - RUSTFLAGS: -C link-args=-S -D warnings - run: cargo build --target=wasm32-unknown-unknown --release --all-targets + - name: Build (wasm32-unknown-unknown) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo build --release --all-targets --target=wasm32-unknown-unknown - - name: Format (clippy) - env: - RUSTFLAGS: -C link-args=-S -D warnings - run: cargo clippy --target=wasm32-unknown-unknown --release --all-targets + - name: Clippy (wasm32-unknown-unknown) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown - - name: Format (rustfmt) - run: cargo fmt -- --check + - name: Build (wasm32-wasi) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo build --release --all-targets --target=wasm32-wasi - - name: Format (manifest) - run: cargo verify-project + - name: Build (wasm32-wasi with wee-alloc) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo build --release --all-targets --target=wasm32-wasi --features=wee-alloc - - name: Format (addlicense) - run: | - go get -u github.com/google/addlicense - export PATH=$PATH:$(go env GOPATH)/bin - addlicense -check . + - name: Clippy (wasm32-wasi) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo clippy --release --all-targets --target=wasm32-wasi - - name: Package (docs) - run: cargo doc --no-deps --target=wasm32-unknown-unknown + - name: Clippy (wasm32-wasi with wee-alloc) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo clippy --release --all-targets --target=wasm32-wasi --features=wee-alloc - - name: Package (publish) - run: cargo publish --dry-run --target=wasm32-unknown-unknown + - name: Format (rustfmt) + run: cargo fmt -- --check + + - name: Format (manifest) + run: cargo verify-project + + - name: Package (docs) + run: cargo doc --no-deps --target=wasm32-unknown-unknown + + - name: Package (publish) + run: cargo publish --dry-run --target=wasm32-unknown-unknown nightly: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Update Rust - run: | - rustup toolchain install nightly - rustup target add --toolchain nightly wasm32-unknown-unknown - rustup component add --toolchain nightly clippy rustfmt - - - name: Build - env: - RUSTFLAGS: -C link-args=-S -D warnings - run: cargo +nightly build --target=wasm32-unknown-unknown --release --all-targets + - uses: actions/checkout@v2 + + - name: Update Rust + run: | + rustup toolchain install nightly --component clippy --component rustfmt + rustup +nightly target add wasm32-unknown-unknown + rustup +nightly target add wasm32-wasi + rustup default nightly + + - name: Build (wasm32-unknown-unknown) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo build --release --all-targets --target=wasm32-unknown-unknown + + - name: Clippy (wasm32-unknown-unknown) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown + + - name: Build (wasm32-wasi) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo build --release --all-targets --target=wasm32-wasi + + - name: Build (wasm32-wasi with wee-alloc) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo build --release --all-targets --target=wasm32-wasi --features=wee-alloc + + - name: Clippy (wasm32-wasi) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo clippy --release --all-targets --target=wasm32-wasi + + - name: Clippy (wasm32-wasi with wee-alloc) + env: + RUSTFLAGS: -D warnings -C link-args=-S + run: cargo clippy --release --all-targets --target=wasm32-wasi --features=wee-alloc + + - name: Format (rustfmt) + run: cargo fmt -- --check + + - name: Format (manifest) + run: cargo verify-project + + - name: Package (docs) + run: cargo doc --no-deps --target=wasm32-unknown-unknown + + - name: Package (publish) + run: cargo publish --dry-run --target=wasm32-unknown-unknown + + outdated: + runs-on: ubuntu-latest - - name: Format (clippy) - env: - RUSTFLAGS: -C link-args=-S -D warnings - run: cargo +nightly clippy --target=wasm32-unknown-unknown --release --all-targets + steps: + - uses: actions/checkout@v2 - - name: Format (rustfmt) - run: cargo +nightly fmt -- --check + - name: Run cargo outdated + run: cargo outdated --root-deps-only --exit-code 1 - - name: Format (manifest) - run: cargo +nightly verify-project + - name: Check freshness of bazel/cargo/Cargo.lock + run: | + cargo generate-lockfile + mv Cargo.lock bazel/cargo/ + git diff --exit-code - - name: Format (addlicense) - run: | - go get -u github.com/google/addlicense - export PATH=$PATH:$(go env GOPATH)/bin - addlicense -check . + audit: + runs-on: ubuntu-latest - - name: Package (docs) - run: cargo +nightly doc --no-deps --target=wasm32-unknown-unknown + steps: + - uses: actions/checkout@v2 - - name: Package (publish) - run: cargo +nightly publish --dry-run --target=wasm32-unknown-unknown + - name: Run cargo audit + run: | + cp -p bazel/cargo/Cargo.lock . + cargo audit docs: name: "Docs" runs-on: ubuntu-latest steps: - - name: "Checkout" - uses: actions/checkout@v2 - - - name: "Install Rust" - run: | - rustup update stable - rustup default stable - rustc -vV - - - name: "Install 'wasm32-unknown-unknown'" - run: | - rustup target add wasm32-unknown-unknown - - - name: "Build docs" - run: | - cargo doc --no-deps --target=wasm32-unknown-unknown - - - name: "Publish GitHub Pages" - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/proxy-wasm-spec-0.1.0' }} - run: | - git fetch origin gh-pages # By default, 'actions/checkout' only fetches branch of the commit. - git worktree add /tmp/rustdoc gh-pages # Checkout 'gh-pages' branch into '/tmp/rustdoc' - rm -rf /tmp/rustdoc/* # Remove all files (except for hidden files, such as .git directory) - cp -rp target/wasm32-unknown-unknown/doc/* /tmp/rustdoc/ - cd /tmp/rustdoc - git add --all # This adds, modifies, and removes index entries to match the working tree. - if ! git diff --cached --exit-code ; then # There might be no changes to commit - GIT_AUTHOR_NAME="${{ github.event.head_commit.author.name }}" \ - GIT_AUTHOR_EMAIL="${{ github.event.head_commit.author.email }}" \ - GIT_AUTHOR_DATE="${{ github.event.head_commit.timestamp }}" \ - GIT_COMMITTER_NAME="${{ github.event.head_commit.committer.name }}" \ - GIT_COMMITTER_EMAIL="${{ github.event.head_commit.committer.email }}" \ - GIT_COMMITTER_DATE="${{ github.event.head_commit.timestamp }}" \ - git commit -m "${{ github.event.head_commit.message }}" - git push origin gh-pages - else - echo "There are no changes to GitHub Pages." - fi - git worktree remove --force /tmp/rustdoc # Remove the working tree. + - name: "Checkout" + uses: actions/checkout@v2 + + - name: "Install Rust" + run: | + rustup update stable + rustup default stable + rustc -vV + + - name: "Install 'wasm32-unknown-unknown'" + run: | + rustup target add wasm32-unknown-unknown + + - name: "Build docs" + run: | + cargo doc --no-deps --target=wasm32-unknown-unknown + + - name: "Publish GitHub Pages" + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/proxy-wasm-spec-0.1.0' }} + run: | + git fetch origin gh-pages # By default, 'actions/checkout' only fetches branch of the commit. + git worktree add /tmp/rustdoc gh-pages # Checkout 'gh-pages' branch into '/tmp/rustdoc' + rm -rf /tmp/rustdoc/* # Remove all files (except for hidden files, such as .git directory) + cp -rp target/wasm32-unknown-unknown/doc/* /tmp/rustdoc/ + cd /tmp/rustdoc + git add --all # This adds, modifies, and removes index entries to match the working tree. + if ! git diff --cached --exit-code ; then # There might be no changes to commit + GIT_AUTHOR_NAME="${{ github.event.head_commit.author.name }}" \ + GIT_AUTHOR_EMAIL="${{ github.event.head_commit.author.email }}" \ + GIT_AUTHOR_DATE="${{ github.event.head_commit.timestamp }}" \ + GIT_COMMITTER_NAME="${{ github.event.head_commit.committer.name }}" \ + GIT_COMMITTER_EMAIL="${{ github.event.head_commit.committer.email }}" \ + GIT_COMMITTER_DATE="${{ github.event.head_commit.timestamp }}" \ + git commit -m "${{ github.event.head_commit.message }}" + git push origin gh-pages + else + echo "There are no changes to GitHub Pages." + fi + git worktree remove --force /tmp/rustdoc # Remove the working tree. publish: name: "Publish Crate" if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} needs: - - stable - - nightly + - stable + - nightly runs-on: ubuntu-latest steps: - - name: "Checkout" - uses: actions/checkout@v2 - - - name: "Install Rust" - run: | - rustup update stable - rustup default stable - rustc -vV - - - name: "Install 'wasm32-unknown-unknown'" - run: | - rustup target add wasm32-unknown-unknown - - - name: "Check version" - run: | - version="$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | .version')" - tag="${GITHUB_REF##*/}" - if [[ "$version" != "$tag" ]]; then - echo "Package version according to Cargo.toml ($version) is different from the Git tag ($tag). Did you forget to bump the version in Cargo.toml ?" - exit 1 - fi - - - name: "Publish" - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} - run: | - cargo publish --target=wasm32-unknown-unknown + - name: "Checkout" + uses: actions/checkout@v2 + + - name: "Install Rust" + run: | + rustup update stable + rustup default stable + rustc -vV + + - name: "Install 'wasm32-unknown-unknown'" + run: | + rustup target add wasm32-unknown-unknown + + - name: "Check version" + run: | + version="$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | .version')" + tag="${GITHUB_REF##*/}" + if [[ "$version" != "$tag" ]]; then + echo "Package version according to Cargo.toml ($version) is different from the Git tag ($tag). Did you forget to bump the version in Cargo.toml ?" + exit 1 + fi + + - name: "Publish" + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + run: | + cargo publish --target=wasm32-unknown-unknown diff --git a/.gitignore b/.gitignore index 96ef6c0b..baee4113 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +/bazel-* /target -Cargo.lock +/Cargo.lock diff --git a/BUILD b/BUILD new file mode 100644 index 00000000..f6296901 --- /dev/null +++ b/BUILD @@ -0,0 +1,12 @@ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library") + +rust_library( + name = "proxy_wasm_experimental", + srcs = glob(["src/*.rs"]), + edition = "2018", + visibility = ["//visibility:public"], + deps = [ + "//bazel/cargo:hashbrown", + "//bazel/cargo:log", + ], +) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90a7c213..3c9ca036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,52 @@ # Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +## [0.1.3] - 2020-12-04 + +### Fixed + +- Fixed support for nested HTTP callouts. + Thanks [@SvetlinZarev](https://github.com/SvetlinZarev)! + +### Changed + +- Changed `wee-alloc` to an optional feature. + Thanks [@yuval-k](https://github.com/yuval-k)! + +### Added + +- Added support for building for `wasm32-wasi` target. +- Added support for metrics. +- Added support for `RootContext` to create child contexts for streams. + Thanks [@dgn](https://github.com/dgn)! +- Added support for setting network buffers. + +## [0.1.2] - 2020-08-05 + +### Changed + +- Updated `MapType` values to match updated Proxy-Wasm ABI v0.1.0. + Thanks [@yskopets](https://github.com/yskopets)! + +## [0.1.1] - 2020-08-05 + +### Added + +- Added support for building with Bazel. +- Added support for setting HTTP bodies. + Thanks [@gbrail](https://github.com/gbrail)! + ## [0.1.0] - 2020-02-29 +### Added + - Initial release. +[0.1.3]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/compare/v0.1.0...v0.1.1 [0.1.0]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/releases/tag/v0.1.0 diff --git a/Cargo.toml b/Cargo.toml index 92c5e574..df318dd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proxy-wasm-experimental" -version = "0.0.7" +version = "0.0.8" authors = ["Piotr Sikora ", "Yaroslav Skopets "] description = "WebAssembly for Proxies" readme = "README.md" @@ -8,21 +8,41 @@ license = "Apache-2.0" repository = "https://github.com/yskopets/proxy-wasm-rust-sdk" edition = "2018" +[features] +wee-alloc = ["wee_alloc"] + [dependencies] -hashbrown = { version = "0.7", default-features = false, features = ["ahash", "inline-more"] } +hashbrown = "0.9" log = "0.4" -wee_alloc = "0.4" +wee_alloc = { version = "0.4", optional = true } [dev-dependencies] version-sync = "0.9" +cfg-if = "1.0" chrono = "0.4" bstr = "0.2" +[target.'cfg(not(all(target_arch = "wasm32", target_os = "unknown")))'.dev-dependencies] +getrandom = "0.2" + [profile.release] lto = true opt-level = 3 panic = "abort" +[package.metadata.raze] +workspace_path = "//bazel/cargo" +genmode = "Remote" + +[package.metadata.raze.crates.getrandom.'=0.2.0'] +gen_buildrs = true + +[package.metadata.raze.crates.libc.'=0.2.85'] +gen_buildrs = true + +[package.metadata.raze.crates.log.'=0.4.14'] +gen_buildrs = true + [[example]] name = "hello_world" path = "examples/hello_world.rs" @@ -37,3 +57,13 @@ crate-type = ["cdylib"] name = "http_headers" path = "examples/http_headers.rs" crate-type = ["cdylib"] + +[[example]] +name = "http_body" +path = "examples/http_body.rs" +crate-type = ["cdylib"] + +[[example]] +name = "http_config" +path = "examples/http_config.rs" +crate-type = ["cdylib"] diff --git a/README.md b/README.md index b11f4231..2e6d7eb9 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,25 @@ [docs-link]: https://docs.rs/proxy-wasm-experimental [license-badge]: https://img.shields.io/github/license/proxy-wasm/proxy-wasm-rust-sdk [license-link]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk/blob/master/LICENSE + +## Examples + ++ [Hello World](./examples/hello_world.rs) ++ [HTTP Auth random](./examples/http_auth_random.rs) ++ [HTTP Headers](./examples/http_headers.rs) + +## Articles & blog posts from the community + ++ [Extending Envoy with WASM and Rust](https://antweiss.com/blog/extending-envoy-with-wasm-and-rust/) ++ [Extending Istio with Rust and WebAssembly](https://blog.red-badger.com/extending-istio-with-rust-and-webassembly) + +## Updating dependencies + +When updating dependencies, you need to regenerate Bazel `BUILD` files to match updated `Cargo.toml`: +``` +cargo install cargo-raze --version 0.7.0 +rm -rf bazel/cargo/ +cargo generate-lockfile +cargo raze --output=bazel/cargo +mv Cargo.lock bazel/cargo/ +``` diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 00000000..4261aeed --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,9 @@ +workspace(name = "proxy_wasm_rust_sdk") + +load("@proxy_wasm_rust_sdk//bazel:repositories.bzl", "proxy_wasm_rust_sdk_repositories") + +proxy_wasm_rust_sdk_repositories() + +load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies") + +proxy_wasm_rust_sdk_dependencies() diff --git a/bazel/BUILD b/bazel/BUILD new file mode 100644 index 00000000..e69de29b diff --git a/bazel/cargo/BUILD.bazel b/bazel/cargo/BUILD.bazel new file mode 100644 index 00000000..161ba0f4 --- /dev/null +++ b/bazel/cargo/BUILD.bazel @@ -0,0 +1,76 @@ +""" +@generated +cargo-raze generated Bazel file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +package(default_visibility = ["//visibility:public"]) + +licenses([ + "notice", # See individual crates for specific licenses +]) + +# Aliased targets +alias( + name = "bstr", + actual = "@raze__bstr__0_2_14//:bstr", + tags = [ + "cargo-raze", + "manual", + ], +) + +alias( + name = "cfg_if", + actual = "@raze__cfg_if__1_0_0//:cfg_if", + tags = [ + "cargo-raze", + "manual", + ], +) + +alias( + name = "chrono", + actual = "@raze__chrono__0_4_19//:chrono", + tags = [ + "cargo-raze", + "manual", + ], +) + +alias( + name = "getrandom", + actual = "@raze__getrandom__0_2_2//:getrandom", + tags = [ + "cargo-raze", + "manual", + ], +) + +alias( + name = "hashbrown", + actual = "@raze__hashbrown__0_9_1//:hashbrown", + tags = [ + "cargo-raze", + "manual", + ], +) + +alias( + name = "log", + actual = "@raze__log__0_4_14//:log", + tags = [ + "cargo-raze", + "manual", + ], +) + +alias( + name = "version_sync", + actual = "@raze__version_sync__0_9_1//:version_sync", + tags = [ + "cargo-raze", + "manual", + ], +) diff --git a/bazel/cargo/Cargo.lock b/bazel/cargo/Cargo.lock new file mode 100644 index 00000000..3ce9e842 --- /dev/null +++ b/bazel/cargo/Cargo.lock @@ -0,0 +1,396 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "ahash" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bstr" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", +] + +[[package]] +name = "byteorder" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "time", + "winapi", +] + +[[package]] +name = "form_urlencoded" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +dependencies = [ + "ahash", +] + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3" + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" + +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "proxy-wasm-experimental" +version = "0.0.8" +dependencies = [ + "bstr", + "cfg-if 1.0.0", + "chrono", + "getrandom", + "hashbrown", + "log", + "version-sync", + "wee_alloc", +] + +[[package]] +name = "pulldown-cmark" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca36dea94d187597e104a5c8e4b07576a8a45aa5db48a65e12940d3eb7461f55" +dependencies = [ + "bitflags", + "memchr", + "unicase", +] + +[[package]] +name = "quote" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +dependencies = [ + "byteorder", +] + +[[package]] +name = "regex-syntax" +version = "0.6.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" + +[[package]] +name = "semver-parser" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46e1121e8180c12ff69a742aabc4f310542b6ccb69f1691689ac17fdf8618aa" + +[[package]] +name = "serde" +version = "1.0.123" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" + +[[package]] +name = "syn" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "tinyvec" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "toml" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +dependencies = [ + "serde", +] + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +dependencies = [ + "matches", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "url" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "version-sync" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7b77d2a6f56988f7bb54102fe73ab963df4e7374b58298a7efa1361f681e0e2" +dependencies = [ + "proc-macro2", + "pulldown-cmark", + "regex", + "semver-parser", + "syn", + "toml", + "url", +] + +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/bazel/cargo/crates.bzl b/bazel/cargo/crates.bzl new file mode 100644 index 00000000..895acd87 --- /dev/null +++ b/bazel/cargo/crates.bzl @@ -0,0 +1,442 @@ +""" +@generated +cargo-raze generated Bazel file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") # buildifier: disable=load +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # buildifier: disable=load +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") # buildifier: disable=load + +def raze_fetch_remote_crates(): + """This function defines a collection of repos and should be called in a WORKSPACE file""" + maybe( + http_archive, + name = "raze__ahash__0_4_7", + url = "https://crates.io/api/v1/crates/ahash/0.4.7/download", + type = "tar.gz", + sha256 = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e", + strip_prefix = "ahash-0.4.7", + build_file = Label("//bazel/cargo/remote:BUILD.ahash-0.4.7.bazel"), + ) + + maybe( + http_archive, + name = "raze__autocfg__1_0_1", + url = "https://crates.io/api/v1/crates/autocfg/1.0.1/download", + type = "tar.gz", + sha256 = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a", + strip_prefix = "autocfg-1.0.1", + build_file = Label("//bazel/cargo/remote:BUILD.autocfg-1.0.1.bazel"), + ) + + maybe( + http_archive, + name = "raze__bitflags__1_2_1", + url = "https://crates.io/api/v1/crates/bitflags/1.2.1/download", + type = "tar.gz", + sha256 = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693", + strip_prefix = "bitflags-1.2.1", + build_file = Label("//bazel/cargo/remote:BUILD.bitflags-1.2.1.bazel"), + ) + + maybe( + http_archive, + name = "raze__bstr__0_2_14", + url = "https://crates.io/api/v1/crates/bstr/0.2.14/download", + type = "tar.gz", + sha256 = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf", + strip_prefix = "bstr-0.2.14", + build_file = Label("//bazel/cargo/remote:BUILD.bstr-0.2.14.bazel"), + ) + + maybe( + http_archive, + name = "raze__byteorder__1_4_2", + url = "https://crates.io/api/v1/crates/byteorder/1.4.2/download", + type = "tar.gz", + sha256 = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b", + strip_prefix = "byteorder-1.4.2", + build_file = Label("//bazel/cargo/remote:BUILD.byteorder-1.4.2.bazel"), + ) + + maybe( + http_archive, + name = "raze__cfg_if__1_0_0", + url = "https://crates.io/api/v1/crates/cfg-if/1.0.0/download", + type = "tar.gz", + sha256 = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd", + strip_prefix = "cfg-if-1.0.0", + build_file = Label("//bazel/cargo/remote:BUILD.cfg-if-1.0.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__chrono__0_4_19", + url = "https://crates.io/api/v1/crates/chrono/0.4.19/download", + type = "tar.gz", + sha256 = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73", + strip_prefix = "chrono-0.4.19", + build_file = Label("//bazel/cargo/remote:BUILD.chrono-0.4.19.bazel"), + ) + + maybe( + http_archive, + name = "raze__form_urlencoded__1_0_0", + url = "https://crates.io/api/v1/crates/form_urlencoded/1.0.0/download", + type = "tar.gz", + sha256 = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00", + strip_prefix = "form_urlencoded-1.0.0", + build_file = Label("//bazel/cargo/remote:BUILD.form_urlencoded-1.0.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__getrandom__0_2_2", + url = "https://crates.io/api/v1/crates/getrandom/0.2.2/download", + type = "tar.gz", + sha256 = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8", + strip_prefix = "getrandom-0.2.2", + build_file = Label("//bazel/cargo/remote:BUILD.getrandom-0.2.2.bazel"), + ) + + maybe( + http_archive, + name = "raze__hashbrown__0_9_1", + url = "https://crates.io/api/v1/crates/hashbrown/0.9.1/download", + type = "tar.gz", + sha256 = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04", + strip_prefix = "hashbrown-0.9.1", + build_file = Label("//bazel/cargo/remote:BUILD.hashbrown-0.9.1.bazel"), + ) + + maybe( + http_archive, + name = "raze__idna__0_2_0", + url = "https://crates.io/api/v1/crates/idna/0.2.0/download", + type = "tar.gz", + sha256 = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9", + strip_prefix = "idna-0.2.0", + build_file = Label("//bazel/cargo/remote:BUILD.idna-0.2.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__lazy_static__1_4_0", + url = "https://crates.io/api/v1/crates/lazy_static/1.4.0/download", + type = "tar.gz", + sha256 = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646", + strip_prefix = "lazy_static-1.4.0", + build_file = Label("//bazel/cargo/remote:BUILD.lazy_static-1.4.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__libc__0_2_85", + url = "https://crates.io/api/v1/crates/libc/0.2.85/download", + type = "tar.gz", + sha256 = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3", + strip_prefix = "libc-0.2.85", + build_file = Label("//bazel/cargo/remote:BUILD.libc-0.2.85.bazel"), + ) + + maybe( + http_archive, + name = "raze__log__0_4_14", + url = "https://crates.io/api/v1/crates/log/0.4.14/download", + type = "tar.gz", + sha256 = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710", + strip_prefix = "log-0.4.14", + build_file = Label("//bazel/cargo/remote:BUILD.log-0.4.14.bazel"), + ) + + maybe( + http_archive, + name = "raze__matches__0_1_8", + url = "https://crates.io/api/v1/crates/matches/0.1.8/download", + type = "tar.gz", + sha256 = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08", + strip_prefix = "matches-0.1.8", + build_file = Label("//bazel/cargo/remote:BUILD.matches-0.1.8.bazel"), + ) + + maybe( + http_archive, + name = "raze__memchr__2_3_4", + url = "https://crates.io/api/v1/crates/memchr/2.3.4/download", + type = "tar.gz", + sha256 = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525", + strip_prefix = "memchr-2.3.4", + build_file = Label("//bazel/cargo/remote:BUILD.memchr-2.3.4.bazel"), + ) + + maybe( + http_archive, + name = "raze__num_integer__0_1_44", + url = "https://crates.io/api/v1/crates/num-integer/0.1.44/download", + type = "tar.gz", + sha256 = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db", + strip_prefix = "num-integer-0.1.44", + build_file = Label("//bazel/cargo/remote:BUILD.num-integer-0.1.44.bazel"), + ) + + maybe( + http_archive, + name = "raze__num_traits__0_2_14", + url = "https://crates.io/api/v1/crates/num-traits/0.2.14/download", + type = "tar.gz", + sha256 = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290", + strip_prefix = "num-traits-0.2.14", + build_file = Label("//bazel/cargo/remote:BUILD.num-traits-0.2.14.bazel"), + ) + + maybe( + http_archive, + name = "raze__percent_encoding__2_1_0", + url = "https://crates.io/api/v1/crates/percent-encoding/2.1.0/download", + type = "tar.gz", + sha256 = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e", + strip_prefix = "percent-encoding-2.1.0", + build_file = Label("//bazel/cargo/remote:BUILD.percent-encoding-2.1.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__proc_macro2__1_0_24", + url = "https://crates.io/api/v1/crates/proc-macro2/1.0.24/download", + type = "tar.gz", + sha256 = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71", + strip_prefix = "proc-macro2-1.0.24", + build_file = Label("//bazel/cargo/remote:BUILD.proc-macro2-1.0.24.bazel"), + ) + + maybe( + http_archive, + name = "raze__pulldown_cmark__0_7_2", + url = "https://crates.io/api/v1/crates/pulldown-cmark/0.7.2/download", + type = "tar.gz", + sha256 = "ca36dea94d187597e104a5c8e4b07576a8a45aa5db48a65e12940d3eb7461f55", + strip_prefix = "pulldown-cmark-0.7.2", + build_file = Label("//bazel/cargo/remote:BUILD.pulldown-cmark-0.7.2.bazel"), + ) + + maybe( + http_archive, + name = "raze__quote__1_0_8", + url = "https://crates.io/api/v1/crates/quote/1.0.8/download", + type = "tar.gz", + sha256 = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df", + strip_prefix = "quote-1.0.8", + build_file = Label("//bazel/cargo/remote:BUILD.quote-1.0.8.bazel"), + ) + + maybe( + http_archive, + name = "raze__regex__1_4_3", + url = "https://crates.io/api/v1/crates/regex/1.4.3/download", + type = "tar.gz", + sha256 = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a", + strip_prefix = "regex-1.4.3", + build_file = Label("//bazel/cargo/remote:BUILD.regex-1.4.3.bazel"), + ) + + maybe( + http_archive, + name = "raze__regex_automata__0_1_9", + url = "https://crates.io/api/v1/crates/regex-automata/0.1.9/download", + type = "tar.gz", + sha256 = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4", + strip_prefix = "regex-automata-0.1.9", + build_file = Label("//bazel/cargo/remote:BUILD.regex-automata-0.1.9.bazel"), + ) + + maybe( + http_archive, + name = "raze__regex_syntax__0_6_22", + url = "https://crates.io/api/v1/crates/regex-syntax/0.6.22/download", + type = "tar.gz", + sha256 = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581", + strip_prefix = "regex-syntax-0.6.22", + build_file = Label("//bazel/cargo/remote:BUILD.regex-syntax-0.6.22.bazel"), + ) + + maybe( + http_archive, + name = "raze__semver_parser__0_9_0", + url = "https://crates.io/api/v1/crates/semver-parser/0.9.0/download", + type = "tar.gz", + sha256 = "b46e1121e8180c12ff69a742aabc4f310542b6ccb69f1691689ac17fdf8618aa", + strip_prefix = "semver-parser-0.9.0", + build_file = Label("//bazel/cargo/remote:BUILD.semver-parser-0.9.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__serde__1_0_123", + url = "https://crates.io/api/v1/crates/serde/1.0.123/download", + type = "tar.gz", + sha256 = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae", + strip_prefix = "serde-1.0.123", + build_file = Label("//bazel/cargo/remote:BUILD.serde-1.0.123.bazel"), + ) + + maybe( + http_archive, + name = "raze__syn__1_0_60", + url = "https://crates.io/api/v1/crates/syn/1.0.60/download", + type = "tar.gz", + sha256 = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081", + strip_prefix = "syn-1.0.60", + build_file = Label("//bazel/cargo/remote:BUILD.syn-1.0.60.bazel"), + ) + + maybe( + http_archive, + name = "raze__time__0_1_43", + url = "https://crates.io/api/v1/crates/time/0.1.43/download", + type = "tar.gz", + sha256 = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438", + strip_prefix = "time-0.1.43", + build_file = Label("//bazel/cargo/remote:BUILD.time-0.1.43.bazel"), + ) + + maybe( + http_archive, + name = "raze__tinyvec__1_1_1", + url = "https://crates.io/api/v1/crates/tinyvec/1.1.1/download", + type = "tar.gz", + sha256 = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023", + strip_prefix = "tinyvec-1.1.1", + build_file = Label("//bazel/cargo/remote:BUILD.tinyvec-1.1.1.bazel"), + ) + + maybe( + http_archive, + name = "raze__tinyvec_macros__0_1_0", + url = "https://crates.io/api/v1/crates/tinyvec_macros/0.1.0/download", + type = "tar.gz", + sha256 = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c", + strip_prefix = "tinyvec_macros-0.1.0", + build_file = Label("//bazel/cargo/remote:BUILD.tinyvec_macros-0.1.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__toml__0_5_8", + url = "https://crates.io/api/v1/crates/toml/0.5.8/download", + type = "tar.gz", + sha256 = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa", + strip_prefix = "toml-0.5.8", + build_file = Label("//bazel/cargo/remote:BUILD.toml-0.5.8.bazel"), + ) + + maybe( + http_archive, + name = "raze__unicase__2_6_0", + url = "https://crates.io/api/v1/crates/unicase/2.6.0/download", + type = "tar.gz", + sha256 = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6", + strip_prefix = "unicase-2.6.0", + build_file = Label("//bazel/cargo/remote:BUILD.unicase-2.6.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__unicode_bidi__0_3_4", + url = "https://crates.io/api/v1/crates/unicode-bidi/0.3.4/download", + type = "tar.gz", + sha256 = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5", + strip_prefix = "unicode-bidi-0.3.4", + build_file = Label("//bazel/cargo/remote:BUILD.unicode-bidi-0.3.4.bazel"), + ) + + maybe( + http_archive, + name = "raze__unicode_normalization__0_1_16", + url = "https://crates.io/api/v1/crates/unicode-normalization/0.1.16/download", + type = "tar.gz", + sha256 = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606", + strip_prefix = "unicode-normalization-0.1.16", + build_file = Label("//bazel/cargo/remote:BUILD.unicode-normalization-0.1.16.bazel"), + ) + + maybe( + http_archive, + name = "raze__unicode_xid__0_2_1", + url = "https://crates.io/api/v1/crates/unicode-xid/0.2.1/download", + type = "tar.gz", + sha256 = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564", + strip_prefix = "unicode-xid-0.2.1", + build_file = Label("//bazel/cargo/remote:BUILD.unicode-xid-0.2.1.bazel"), + ) + + maybe( + http_archive, + name = "raze__url__2_2_0", + url = "https://crates.io/api/v1/crates/url/2.2.0/download", + type = "tar.gz", + sha256 = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e", + strip_prefix = "url-2.2.0", + build_file = Label("//bazel/cargo/remote:BUILD.url-2.2.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__version_sync__0_9_1", + url = "https://crates.io/api/v1/crates/version-sync/0.9.1/download", + type = "tar.gz", + sha256 = "c7b77d2a6f56988f7bb54102fe73ab963df4e7374b58298a7efa1361f681e0e2", + strip_prefix = "version-sync-0.9.1", + build_file = Label("//bazel/cargo/remote:BUILD.version-sync-0.9.1.bazel"), + ) + + maybe( + http_archive, + name = "raze__version_check__0_9_2", + url = "https://crates.io/api/v1/crates/version_check/0.9.2/download", + type = "tar.gz", + sha256 = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed", + strip_prefix = "version_check-0.9.2", + build_file = Label("//bazel/cargo/remote:BUILD.version_check-0.9.2.bazel"), + ) + + maybe( + http_archive, + name = "raze__wasi__0_10_2_wasi_snapshot_preview1", + url = "https://crates.io/api/v1/crates/wasi/0.10.2+wasi-snapshot-preview1/download", + type = "tar.gz", + sha256 = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6", + strip_prefix = "wasi-0.10.2+wasi-snapshot-preview1", + build_file = Label("//bazel/cargo/remote:BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel"), + ) + + maybe( + http_archive, + name = "raze__winapi__0_3_9", + url = "https://crates.io/api/v1/crates/winapi/0.3.9/download", + type = "tar.gz", + sha256 = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419", + strip_prefix = "winapi-0.3.9", + build_file = Label("//bazel/cargo/remote:BUILD.winapi-0.3.9.bazel"), + ) + + maybe( + http_archive, + name = "raze__winapi_i686_pc_windows_gnu__0_4_0", + url = "https://crates.io/api/v1/crates/winapi-i686-pc-windows-gnu/0.4.0/download", + type = "tar.gz", + sha256 = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6", + strip_prefix = "winapi-i686-pc-windows-gnu-0.4.0", + build_file = Label("//bazel/cargo/remote:BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel"), + ) + + maybe( + http_archive, + name = "raze__winapi_x86_64_pc_windows_gnu__0_4_0", + url = "https://crates.io/api/v1/crates/winapi-x86_64-pc-windows-gnu/0.4.0/download", + type = "tar.gz", + sha256 = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f", + strip_prefix = "winapi-x86_64-pc-windows-gnu-0.4.0", + build_file = Label("//bazel/cargo/remote:BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel"), + ) diff --git a/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel b/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel new file mode 100644 index 00000000..99ca0a90 --- /dev/null +++ b/bazel/cargo/remote/BUILD.ahash-0.4.7.bazel @@ -0,0 +1,62 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "ahash" with type "bench" omitted + +# Unsupported target "map" with type "bench" omitted + +rust_library( + name = "ahash", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.4.7", + # buildifier: leave-alone + deps = [ + ], +) + +# Unsupported target "bench" with type "test" omitted + +# Unsupported target "map_tests" with type "test" omitted + +# Unsupported target "nopanic" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel b/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel new file mode 100644 index 00000000..e7de20ab --- /dev/null +++ b/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel @@ -0,0 +1,62 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # Apache-2.0 from expression "Apache-2.0 OR MIT" +]) + +# Generated Targets + +# Unsupported target "integers" with type "example" omitted + +# Unsupported target "paths" with type "example" omitted + +# Unsupported target "traits" with type "example" omitted + +# Unsupported target "versions" with type "example" omitted + +rust_library( + name = "autocfg", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.0.1", + # buildifier: leave-alone + deps = [ + ], +) + +# Unsupported target "rustflags" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.bazel b/bazel/cargo/remote/BUILD.bazel new file mode 100644 index 00000000..e69de29b diff --git a/bazel/cargo/remote/BUILD.bitflags-1.2.1.bazel b/bazel/cargo/remote/BUILD.bitflags-1.2.1.bazel new file mode 100644 index 00000000..f83a025b --- /dev/null +++ b/bazel/cargo/remote/BUILD.bitflags-1.2.1.bazel @@ -0,0 +1,55 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "bitflags", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.2.1", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.bstr-0.2.14.bazel b/bazel/cargo/remote/BUILD.bstr-0.2.14.bazel new file mode 100644 index 00000000..74365876 --- /dev/null +++ b/bazel/cargo/remote/BUILD.bstr-0.2.14.bazel @@ -0,0 +1,76 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "graphemes" with type "example" omitted + +# Unsupported target "graphemes-std" with type "example" omitted + +# Unsupported target "lines" with type "example" omitted + +# Unsupported target "lines-std" with type "example" omitted + +# Unsupported target "uppercase" with type "example" omitted + +# Unsupported target "uppercase-std" with type "example" omitted + +# Unsupported target "words" with type "example" omitted + +# Unsupported target "words-std" with type "example" omitted + +rust_library( + name = "bstr", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + "lazy_static", + "regex-automata", + "std", + "unicode", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.2.14", + # buildifier: leave-alone + deps = [ + "@raze__lazy_static__1_4_0//:lazy_static", + "@raze__memchr__2_3_4//:memchr", + "@raze__regex_automata__0_1_9//:regex_automata", + ], +) diff --git a/bazel/cargo/remote/BUILD.byteorder-1.4.2.bazel b/bazel/cargo/remote/BUILD.byteorder-1.4.2.bazel new file mode 100644 index 00000000..7913c3eb --- /dev/null +++ b/bazel/cargo/remote/BUILD.byteorder-1.4.2.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "unencumbered", # Unlicense from expression "Unlicense OR MIT" +]) + +# Generated Targets + +# Unsupported target "bench" with type "bench" omitted + +rust_library( + name = "byteorder", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.4.2", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel b/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel new file mode 100644 index 00000000..6e3db87e --- /dev/null +++ b/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "cfg_if", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.0.0", + # buildifier: leave-alone + deps = [ + ], +) + +# Unsupported target "xcrate" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel b/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel new file mode 100644 index 00000000..7420c4cc --- /dev/null +++ b/bazel/cargo/remote/BUILD.chrono-0.4.19.bazel @@ -0,0 +1,87 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "chrono" with type "bench" omitted + +# Unsupported target "serde" with type "bench" omitted + +rust_library( + name = "chrono", + srcs = glob(["**/*.rs"]), + aliases = { + }, + crate_features = [ + "clock", + "default", + "libc", + "oldtime", + "std", + "time", + "winapi", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.4.19", + # buildifier: leave-alone + deps = [ + "@raze__libc__0_2_85//:libc", + "@raze__num_integer__0_1_44//:num_integer", + "@raze__num_traits__0_2_14//:num_traits", + "@raze__time__0_1_43//:time", + ] + selects.with_or({ + # cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi")))) + ( + "@io_bazel_rules_rust//rust/platform:wasm32-unknown-unknown", + ): [ + ], + "//conditions:default": [], + }) + selects.with_or({ + # cfg(windows) + ( + "@io_bazel_rules_rust//rust/platform:i686-pc-windows-msvc", + "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc", + ): [ + "@raze__winapi__0_3_9//:winapi", + ], + "//conditions:default": [], + }), +) + +# Unsupported target "wasm" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.form_urlencoded-1.0.0.bazel b/bazel/cargo/remote/BUILD.form_urlencoded-1.0.0.bazel new file mode 100644 index 00000000..e4127f8a --- /dev/null +++ b/bazel/cargo/remote/BUILD.form_urlencoded-1.0.0.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "form_urlencoded", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.0.0", + # buildifier: leave-alone + deps = [ + "@raze__matches__0_1_8//:matches", + "@raze__percent_encoding__2_1_0//:percent_encoding", + ], +) diff --git a/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel b/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel new file mode 100644 index 00000000..0bdc50a2 --- /dev/null +++ b/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel @@ -0,0 +1,102 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "mod" with type "bench" omitted + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "getrandom", + srcs = glob(["**/*.rs"]), + aliases = { + }, + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.2.2", + # buildifier: leave-alone + deps = [ + "@raze__cfg_if__1_0_0//:cfg_if", + ] + selects.with_or({ + # cfg(all(target_arch = "wasm32", target_os = "unknown")) + ( + "@io_bazel_rules_rust//rust/platform:wasm32-unknown-unknown", + ): [ + ], + "//conditions:default": [], + }) + selects.with_or({ + # cfg(target_os = "wasi") + ( + "@io_bazel_rules_rust//rust/platform:wasm32-wasi", + ): [ + "@raze__wasi__0_10_2_wasi_snapshot_preview1//:wasi", + ], + "//conditions:default": [], + }) + selects.with_or({ + # cfg(unix) + ( + "@io_bazel_rules_rust//rust/platform:aarch64-apple-ios", + "@io_bazel_rules_rust//rust/platform:aarch64-linux-android", + "@io_bazel_rules_rust//rust/platform:aarch64-unknown-linux-gnu", + "@io_bazel_rules_rust//rust/platform:arm-unknown-linux-gnueabi", + "@io_bazel_rules_rust//rust/platform:i686-apple-darwin", + "@io_bazel_rules_rust//rust/platform:i686-linux-android", + "@io_bazel_rules_rust//rust/platform:i686-unknown-freebsd", + "@io_bazel_rules_rust//rust/platform:i686-unknown-linux-gnu", + "@io_bazel_rules_rust//rust/platform:powerpc-unknown-linux-gnu", + "@io_bazel_rules_rust//rust/platform:s390x-unknown-linux-gnu", + "@io_bazel_rules_rust//rust/platform:x86_64-apple-darwin", + "@io_bazel_rules_rust//rust/platform:x86_64-apple-ios", + "@io_bazel_rules_rust//rust/platform:x86_64-linux-android", + "@io_bazel_rules_rust//rust/platform:x86_64-unknown-freebsd", + "@io_bazel_rules_rust//rust/platform:x86_64-unknown-linux-gnu", + ): [ + "@raze__libc__0_2_85//:libc", + ], + "//conditions:default": [], + }), +) + +# Unsupported target "custom" with type "test" omitted + +# Unsupported target "normal" with type "test" omitted + +# Unsupported target "rdrand" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel b/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel new file mode 100644 index 00000000..9cc788fd --- /dev/null +++ b/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel @@ -0,0 +1,66 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # Apache-2.0 from expression "Apache-2.0 OR MIT" +]) + +# Generated Targets + +# Unsupported target "bench" with type "bench" omitted + +rust_library( + name = "hashbrown", + srcs = glob(["**/*.rs"]), + crate_features = [ + "ahash", + "default", + "inline-more", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.9.1", + # buildifier: leave-alone + deps = [ + "@raze__ahash__0_4_7//:ahash", + ], +) + +# Unsupported target "hasher" with type "test" omitted + +# Unsupported target "rayon" with type "test" omitted + +# Unsupported target "serde" with type "test" omitted + +# Unsupported target "set" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.idna-0.2.0.bazel b/bazel/cargo/remote/BUILD.idna-0.2.0.bazel new file mode 100644 index 00000000..16600dbf --- /dev/null +++ b/bazel/cargo/remote/BUILD.idna-0.2.0.bazel @@ -0,0 +1,59 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "idna", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.2.0", + # buildifier: leave-alone + deps = [ + "@raze__matches__0_1_8//:matches", + "@raze__unicode_bidi__0_3_4//:unicode_bidi", + "@raze__unicode_normalization__0_1_16//:unicode_normalization", + ], +) + +# Unsupported target "tests" with type "test" omitted + +# Unsupported target "unit" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.lazy_static-1.4.0.bazel b/bazel/cargo/remote/BUILD.lazy_static-1.4.0.bazel new file mode 100644 index 00000000..7587e7fd --- /dev/null +++ b/bazel/cargo/remote/BUILD.lazy_static-1.4.0.bazel @@ -0,0 +1,56 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "lazy_static", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.4.0", + # buildifier: leave-alone + deps = [ + ], +) + +# Unsupported target "no_std" with type "test" omitted + +# Unsupported target "test" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.libc-0.2.85.bazel b/bazel/cargo/remote/BUILD.libc-0.2.85.bazel new file mode 100644 index 00000000..9927ba4a --- /dev/null +++ b/bazel/cargo/remote/BUILD.libc-0.2.85.bazel @@ -0,0 +1,86 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets# buildifier: disable=load-on-top +load( + "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "cargo_build_script", +) + +cargo_build_script( + name = "libc_build_script", + srcs = glob(["**/*.rs"]), + build_script_env = { + }, + crate_features = [ + "default", + "std", + ], + crate_root = "build.rs", + data = glob(["**"]), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.2.85", + visibility = ["//visibility:private"], + deps = [ + ], +) + +rust_library( + name = "libc", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.2.85", + # buildifier: leave-alone + deps = [ + ":libc_build_script", + ], +) + +# Unsupported target "const_fn" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.log-0.4.14.bazel b/bazel/cargo/remote/BUILD.log-0.4.14.bazel new file mode 100644 index 00000000..61bc6926 --- /dev/null +++ b/bazel/cargo/remote/BUILD.log-0.4.14.bazel @@ -0,0 +1,87 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets# buildifier: disable=load-on-top +load( + "@io_bazel_rules_rust//cargo:cargo_build_script.bzl", + "cargo_build_script", +) + +cargo_build_script( + name = "log_build_script", + srcs = glob(["**/*.rs"]), + build_script_env = { + }, + crate_features = [ + ], + crate_root = "build.rs", + data = glob(["**"]), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.4.14", + visibility = ["//visibility:private"], + deps = [ + ], +) + +# Unsupported target "value" with type "bench" omitted + +rust_library( + name = "log", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.4.14", + # buildifier: leave-alone + deps = [ + ":log_build_script", + "@raze__cfg_if__1_0_0//:cfg_if", + ], +) + +# Unsupported target "filters" with type "test" omitted + +# Unsupported target "macros" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.matches-0.1.8.bazel b/bazel/cargo/remote/BUILD.matches-0.1.8.bazel new file mode 100644 index 00000000..6a25d8b3 --- /dev/null +++ b/bazel/cargo/remote/BUILD.matches-0.1.8.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT" +]) + +# Generated Targets + +rust_library( + name = "matches", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.1.8", + # buildifier: leave-alone + deps = [ + ], +) + +# Unsupported target "macro_use_one" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.memchr-2.3.4.bazel b/bazel/cargo/remote/BUILD.memchr-2.3.4.bazel new file mode 100644 index 00000000..609a04f7 --- /dev/null +++ b/bazel/cargo/remote/BUILD.memchr-2.3.4.bazel @@ -0,0 +1,57 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "unencumbered", # Unlicense from expression "Unlicense OR MIT" +]) + +# Generated Targets + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "memchr", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + "std", + "use_std", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "2.3.4", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel b/bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel new file mode 100644 index 00000000..f498d6a7 --- /dev/null +++ b/bazel/cargo/remote/BUILD.num-integer-0.1.44.bazel @@ -0,0 +1,65 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "average" with type "bench" omitted + +# Unsupported target "gcd" with type "bench" omitted + +# Unsupported target "roots" with type "bench" omitted + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "num_integer", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.1.44", + # buildifier: leave-alone + deps = [ + "@raze__num_traits__0_2_14//:num_traits", + ], +) + +# Unsupported target "average" with type "test" omitted + +# Unsupported target "roots" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel b/bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel new file mode 100644 index 00000000..683f9d57 --- /dev/null +++ b/bazel/cargo/remote/BUILD.num-traits-0.2.14.bazel @@ -0,0 +1,56 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "num_traits", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.2.14", + # buildifier: leave-alone + deps = [ + ], +) + +# Unsupported target "cast" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.percent-encoding-2.1.0.bazel b/bazel/cargo/remote/BUILD.percent-encoding-2.1.0.bazel new file mode 100644 index 00000000..132e764c --- /dev/null +++ b/bazel/cargo/remote/BUILD.percent-encoding-2.1.0.bazel @@ -0,0 +1,52 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "percent_encoding", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "2.1.0", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.proc-macro2-1.0.24.bazel b/bazel/cargo/remote/BUILD.proc-macro2-1.0.24.bazel new file mode 100644 index 00000000..82e62f74 --- /dev/null +++ b/bazel/cargo/remote/BUILD.proc-macro2-1.0.24.bazel @@ -0,0 +1,68 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "proc_macro2", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + "proc-macro", + "span-locations", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.0.24", + # buildifier: leave-alone + deps = [ + "@raze__unicode_xid__0_2_1//:unicode_xid", + ], +) + +# Unsupported target "comments" with type "test" omitted + +# Unsupported target "features" with type "test" omitted + +# Unsupported target "marker" with type "test" omitted + +# Unsupported target "test" with type "test" omitted + +# Unsupported target "test_fmt" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.pulldown-cmark-0.7.2.bazel b/bazel/cargo/remote/BUILD.pulldown-cmark-0.7.2.bazel new file mode 100644 index 00000000..e529713d --- /dev/null +++ b/bazel/cargo/remote/BUILD.pulldown-cmark-0.7.2.bazel @@ -0,0 +1,98 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT" +]) + +# Generated Targets + +# Unsupported target "html_rendering" with type "bench" omitted + +# Unsupported target "lib" with type "bench" omitted + +rust_binary( + # Prefix bin name to disambiguate from (probable) collision with lib name + # N.B.: The exact form of this is subject to change. + name = "cargo_bin_pulldown_cmark", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/main.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.7.2", + # buildifier: leave-alone + deps = [ + # Binaries get an implicit dependency on their crate's lib + ":pulldown_cmark", + "@raze__bitflags__1_2_1//:bitflags", + "@raze__memchr__2_3_4//:memchr", + "@raze__unicase__2_6_0//:unicase", + ], +) + +# Unsupported target "build-script-build" with type "custom-build" omitted + +# Unsupported target "event-filter" with type "example" omitted + +# Unsupported target "string-to-string" with type "example" omitted + +rust_library( + name = "pulldown_cmark", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.7.2", + # buildifier: leave-alone + deps = [ + "@raze__bitflags__1_2_1//:bitflags", + "@raze__memchr__2_3_4//:memchr", + "@raze__unicase__2_6_0//:unicase", + ], +) + +# Unsupported target "errors" with type "test" omitted + +# Unsupported target "html" with type "test" omitted + +# Unsupported target "lib" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.quote-1.0.8.bazel b/bazel/cargo/remote/BUILD.quote-1.0.8.bazel new file mode 100644 index 00000000..c3831893 --- /dev/null +++ b/bazel/cargo/remote/BUILD.quote-1.0.8.bazel @@ -0,0 +1,58 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "quote", + srcs = glob(["**/*.rs"]), + crate_features = [ + "proc-macro", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.0.8", + # buildifier: leave-alone + deps = [ + "@raze__proc_macro2__1_0_24//:proc_macro2", + ], +) + +# Unsupported target "compiletest" with type "test" omitted + +# Unsupported target "test" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.regex-1.4.3.bazel b/bazel/cargo/remote/BUILD.regex-1.4.3.bazel new file mode 100644 index 00000000..6a7b723f --- /dev/null +++ b/bazel/cargo/remote/BUILD.regex-1.4.3.bazel @@ -0,0 +1,92 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "shootout-regex-dna" with type "example" omitted + +# Unsupported target "shootout-regex-dna-bytes" with type "example" omitted + +# Unsupported target "shootout-regex-dna-cheat" with type "example" omitted + +# Unsupported target "shootout-regex-dna-replace" with type "example" omitted + +# Unsupported target "shootout-regex-dna-single" with type "example" omitted + +# Unsupported target "shootout-regex-dna-single-cheat" with type "example" omitted + +rust_library( + name = "regex", + srcs = glob(["**/*.rs"]), + crate_features = [ + "std", + "unicode", + "unicode-age", + "unicode-bool", + "unicode-case", + "unicode-gencat", + "unicode-perl", + "unicode-script", + "unicode-segment", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.4.3", + # buildifier: leave-alone + deps = [ + "@raze__regex_syntax__0_6_22//:regex_syntax", + ], +) + +# Unsupported target "backtrack" with type "test" omitted + +# Unsupported target "backtrack-bytes" with type "test" omitted + +# Unsupported target "backtrack-utf8bytes" with type "test" omitted + +# Unsupported target "crates-regex" with type "test" omitted + +# Unsupported target "default" with type "test" omitted + +# Unsupported target "default-bytes" with type "test" omitted + +# Unsupported target "nfa" with type "test" omitted + +# Unsupported target "nfa-bytes" with type "test" omitted + +# Unsupported target "nfa-utf8bytes" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.regex-automata-0.1.9.bazel b/bazel/cargo/remote/BUILD.regex-automata-0.1.9.bazel new file mode 100644 index 00000000..11cee719 --- /dev/null +++ b/bazel/cargo/remote/BUILD.regex-automata-0.1.9.bazel @@ -0,0 +1,55 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "unencumbered", # Unlicense from expression "Unlicense OR MIT" +]) + +# Generated Targets + +rust_library( + name = "regex_automata", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.1.9", + # buildifier: leave-alone + deps = [ + "@raze__byteorder__1_4_2//:byteorder", + ], +) + +# Unsupported target "default" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.regex-syntax-0.6.22.bazel b/bazel/cargo/remote/BUILD.regex-syntax-0.6.22.bazel new file mode 100644 index 00000000..134c2287 --- /dev/null +++ b/bazel/cargo/remote/BUILD.regex-syntax-0.6.22.bazel @@ -0,0 +1,62 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "bench" with type "bench" omitted + +rust_library( + name = "regex_syntax", + srcs = glob(["**/*.rs"]), + crate_features = [ + "unicode", + "unicode-age", + "unicode-bool", + "unicode-case", + "unicode-gencat", + "unicode-perl", + "unicode-script", + "unicode-segment", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.6.22", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.semver-parser-0.9.0.bazel b/bazel/cargo/remote/BUILD.semver-parser-0.9.0.bazel new file mode 100644 index 00000000..25a6549a --- /dev/null +++ b/bazel/cargo/remote/BUILD.semver-parser-0.9.0.bazel @@ -0,0 +1,52 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "semver_parser", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.9.0", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.serde-1.0.123.bazel b/bazel/cargo/remote/BUILD.serde-1.0.123.bazel new file mode 100644 index 00000000..ffdaa409 --- /dev/null +++ b/bazel/cargo/remote/BUILD.serde-1.0.123.bazel @@ -0,0 +1,56 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "serde", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.0.123", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.syn-1.0.60.bazel b/bazel/cargo/remote/BUILD.syn-1.0.60.bazel new file mode 100644 index 00000000..99ced3b5 --- /dev/null +++ b/bazel/cargo/remote/BUILD.syn-1.0.60.bazel @@ -0,0 +1,121 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "file" with type "bench" omitted + +# Unsupported target "rust" with type "bench" omitted + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "syn", + srcs = glob(["**/*.rs"]), + crate_features = [ + "clone-impls", + "default", + "derive", + "full", + "parsing", + "printing", + "proc-macro", + "quote", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.0.60", + # buildifier: leave-alone + deps = [ + "@raze__proc_macro2__1_0_24//:proc_macro2", + "@raze__quote__1_0_8//:quote", + "@raze__unicode_xid__0_2_1//:unicode_xid", + ], +) + +# Unsupported target "test_asyncness" with type "test" omitted + +# Unsupported target "test_attribute" with type "test" omitted + +# Unsupported target "test_derive_input" with type "test" omitted + +# Unsupported target "test_expr" with type "test" omitted + +# Unsupported target "test_generics" with type "test" omitted + +# Unsupported target "test_grouping" with type "test" omitted + +# Unsupported target "test_ident" with type "test" omitted + +# Unsupported target "test_item" with type "test" omitted + +# Unsupported target "test_iterators" with type "test" omitted + +# Unsupported target "test_lit" with type "test" omitted + +# Unsupported target "test_meta" with type "test" omitted + +# Unsupported target "test_parse_buffer" with type "test" omitted + +# Unsupported target "test_parse_stream" with type "test" omitted + +# Unsupported target "test_pat" with type "test" omitted + +# Unsupported target "test_path" with type "test" omitted + +# Unsupported target "test_precedence" with type "test" omitted + +# Unsupported target "test_receiver" with type "test" omitted + +# Unsupported target "test_round_trip" with type "test" omitted + +# Unsupported target "test_shebang" with type "test" omitted + +# Unsupported target "test_should_parse" with type "test" omitted + +# Unsupported target "test_size" with type "test" omitted + +# Unsupported target "test_stmt" with type "test" omitted + +# Unsupported target "test_token_trees" with type "test" omitted + +# Unsupported target "test_ty" with type "test" omitted + +# Unsupported target "test_visibility" with type "test" omitted + +# Unsupported target "zzz_stable" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.time-0.1.43.bazel b/bazel/cargo/remote/BUILD.time-0.1.43.bazel new file mode 100644 index 00000000..37c141c6 --- /dev/null +++ b/bazel/cargo/remote/BUILD.time-0.1.43.bazel @@ -0,0 +1,64 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "time", + srcs = glob(["**/*.rs"]), + aliases = { + }, + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.1.43", + # buildifier: leave-alone + deps = [ + "@raze__libc__0_2_85//:libc", + ] + selects.with_or({ + # cfg(windows) + ( + "@io_bazel_rules_rust//rust/platform:i686-pc-windows-msvc", + "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc", + ): [ + "@raze__winapi__0_3_9//:winapi", + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/remote/BUILD.tinyvec-1.1.1.bazel b/bazel/cargo/remote/BUILD.tinyvec-1.1.1.bazel new file mode 100644 index 00000000..265ab1de --- /dev/null +++ b/bazel/cargo/remote/BUILD.tinyvec-1.1.1.bazel @@ -0,0 +1,62 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # Zlib from expression "Zlib OR (Apache-2.0 OR MIT)" +]) + +# Generated Targets + +# Unsupported target "macros" with type "bench" omitted + +rust_library( + name = "tinyvec", + srcs = glob(["**/*.rs"]), + crate_features = [ + "alloc", + "default", + "tinyvec_macros", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "1.1.1", + # buildifier: leave-alone + deps = [ + "@raze__tinyvec_macros__0_1_0//:tinyvec_macros", + ], +) + +# Unsupported target "arrayvec" with type "test" omitted + +# Unsupported target "tinyvec" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.tinyvec_macros-0.1.0.bazel b/bazel/cargo/remote/BUILD.tinyvec_macros-0.1.0.bazel new file mode 100644 index 00000000..2ab6e2f4 --- /dev/null +++ b/bazel/cargo/remote/BUILD.tinyvec_macros-0.1.0.bazel @@ -0,0 +1,52 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR (Apache-2.0 OR Zlib)" +]) + +# Generated Targets + +rust_library( + name = "tinyvec_macros", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.1.0", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.toml-0.5.8.bazel b/bazel/cargo/remote/BUILD.toml-0.5.8.bazel new file mode 100644 index 00000000..a2ce171b --- /dev/null +++ b/bazel/cargo/remote/BUILD.toml-0.5.8.bazel @@ -0,0 +1,62 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "decode" with type "example" omitted + +# Unsupported target "enum_external" with type "example" omitted + +# Unsupported target "toml2json" with type "example" omitted + +rust_library( + name = "toml", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.5.8", + # buildifier: leave-alone + deps = [ + "@raze__serde__1_0_123//:serde", + ], +) + +# Unsupported target "enum_external_deserialize" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.unicase-2.6.0.bazel b/bazel/cargo/remote/BUILD.unicase-2.6.0.bazel new file mode 100644 index 00000000..9d0a39cb --- /dev/null +++ b/bazel/cargo/remote/BUILD.unicase-2.6.0.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "unicase", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "2.6.0", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.unicode-bidi-0.3.4.bazel b/bazel/cargo/remote/BUILD.unicode-bidi-0.3.4.bazel new file mode 100644 index 00000000..90e8fcfd --- /dev/null +++ b/bazel/cargo/remote/BUILD.unicode-bidi-0.3.4.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "unicode_bidi", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.3.4", + # buildifier: leave-alone + deps = [ + "@raze__matches__0_1_8//:matches", + ], +) diff --git a/bazel/cargo/remote/BUILD.unicode-normalization-0.1.16.bazel b/bazel/cargo/remote/BUILD.unicode-normalization-0.1.16.bazel new file mode 100644 index 00000000..b3e35bea --- /dev/null +++ b/bazel/cargo/remote/BUILD.unicode-normalization-0.1.16.bazel @@ -0,0 +1,57 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "bench" with type "bench" omitted + +rust_library( + name = "unicode_normalization", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.1.16", + # buildifier: leave-alone + deps = [ + "@raze__tinyvec__1_1_1//:tinyvec", + ], +) diff --git a/bazel/cargo/remote/BUILD.unicode-xid-0.2.1.bazel b/bazel/cargo/remote/BUILD.unicode-xid-0.2.1.bazel new file mode 100644 index 00000000..0cd42cb6 --- /dev/null +++ b/bazel/cargo/remote/BUILD.unicode-xid-0.2.1.bazel @@ -0,0 +1,55 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "unicode_xid", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.2.1", + # buildifier: leave-alone + deps = [ + ], +) + +# Unsupported target "exhaustive_tests" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.url-2.2.0.bazel b/bazel/cargo/remote/BUILD.url-2.2.0.bazel new file mode 100644 index 00000000..e4fdbd6d --- /dev/null +++ b/bazel/cargo/remote/BUILD.url-2.2.0.bazel @@ -0,0 +1,58 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "parse_url" with type "bench" omitted + +rust_library( + name = "url", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "2.2.0", + # buildifier: leave-alone + deps = [ + "@raze__form_urlencoded__1_0_0//:form_urlencoded", + "@raze__idna__0_2_0//:idna", + "@raze__matches__0_1_8//:matches", + "@raze__percent_encoding__2_1_0//:percent_encoding", + ], +) diff --git a/bazel/cargo/remote/BUILD.version-sync-0.9.1.bazel b/bazel/cargo/remote/BUILD.version-sync-0.9.1.bazel new file mode 100644 index 00000000..0e6a96fb --- /dev/null +++ b/bazel/cargo/remote/BUILD.version-sync-0.9.1.bazel @@ -0,0 +1,61 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT" +]) + +# Generated Targets + +rust_library( + name = "version_sync", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.9.1", + # buildifier: leave-alone + deps = [ + "@raze__proc_macro2__1_0_24//:proc_macro2", + "@raze__pulldown_cmark__0_7_2//:pulldown_cmark", + "@raze__regex__1_4_3//:regex", + "@raze__semver_parser__0_9_0//:semver_parser", + "@raze__syn__1_0_60//:syn", + "@raze__toml__0_5_8//:toml", + "@raze__url__2_2_0//:url", + ], +) + +# Unsupported target "version-numbers" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.version_check-0.9.2.bazel b/bazel/cargo/remote/BUILD.version_check-0.9.2.bazel new file mode 100644 index 00000000..86f83058 --- /dev/null +++ b/bazel/cargo/remote/BUILD.version_check-0.9.2.bazel @@ -0,0 +1,52 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +rust_library( + name = "version_check", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.9.2", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel b/bazel/cargo/remote/BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel new file mode 100644 index 00000000..6375caa4 --- /dev/null +++ b/bazel/cargo/remote/BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # Apache-2.0 from expression "Apache-2.0 OR (Apache-2.0 OR MIT)" +]) + +# Generated Targets + +rust_library( + name = "wasi", + srcs = glob(["**/*.rs"]), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.10.2+wasi-snapshot-preview1", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel b/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel new file mode 100644 index 00000000..fa325c78 --- /dev/null +++ b/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel @@ -0,0 +1,61 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "winapi", + srcs = glob(["**/*.rs"]), + crate_features = [ + "minwinbase", + "minwindef", + "ntdef", + "profileapi", + "std", + "sysinfoapi", + "timezoneapi", + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.3.9", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel b/bazel/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel new file mode 100644 index 00000000..7a0447a4 --- /dev/null +++ b/bazel/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "winapi_i686_pc_windows_gnu", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.4.0", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel b/bazel/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel new file mode 100644 index 00000000..95d47678 --- /dev/null +++ b/bazel/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel @@ -0,0 +1,54 @@ +""" +@generated +cargo-raze crate build file. + +DO NOT EDIT! Replaced on runs of cargo-raze +""" + +# buildifier: disable=load +load( + "@io_bazel_rules_rust//rust:rust.bzl", + "rust_binary", + "rust_library", + "rust_test", +) + +# buildifier: disable=load +load("@bazel_skylib//lib:selects.bzl", "selects") + +package(default_visibility = [ + # Public for visibility by "@raze__crate__version//" targets. + # + # Prefer access through "//bazel/cargo", which limits external + # visibility to explicit Cargo.toml dependencies. + "//visibility:public", +]) + +licenses([ + "notice", # MIT from expression "MIT OR Apache-2.0" +]) + +# Generated Targets + +# Unsupported target "build-script-build" with type "custom-build" omitted + +rust_library( + name = "winapi_x86_64_pc_windows_gnu", + srcs = glob(["**/*.rs"]), + crate_features = [ + ], + crate_root = "src/lib.rs", + crate_type = "lib", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-raze", + "manual", + ], + version = "0.4.0", + # buildifier: leave-alone + deps = [ + ], +) diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl new file mode 100644 index 00000000..b8f2b84d --- /dev/null +++ b/bazel/dependencies.bzl @@ -0,0 +1,20 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") +load("@proxy_wasm_rust_sdk//bazel/cargo:crates.bzl", "raze_fetch_remote_crates") + +def proxy_wasm_rust_sdk_dependencies(): + rust_repositories() + raze_fetch_remote_crates() diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl new file mode 100644 index 00000000..6ddf170f --- /dev/null +++ b/bazel/repositories.bzl @@ -0,0 +1,23 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +def proxy_wasm_rust_sdk_repositories(): + http_archive( + name = "io_bazel_rules_rust", + sha256 = "5cb2fbcc3debebc7b68f5f66c1b7ef741bdcca87c70594de688d4518538c36c8", + strip_prefix = "rules_rust-aa7c6938cf1cc2973bc065c7532f89874bf09818", + url = "https://github.com/bazelbuild/rules_rust/archive/aa7c6938cf1cc2973bc065c7532f89874bf09818.tar.gz", + ) diff --git a/examples/BUILD b/examples/BUILD new file mode 100644 index 00000000..258e55fc --- /dev/null +++ b/examples/BUILD @@ -0,0 +1,66 @@ +load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary") + +rust_binary( + name = "hello_world", + srcs = ["hello_world.rs"], + crate_type = "cdylib", + edition = "2018", + out_binary = True, + deps = [ + "//:proxy_wasm_experimental", + "//bazel/cargo:cfg_if", + "//bazel/cargo:chrono", + "//bazel/cargo:log", + ] + select({ + "@io_bazel_rules_rust//rust/platform:wasm32-unknown-unknown": [], + "//conditions:default": ["//bazel/cargo:getrandom"], + }), +) + +rust_binary( + name = "http_auth_random", + srcs = ["http_auth_random.rs"], + crate_type = "cdylib", + edition = "2018", + out_binary = True, + deps = [ + "//:proxy_wasm_experimental", + "//bazel/cargo:log", + ], +) + +rust_binary( + name = "http_headers", + srcs = ["http_headers.rs"], + crate_type = "cdylib", + edition = "2018", + out_binary = True, + deps = [ + "//:proxy_wasm_experimental", + "//bazel/cargo:log", + ], +) + +rust_binary( + name = "http_body", + srcs = ["http_body.rs"], + crate_type = "cdylib", + edition = "2018", + out_binary = True, + deps = [ + "//:proxy_wasm_experimental", + "//bazel/cargo:log", + ], +) + +rust_binary( + name = "http_config", + srcs = ["http_config.rs"], + crate_type = "cdylib", + edition = "2018", + out_binary = True, + deps = [ + "//:proxy_wasm_experimental", + "//bazel/cargo:log", + ], +) diff --git a/examples/hello_world.rs b/examples/hello_world.rs index 9fef3214..32349639 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -14,12 +14,16 @@ use proxy_wasm_experimental as proxy_wasm; +use cfg_if::cfg_if; use chrono::{DateTime, Utc}; use log::info; use proxy_wasm::traits::*; use proxy_wasm::types::*; use std::time::Duration; +#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] +use getrandom::getrandom; + #[no_mangle] pub fn _start() { proxy_wasm::set_log_level(LogLevel::Trace); @@ -38,7 +42,17 @@ impl RootContext for HelloWorld { } fn on_tick(&mut self) { - let datetime: DateTime = self.get_current_time().into(); - info!("It's {}", datetime); + cfg_if! { + if #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] { + let now: DateTime = self.get_current_time().into(); + info!("It's {}, there is no lucky number.", now); + + } else { + let now: DateTime = Utc::now(); + let mut buf = [0u8; 1]; + getrandom(&mut buf).unwrap(); + info!("It's {}, your lucky number is {}.", now, buf[0]); + } + } } } diff --git a/examples/http_body.rs b/examples/http_body.rs new file mode 100644 index 00000000..3926e1c5 --- /dev/null +++ b/examples/http_body.rs @@ -0,0 +1,72 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use proxy_wasm_experimental as proxy_wasm; + +use proxy_wasm::traits::*; +use proxy_wasm::types::*; + +#[no_mangle] +pub fn _start() { + proxy_wasm::set_log_level(LogLevel::Trace); + proxy_wasm::set_root_context(|_| -> Box { Box::new(HttpBodyRoot) }); +} + +struct HttpBodyRoot; + +impl Context for HttpBodyRoot {} + +impl RootContext for HttpBodyRoot { + fn get_type(&self) -> Option { + Some(ContextType::HttpContext) + } + + fn create_http_context(&self, _: u32) -> Option> { + Some(Box::new(HttpBody)) + } +} + +struct HttpBody; + +impl Context for HttpBody {} + +impl HttpContext for HttpBody { + fn on_http_response_headers(&mut self, _: usize, _: bool) -> Action { + // If there is a Content-Length header and we change the length of + // the body later, then clients will break. So remove it. + // We must do this here, because once we exit this function we + // can no longer modify the response headers. + self.set_http_response_header("content-length", None); + Action::Continue + } + + fn on_http_response_body(&mut self, body_size: usize, end_of_stream: bool) -> Action { + if !end_of_stream { + // Wait -- we'll be called again when the complete body is buffered + // at the host side. + return Action::Pause; + } + + // Replace the message body if it contains the text "secret". + // Since we returned "Pause" previuously, this will return the whole body. + if let Some(body_bytes) = self.get_http_response_body(0, body_size) { + let body_str = body_bytes.into_string().unwrap(); + if body_str.contains("secret") { + let new_body = format!("Original message body ({} bytes) redacted.", body_size); + self.set_http_response_body(0, body_size, &new_body.into_bytes()); + } + } + Action::Continue + } +} diff --git a/examples/http_config.rs b/examples/http_config.rs new file mode 100644 index 00000000..3063fe5b --- /dev/null +++ b/examples/http_config.rs @@ -0,0 +1,70 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use proxy_wasm_experimental as proxy_wasm; + +use proxy_wasm::traits::*; +use proxy_wasm::types::*; + +#[no_mangle] +pub fn _start() { + proxy_wasm::set_log_level(LogLevel::Trace); + proxy_wasm::set_root_context(|_| -> Box { + Box::new(HttpConfigHeaderRoot { + header_content: String::new(), + }) + }); +} + +struct HttpConfigHeader { + header_content: String, +} + +impl Context for HttpConfigHeader {} + +impl HttpContext for HttpConfigHeader { + fn on_http_response_headers(&mut self, _: usize, _: bool) -> Action { + self.add_http_response_header("custom-header", self.header_content.as_str()); + Action::Continue + } +} + +struct HttpConfigHeaderRoot { + header_content: String, +} + +impl Context for HttpConfigHeaderRoot {} + +impl RootContext for HttpConfigHeaderRoot { + fn on_configure(&mut self, configuration_size: usize) -> bool { + if let Ok(Some(config_bytes)) = proxy_wasm::hostcalls::get_buffer( + BufferType::PluginConfiguration, + 0, + configuration_size, + ) { + self.header_content = config_bytes.into_string().unwrap(); + } + true + } + + fn create_http_context(&self, _: u32) -> Option> { + Some(Box::new(HttpConfigHeader { + header_content: self.header_content.clone(), + })) + } + + fn get_type(&self) -> Option { + Some(ContextType::HttpContext) + } +} diff --git a/examples/http_headers.rs b/examples/http_headers.rs index 13afc393..709ec55e 100644 --- a/examples/http_headers.rs +++ b/examples/http_headers.rs @@ -21,9 +21,21 @@ use proxy_wasm::types::*; #[no_mangle] pub fn _start() { proxy_wasm::set_log_level(LogLevel::Trace); - proxy_wasm::set_http_context(|context_id, _| -> Box { - Box::new(HttpHeaders { context_id }) - }); + proxy_wasm::set_root_context(|_| -> Box { Box::new(HttpHeadersRoot) }); +} + +struct HttpHeadersRoot; + +impl Context for HttpHeadersRoot {} + +impl RootContext for HttpHeadersRoot { + fn get_type(&self) -> Option { + Some(ContextType::HttpContext) + } + + fn create_http_context(&self, context_id: u32) -> Option> { + Some(Box::new(HttpHeaders { context_id })) + } } struct HttpHeaders { diff --git a/src/allocator.rs b/src/allocator.rs index e4d08eda..c7e1199c 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -12,20 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#[cfg(feature = "wee-alloc")] #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; -// Apparently, Rust toolchain doesn't handle well exported name `malloc` -// when this package is compiled to targets other than `wasm32-unknown-unknown`. -// Specifically, linking issues have been observed with targets `wasm32-wasi` -// and `x86_64-unknown-linux-gnu`, which is a blocker for unit testing. -// Therefore, export name `malloc` only in the context of target `wasm32-unknown-unknown`. #[cfg_attr( - all( - target_arch = "wasm32", - target_vendor = "unknown", - target_os = "unknown" - ), + all(target_arch = "wasm32", target_os = "unknown"), export_name = "malloc" )] #[no_mangle] diff --git a/src/bytestring.rs b/src/bytestring.rs index 22d6fb70..2359cfad 100644 --- a/src/bytestring.rs +++ b/src/bytestring.rs @@ -87,7 +87,7 @@ impl fmt::Debug for ByteStr { } else if b == b'\0' { write!(f, "\\0")?; // ASCII printable - } else if b >= 0x20 && b < 0x7f { + } else if (0x20..0x7f).contains(&b) { write!(f, "{}", b as char)?; } else { write!(f, "\\x{:02x}", b)?; @@ -621,6 +621,7 @@ mod tests { } #[test] + #[allow(clippy::eq_op)] fn test_bytestring_eq_string() { let string: ByteString = "utf-8 encoded string".into(); @@ -634,6 +635,7 @@ mod tests { } #[test] + #[allow(clippy::eq_op)] fn test_bytestring_eq_bytes() { let bytes: ByteString = vec![144u8, 145u8, 146u8].into(); diff --git a/src/dispatcher.rs b/src/dispatcher.rs index be312169..11d1c41d 100644 --- a/src/dispatcher.rs +++ b/src/dispatcher.rs @@ -84,6 +84,17 @@ impl Dispatcher { self.new_http_stream.replace(Some(callback)); } + fn register_callout(&self, token_id: u32) { + if self + .callouts + .borrow_mut() + .insert(token_id, self.active_id.get()) + .is_some() + { + panic!("duplicate token_id") + } + } + fn create_root_context(&self, context_id: u32) { let new_context = match *self.new_root.borrow_mut() { Some(ref mut f) => f(context_id), @@ -99,44 +110,16 @@ impl Dispatcher { } } - /// Lets the root context to create its child context. - fn create_child_context(&self, context_id: u32, root_context_id: u32) -> bool { - if !self.roots.borrow().contains_key(&root_context_id) { - panic!("invalid root_context_id") - } - if let Some(child_context) = self - .roots - .borrow_mut() - .get_mut(&root_context_id) - .and_then(|root| root.on_create_child_context(context_id)) - { - if match child_context { - ChildContext::HttpContext(http_context) => self - .http_streams - .borrow_mut() - .insert(context_id, http_context) - .is_some(), - ChildContext::StreamContext(stream_context) => self - .streams - .borrow_mut() - .insert(context_id, stream_context) - .is_some(), - } { - panic!("duplicate context_id") - } - true - } else { - false - } - } - fn create_stream_context(&self, context_id: u32, root_context_id: u32) { - if !self.roots.borrow().contains_key(&root_context_id) { - panic!("invalid root_context_id") - } - let new_context = match *self.new_stream.borrow_mut() { - Some(ref mut f) => f(context_id, root_context_id), - None => panic!("missing constructor"), + let new_context = match self.roots.borrow().get(&root_context_id) { + Some(root_context) => match *self.new_stream.borrow_mut() { + Some(ref mut f) => f(context_id, root_context_id), + None => match root_context.create_stream_context(context_id) { + Some(stream_context) => stream_context, + None => panic!("create_stream_context returned None"), + }, + }, + None => panic!("invalid root_context_id"), }; if self .streams @@ -149,12 +132,15 @@ impl Dispatcher { } fn create_http_context(&self, context_id: u32, root_context_id: u32) { - if !self.roots.borrow().contains_key(&root_context_id) { - panic!("invalid root_context_id") - } - let new_context = match *self.new_http_stream.borrow_mut() { - Some(ref mut f) => f(context_id, root_context_id), - None => panic!("missing constructor"), + let new_context = match self.roots.borrow().get(&root_context_id) { + Some(root_context) => match *self.new_http_stream.borrow_mut() { + Some(ref mut f) => f(context_id, root_context_id), + None => match root_context.create_http_context(context_id) { + Some(stream_context) => stream_context, + None => panic!("create_http_context returned None"), + }, + }, + None => panic!("invalid root_context_id"), }; if self .http_streams @@ -166,28 +152,25 @@ impl Dispatcher { } } - fn register_callout(&self, token_id: u32) { - if self - .callouts - .borrow_mut() - .insert(token_id, self.active_id.get()) - .is_some() - { - panic!("duplicate token_id") - } - } - fn on_create_context(&self, context_id: u32, root_context_id: u32) { if root_context_id == 0 { - self.create_root_context(context_id) - } else if self.create_child_context(context_id, root_context_id) { - // root context created a child context by himself + self.create_root_context(context_id); } else if self.new_http_stream.borrow().is_some() { self.create_http_context(context_id, root_context_id); } else if self.new_stream.borrow().is_some() { self.create_stream_context(context_id, root_context_id); + } else if let Some(root_context) = self.roots.borrow().get(&root_context_id) { + match root_context.get_type() { + Some(ContextType::HttpContext) => { + self.create_http_context(context_id, root_context_id) + } + Some(ContextType::StreamContext) => { + self.create_stream_context(context_id, root_context_id) + } + None => panic!("missing ContextType on root_context"), + } } else { - panic!("missing constructors") + panic!("invalid root_context_id and missing constructors"); } } @@ -392,22 +375,24 @@ impl Dispatcher { body_size: usize, num_trailers: usize, ) { - if let Some(context_id) = self.callouts.borrow_mut().remove(&token_id) { - if let Some(http_stream) = self.http_streams.borrow_mut().get_mut(&context_id) { - self.active_id.set(context_id); - hostcalls::set_effective_context(context_id).unwrap(); - http_stream.on_http_call_response(token_id, num_headers, body_size, num_trailers) - } else if let Some(stream) = self.streams.borrow_mut().get_mut(&context_id) { - self.active_id.set(context_id); - hostcalls::set_effective_context(context_id).unwrap(); - stream.on_http_call_response(token_id, num_headers, body_size, num_trailers) - } else if let Some(root) = self.roots.borrow_mut().get_mut(&context_id) { - self.active_id.set(context_id); - hostcalls::set_effective_context(context_id).unwrap(); - root.on_http_call_response(token_id, num_headers, body_size, num_trailers) - } - } else { - panic!("invalid token_id") + let context_id = self + .callouts + .borrow_mut() + .remove(&token_id) + .expect("invalid token_id"); + + if let Some(http_stream) = self.http_streams.borrow_mut().get_mut(&context_id) { + self.active_id.set(context_id); + hostcalls::set_effective_context(context_id).unwrap(); + http_stream.on_http_call_response(token_id, num_headers, body_size, num_trailers) + } else if let Some(stream) = self.streams.borrow_mut().get_mut(&context_id) { + self.active_id.set(context_id); + hostcalls::set_effective_context(context_id).unwrap(); + stream.on_http_call_response(token_id, num_headers, body_size, num_trailers) + } else if let Some(root) = self.roots.borrow_mut().get_mut(&context_id) { + self.active_id.set(context_id); + hostcalls::set_effective_context(context_id).unwrap(); + root.on_http_call_response(token_id, num_headers, body_size, num_trailers) } } } diff --git a/src/hostcalls.rs b/src/hostcalls.rs index bc4664f0..fbaa6f96 100644 --- a/src/hostcalls.rs +++ b/src/hostcalls.rs @@ -54,6 +54,10 @@ mod abi { pub const PROXY_HTTP_CALL: &str = "proxy_http_call"; pub const PROXY_SET_EFFECTIVE_CONTEXT: &str = "proxy_set_effective_context"; pub const PROXY_DONE: &str = "proxy_done"; + pub const PROXY_DEFINE_METRIC: &str = "proxy_define_metric"; + pub const PROXY_GET_METRIC: &str = "proxy_get_metric"; + pub const PROXY_RECORD_METRIC: &str = "proxy_record_metric"; + pub const PROXY_INCREMENT_METRIC: &str = "proxy_increment_metric"; } extern "C" { @@ -919,6 +923,65 @@ pub fn done() -> Result<()> { } } +extern "C" { + fn proxy_define_metric( + metric_type: MetricType, + name_data: *const u8, + name_size: usize, + return_id: *mut u32, + ) -> Status; +} + +pub fn define_metric(metric_type: MetricType, name: &str) -> Result { + let mut return_id: u32 = 0; + unsafe { + match proxy_define_metric(metric_type, name.as_ptr(), name.len(), &mut return_id) { + Status::Ok => Ok(return_id), + status => Err(HostCallError::new(abi::PROXY_DEFINE_METRIC, status).into()), + } + } +} + +extern "C" { + fn proxy_get_metric(metric_id: u32, return_value: *mut u64) -> Status; +} + +pub fn get_metric(metric_id: u32) -> Result { + let mut return_value: u64 = 0; + unsafe { + match proxy_get_metric(metric_id, &mut return_value) { + Status::Ok => Ok(return_value), + status => Err(HostCallError::new(abi::PROXY_GET_METRIC, status).into()), + } + } +} + +extern "C" { + fn proxy_record_metric(metric_id: u32, value: u64) -> Status; +} + +pub fn record_metric(metric_id: u32, value: u64) -> Result<()> { + unsafe { + match proxy_record_metric(metric_id, value) { + Status::Ok => Ok(()), + status => Err(HostCallError::new(abi::PROXY_RECORD_METRIC, status).into()), + } + } +} + +extern "C" { + fn proxy_increment_metric(metric_id: u32, offset: i64) -> Status; +} + +pub fn increment_metric(metric_id: u32, offset: i64) -> Result<()> { + unsafe { + match proxy_increment_metric(metric_id, offset) { + Status::Ok => Ok(()), + status => Err(HostCallError::new(abi::PROXY_INCREMENT_METRIC, status).into()), + } + } +} + mod utils { use crate::error::Result; use crate::types::ByteString; diff --git a/src/lib.rs b/src/lib.rs index 03bb3d48..ea12546d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![doc(html_root_url = "https://docs.rs/proxy-wasm-experimental/0.0.7")] +#![doc(html_root_url = "https://docs.rs/proxy-wasm-experimental/0.0.8")] pub mod error; pub mod hostcalls; @@ -50,4 +50,4 @@ where } #[no_mangle] -pub extern "C" fn proxy_abi_version_0_1_0() {} +pub extern "C" fn proxy_abi_version_0_2_0() {} diff --git a/src/traits.rs b/src/traits.rs index a6190a00..b68e266e 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -96,12 +96,6 @@ pub trait Context { } } -/// Represents a child context of the root context. -pub enum ChildContext { - StreamContext(Box), - HttpContext(Box), -} - pub trait RootContext: Context { fn on_vm_start(&mut self, _vm_configuration_size: usize) -> bool { true @@ -121,9 +115,15 @@ pub trait RootContext: Context { fn on_log(&mut self) {} - fn on_create_child_context(&mut self, _context_id: u32) -> Option { - // for the sake of compatibility with `set_http_context` and `set_stream_context` API, - // root context is not required to create its child context. + fn create_http_context(&self, _context_id: u32) -> Option> { + None + } + + fn create_stream_context(&self, _context_id: u32) -> Option> { + None + } + + fn get_type(&self) -> Option { None } } @@ -141,6 +141,10 @@ pub trait StreamContext: Context { hostcalls::get_buffer(BufferType::DownstreamData, start, max_size).unwrap() } + fn set_downstream_data(&self, start: usize, size: usize, value: &[u8]) { + hostcalls::set_buffer(BufferType::DownstreamData, start, size, value).unwrap() + } + fn on_downstream_close(&mut self, _peer_type: PeerType) {} fn on_upstream_data(&mut self, _data_size: usize, _end_of_stream: bool) -> Action { @@ -151,6 +155,10 @@ pub trait StreamContext: Context { hostcalls::get_buffer(BufferType::UpstreamData, start, max_size).unwrap() } + fn set_upstream_data(&self, start: usize, size: usize, value: &[u8]) { + hostcalls::set_buffer(BufferType::UpstreamData, start, size, value).unwrap() + } + fn on_upstream_close(&mut self, _peer_type: PeerType) {} fn on_log(&mut self) {} @@ -189,6 +197,10 @@ pub trait HttpContext: Context { hostcalls::get_buffer(BufferType::HttpRequestBody, start, max_size).unwrap() } + fn set_http_request_body(&self, start: usize, size: usize, value: &[u8]) { + hostcalls::set_buffer(BufferType::HttpRequestBody, start, size, value).unwrap() + } + fn on_http_request_trailers(&mut self, _num_trailers: usize) -> Action { Action::Continue } @@ -249,6 +261,10 @@ pub trait HttpContext: Context { hostcalls::get_buffer(BufferType::HttpResponseBody, start, max_size).unwrap() } + fn set_http_response_body(&self, start: usize, size: usize, value: &[u8]) { + hostcalls::set_buffer(BufferType::HttpResponseBody, start, size, value).unwrap() + } + fn on_http_response_trailers(&mut self, _num_trailers: usize) -> Action { Action::Continue } diff --git a/src/types.rs b/src/types.rs index 4e64d8c7..3490efe5 100644 --- a/src/types.rs +++ b/src/types.rs @@ -49,6 +49,13 @@ pub enum Status { InternalFailure = 10, } +#[repr(u32)] +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +pub enum ContextType { + HttpContext = 0, + StreamContext = 1, +} + #[repr(u32)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub enum BufferType { @@ -90,3 +97,11 @@ pub enum StreamType { Request = 0, Response = 1, } + +#[repr(u32)] +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +pub enum MetricType { + Counter = 0, + Gauge = 1, + Histogram = 2, +}