diff --git a/.bazelrc b/.bazelrc index e0247e90e..5a0373356 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,17 +1,90 @@ -build --action_env=CC=clang -build --action_env=CXX=clang++ +# Disable Bzlmod +common --noenable_bzlmod + +# Pass CC, CXX and PATH from the environment. +build --action_env=CC +build --action_env=CXX +build --action_env=PATH + +# Use Clang compiler. +build:clang --action_env=BAZEL_COMPILER=clang +build:clang --action_env=CC=clang +build:clang --action_env=CXX=clang++ +build:clang --copt -Wno-pragma-once-outside-header --cxxopt -Wno-pragma-once-outside-header + +# Common flags for Clang sanitizers. +build:clang-xsan --config=clang +build:clang-xsan --copt -O1 +build:clang-xsan --copt -fno-omit-frame-pointer +build:clang-xsan --copt -fno-optimize-sibling-calls +build:clang-xsan --copt -fno-sanitize-recover=all +build:clang-xsan --linkopt -fsanitize-link-c++-runtime +build:clang-xsan --linkopt -fuse-ld=lld +build:clang-xsan --linkopt -rtlib=compiler-rt +build:clang-xsan --linkopt --unwindlib=libgcc + +# Use Clang compiler with Address and Undefined Behavior Sanitizers. +build:clang-asan --config=clang-xsan +build:clang-asan --copt -DADDRESS_SANITIZER=1 +build:clang-asan --copt -DUNDEFINED_SANITIZER=1 +build:clang-asan --copt -fsanitize=address,undefined +build:clang-asan --copt -fsanitize-address-use-after-scope +build:clang-asan --linkopt -fsanitize=address,undefined +build:clang-asan --linkopt -fsanitize-address-use-after-scope +build:clang-asan --test_env=ASAN_OPTIONS=check_initialization_order=1:detect_stack_use_after_return=1:strict_init_order=1:strict_string_checks=1 +build:clang-asan --test_env=UBSAN_OPTIONS=print_stacktrace=1 +build:clang-asan --test_env=ASAN_SYMBOLIZER_PATH + +# Use Clang compiler with Address and Undefined Behavior Sanitizers (strict version). +build:clang-asan-strict --config=clang-asan +build:clang-asan-strict --copt -fsanitize=integer,local-bounds,nullability +build:clang-asan-strict --linkopt -fsanitize=integer,local-bounds,nullability + +# Use Honggfuzz with Address and Undefined Behavior Sanitizers (strict version). +build:clang-asan-honggfuzz --config=clang-asan-strict +build:clang-asan-honggfuzz --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:honggfuzz +build:clang-asan-honggfuzz --@rules_fuzzing//fuzzing:cc_engine_instrumentation=honggfuzz + +# Use LibFuzzer with Address and Undefined Behavior Sanitizers (strict version). +build:clang-asan-libfuzzer --config=clang-asan-strict +build:clang-asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer +build:clang-asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer + +# Use Clang compiler with Thread Sanitizer. +build:clang-tsan --config=clang-xsan +build:clang-tsan --copt -DTHREAD_SANITIZER=1 +build:clang-tsan --copt -fsanitize=thread +build:clang-tsan --linkopt -fsanitize=thread +build:clang-tsan --test_env=TSAN_OPTIONS=suppressions=bazel/tsan_suppressions.txt + +# Use Clang-Tidy tool. +build:clang-tidy --config=clang +build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect +build:clang-tidy --@bazel_clang_tidy//:clang_tidy_config=@proxy_wasm_cpp_host//:clang_tidy_config +build:clang-tidy --output_groups=report + +# Use GCC compiler. +build:gcc --action_env=BAZEL_COMPILER=gcc +build:gcc --action_env=CC=gcc +build:gcc --action_env=CXX=g++ + +build:hermetic-llvm --incompatible_enable_cc_toolchain_resolution +build:hermetic-llvm --action_env BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 +build:hermetic-llvm --extra_toolchains @emsdk//emscripten_toolchain:cc-toolchain-wasm + +build:hermetic-llvm-macos --config=hermetic-llvm +# Below flags mitigate https://github.com/bazel-contrib/toolchains_llvm/pull/229. +build:hermetic-llvm-macos --features=-libtool +build:hermetic-llvm-macos --features=-supports_dynamic_linker build --enable_platform_specific_config -build:linux --cxxopt=-std=c++17 -# See https://bytecodealliance.github.io/wasmtime/c-api/ -build:linux --linkopt=-lm -build:linux --linkopt=-lpthread -build:linux --linkopt=-ldl +# Use C++20. +build:linux --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 +build:macos --cxxopt=-std=c++20 --host_cxxopt=-std=c++20 +build:windows --cxxopt="/std:c++20" --host_cxxopt="/std:c++20" -build:macos --cxxopt=-std=c++17 -# TODO(mathetake): Windows build is not verified yet. -# build:windows --cxxopt="/std:c++17" -# See https://bytecodealliance.github.io/wasmtime/c-api/ -# build:windows --linkopt="ws2_32.lib advapi32.lib userenv.lib ntdll.lib shell32.lib ole32.lib" +# Enable symlinks and runfiles on Windows (enabled by default on other platforms). +startup --windows_enable_symlinks +build:windows --enable_runfiles diff --git a/.bazelversion b/.bazelversion index ee74734aa..f22d756da 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -4.1.0 +6.5.0 diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..df9f5c944 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,38 @@ +Checks: clang-*, + -clang-analyzer-core.CallAndMessage, + -clang-analyzer-optin.portability.UnixAPI, + -clang-analyzer-unix.Malloc, + -clang-diagnostic-pragma-once-outside-header, + -clang-diagnostic-builtin-macro-redefined, + cppcoreguidelines-pro-type-member-init, + cppcoreguidelines-pro-type-static-cast-downcast, + misc-*, + -misc-non-private-member-variables-in-classes, + -misc-use-anonymous-namespace, + -misc-const-correctness, + -misc-include-cleaner, + -misc-unused-parameters, + modernize-*, + -modernize-avoid-c-arrays, + -modernize-use-trailing-return-type, + -modernize-return-braced-init-list, + -modernize-use-default-member-init, + -modernize-type-traits, + -modernize-use-emplace, + llvm-include-order, + performance-*, + -performance-no-int-to-ptr, + -performance-avoid-endl, + portability-*, + readability-*, + -readability-convert-member-functions-to-static, + -readability-function-cognitive-complexity, + -readability-magic-numbers, + -readability-make-member-function-const, + -readability-simplify-boolean-expr, + -readability-identifier-length, + -readability-container-data-pointer, + -readability-redundant-casting, + -readability-avoid-return-with-void-value, + +WarningsAsErrors: '*' diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml deleted file mode 100644 index 9e58e9974..000000000 --- a/.github/workflows/cpp.yml +++ /dev/null @@ -1,87 +0,0 @@ -# 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. - -name: C++ - -on: - - pull_request: - branches: - - master - - 'envoy-release/**' - - 'istio-release/**' - - push: - branches: - - master - - 'envoy-release/**' - - 'istio-release/**' - -jobs: - - format: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Format (clang-format) - run: | - sudo apt-get install clang-format-9 - find . -name "*.h" -o -name "*.cc" -o -name "*.proto" | grep -v ".pb." | xargs -n1 clang-format-9 -i - git diff --exit-code - - - name: Format (buildifier) - run: | - go get -u github.com/bazelbuild/buildtools/buildifier - export PATH=$PATH:$(go env GOPATH)/bin - find . -name "BUILD" | xargs -n1 buildifier -mode=check - - - name: Format (addlicense) - run: | - go get -u github.com/google/addlicense - export PATH=$PATH:$(go env GOPATH)/bin - addlicense -check . - - build: - name: build (${{ matrix.runtime }}) - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - runtime: ["wamr", "wasmtime", "wavm"] - - steps: - - uses: actions/checkout@v2 - - - name: Install dependency - run: sudo apt-get install ninja-build - - - name: Mount Bazel cache - uses: actions/cache@v2 - with: - path: | - ~/.cache/bazel - ~/.cache/bazelisk - key: bazel-${{ matrix.runtime }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.raze.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} - - - name: Test - run: | - bazel test --define runtime=${{ matrix.runtime }} //test/... - - - name: Test (signed Wasm module) - run: | - bazel test --define runtime=${{ matrix.runtime }} --per_file_copt=//...@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" //test:signature_util_test diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 000000000..8f61d3582 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,164 @@ +# 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. + +name: Format + +on: + + pull_request: + branches: + - main + - 'envoy-release/**' + - 'istio-release/**' + + push: + branches: + - main + - 'envoy-release/**' + - 'istio-release/**' + + schedule: + - cron: '0 0 * * *' + + workflow_dispatch: + +concurrency: + + group: ${{ github.head_ref || github.run_id }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + + addlicense: + name: verify licenses + + runs-on: ubuntu-24.04-16core + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-go@v2 + with: + go-version: '^1.16' + + - name: Install dependencies + run: | + go install github.com/google/addlicense@latest + echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" + + - name: Format (addlicense) + run: addlicense -ignore "bazel/cargo/*/remote/**" -check . + + buildifier: + name: check format with buildifier + + runs-on: ubuntu-24.04-16core + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-go@v2 + with: + go-version: '^1.16' + + - name: Install dependencies + run: | + go install github.com/bazelbuild/buildtools/buildifier@latest + echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" + + - name: Format (buildifier) + run: find . -name "WORKSPACE" -o -name "*BUILD*" -o -name "*.bzl" | xargs -n1 buildifier -mode=check + + rules_rust: + name: check format with rules_rust + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Format (bazel query) + run: | + bazel query 'deps(//bazel/cargo/...)' + + - name: Format (rules_rust) + run: | + bazel run //bazel/cargo/wasmsign:crates_vendor + bazel run //bazel/cargo/wasmtime:crates_vendor + git diff --exit-code + + clang_format: + name: check format with clang-format + + runs-on: ubuntu-24.04-16core + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies (Linux) + run: sudo apt update -y && sudo apt install -y clang-format-18 + + - name: Format (clang-format) + run: | + find . -name "*.h" -o -name "*.cc" -o -name "*.proto" | grep -v ".pb." | xargs -n1 clang-format-18 -i + git diff --exit-code + + clang_tidy: + name: check format with clang-tidy + + runs-on: ubuntu-24.04-16core + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies (Linux) + run: sudo apt update -y && sudo apt install -y clang-tidy-18 lld-18 && sudo ln -sf /usr/bin/lld-18 /usr/bin/lld + + - name: set cache name + id: vars + # The cache tag consists of the following parts: + # * clang-tidy- prefix + # * matrix.name, which separates the cache for each build type. + # * hash of WORKSPACE, .bazelrc, and .bazelversion, which is + # purely to differentiate caches for substantial changes in bazel. + # * github.sha, which is the commit hash of the commit used to generate + # the cache entry. + run: echo "CACHE_TAG=clang-tidy-${{ matrix.name }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT" + + - name: bazel cache + uses: actions/cache/restore@v3 + with: + path: /tmp/bazel/cache + key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} + restore-keys: | + ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} + ${{ steps.vars.outputs.CACHE_TAG }}- + clang-tidy-${{ matrix.name }}- + clang-tidy- + + - name: Bazel build + run: > + bazel build + --config clang-tidy + --define engine=multi + --disk_cache /tmp/bazel/cache + --copt=-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" + //... + + - name: save bazel cache + uses: actions/cache/save@v3 + if: always() + with: + path: /tmp/bazel/cache + key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..cc6ddbc5f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,379 @@ +# 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. + +name: Test + +on: + + pull_request: + branches: + - main + - 'envoy-release/**' + - 'istio-release/**' + + push: + branches: + - main + - 'envoy-release/**' + - 'istio-release/**' + + schedule: + - cron: '0 0 * * *' + + workflow_dispatch: + +concurrency: + + group: ${{ github.head_ref || github.run_id }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + + test_data: + name: build test data + + runs-on: ubuntu-24.04-16core + + steps: + - uses: actions/checkout@v2 + + - name: set cache name + id: vars + # The cache tag consists of the following parts: + # * test-deps-bazel-cache- prefix + # * hash of WORKSPACE, .bazelrc, and .bazelversion, which is + # purely to differentiate caches for substantial changes in bazel. + # * github.sha, which is the commit hash of the commit used to generate + # the cache entry. + run: echo "CACHE_TAG=test-deps-bazel-cache-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT" + + - name: bazel cache + uses: actions/cache/restore@v3 + with: + path: /tmp/bazel/cache + key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} + restore-keys: | + ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} + ${{ steps.vars.outputs.CACHE_TAG }}- + test-deps-bazel-cache-${{ matrix.name }}- + test-deps-bazel-cache- + + - name: Bazel build + run: > + bazel build + --verbose_failures + --test_output=errors + --config=clang + --disk_cache /tmp/bazel/cache + -c opt + $(bazel query 'kind(was.*_rust_binary, //test/test_data/...)') + $(bazel query 'kind(_optimized_wasm_cc_binary, //test/test_data/...)') + + # Currently, in Github Action, "Bazel build step" creates `wasm_canary_check.wasm` directory as a temporal directory. + # Since the name of this directory has "*.wasm" pattern, the step "Mangle build rules to use existing test data" fails. + # So, here, we clear out the directories in test_data. + - name: Clean up test data + shell: bash + run: | + # Remove temporal directories + for i in $(find bazel-bin/test/test_data/ -mindepth 1 -maxdepth 1 -type d); do \ + rm -rf $i; \ + done + + - name: Upload test data + uses: actions/upload-artifact@v4 + with: + name: test_data + path: bazel-bin/test/test_data/*.wasm + if-no-files-found: error + retention-days: 3 + + - name: remove unaccessed files from cache + shell: bash + run: > + find /tmp/bazel/cache + -type f + -name '*' + -amin +360 + -exec rm {} \; + + - name: save bazel cache + uses: actions/cache/save@v3 + if: always() + with: + path: /tmp/bazel/cache + key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} + + build: + name: ${{ matrix.action }} with ${{ matrix.name }} + + needs: test_data + + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + include: + - name: 'NullVM on Linux/x86_64' + engine: 'null' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=gcc + - name: 'NullVM on Linux/x86_64 with ASan' + engine: 'null' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=clang-asan --define=crypto=system + - name: 'NullVM on Linux/x86_64 with TSan' + engine: 'null' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=clang-tsan + - name: 'NullVM on Windows/x86_64' + engine: 'null' + os: windows-2022 + arch: x86_64 + action: test + targets: -//test/fuzz/... + - name: 'V8 on Linux/x86_64' + engine: 'v8' + repo: 'v8' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=hermetic-llvm --define=crypto=system + cache: true + - name: 'V8 on Linux/x86_64 with ASan' + engine: 'v8' + repo: 'v8' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=hermetic-llvm --config=clang-asan + cache: true + - name: 'V8 on Linux/x86_64 with TSan' + engine: 'v8' + repo: 'v8' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=hermetic-llvm --config=clang-tsan + cache: true + - name: 'V8 on Linux/x86_64 with GCC' + engine: 'v8' + repo: 'v8' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=gcc + cache: true + - name: 'V8 on Linux/aarch64' + engine: 'v8' + repo: 'v8' + os: ubuntu-24.04-arm + arch: aarch64 + action: test + targets: -//test/fuzz/... + flags: --config=hermetic-llvm --@v8//bazel/config:v8_target_cpu=arm64 + cache: true + - name: 'V8 on macOS/x86_64' + engine: 'v8' + repo: 'v8' + os: macos-13 + arch: x86_64 + action: test + flags: --config=hermetic-llvm-macos + cache: true + - name: 'WAMR interp on Linux/x86_64' + engine: 'wamr-interp' + repo: 'com_github_bytecodealliance_wasm_micro_runtime' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=clang + - name: 'WAMR interp on macOS/x86_64' + engine: 'wamr-interp' + repo: 'com_github_bytecodealliance_wasm_micro_runtime' + os: macos-13 + arch: x86_64 + action: test + - name: 'WAMR jit on Linux/x86_64' + engine: 'wamr-jit' + repo: 'com_github_bytecodealliance_wasm_micro_runtime' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=clang + deps: lld-18 + cache: true + - name: 'WAMR jit on macOS/x86_64' + engine: 'wamr-jit' + repo: 'com_github_bytecodealliance_wasm_micro_runtime' + os: macos-13 + arch: x86_64 + action: test + cache: true + - name: 'WasmEdge on Linux/x86_64' + engine: 'wasmedge' + repo: 'com_github_wasmedge_wasmedge' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=clang + - name: 'WasmEdge on macOS/x86_64' + engine: 'wasmedge' + repo: 'com_github_wasmedge_wasmedge' + os: macos-13 + arch: x86_64 + action: test + - name: 'Wasmtime on Linux/x86_64' + engine: 'wasmtime' + repo: 'com_github_bytecodealliance_wasmtime' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=clang -c opt + - name: 'Wasmtime on Linux/x86_64 with ASan' + engine: 'wasmtime' + repo: 'com_github_bytecodealliance_wasmtime' + os: ubuntu-24.04-16core + arch: x86_64 + action: test + flags: --config=clang-asan --define=crypto=system + - name: 'Wasmtime on Linux/aarch64' + engine: 'wasmtime' + repo: 'com_github_bytecodealliance_wasmtime' + os: ubuntu-24.04-arm + arch: aarch64 + action: build + flags: --config=hermetic-llvm + - name: 'Wasmtime on Linux/s390x' + engine: 'wasmtime' + repo: 'com_github_bytecodealliance_wasmtime' + os: ubuntu-24.04-16core + arch: s390x + action: test + flags: --config=clang --test_timeout=1800 + # s390x build-tools image built from bazel/external/Dockerfile.bazel + run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x ghcr.io/proxy-wasm/build-tools:ubuntu-22.04-bazel-6.5.0 + cache: true + - name: 'Wasmtime on macOS/x86_64' + engine: 'wasmtime' + repo: 'com_github_bytecodealliance_wasmtime' + os: macos-13 + arch: x86_64 + action: test + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies (Linux) + if: ${{ matrix.deps != '' && startsWith(matrix.os, 'ubuntu') }} + run: sudo apt update -y && sudo apt install -y ${{ matrix.deps }} + + # Needed for s390x test which runs on a GHCR Docker Ubuntu image. + - name: Login to GitHub Container Registry + if: startsWith(matrix.run_under, 'docker') + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Activate Docker/QEMU + if: startsWith(matrix.run_under, 'docker') + run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - name: set cache name + id: vars + # The cache tag consists of the following parts: + # * bazel-cache- prefix + # * matrix.name, which separates the cache for each build type. + # * hash of WORKSPACE, .bazelrc, and .bazelversion, which is + # purely to differentiate caches for substantial changes in bazel. + # * github.sha, which is the commit hash of the commit used to generate + # the cache entry. + run: echo "CACHE_TAG=bazel-cache-${{ matrix.name }}-${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion') }}" >> "$GITHUB_OUTPUT" + + - name: bazel cache + uses: actions/cache/restore@v3 + with: + path: /tmp/bazel/cache + key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} + restore-keys: | + ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} + ${{ steps.vars.outputs.CACHE_TAG }}- + bazel-cache-${{ matrix.name }}- + bazel-cache- + + - name: Download test data + uses: actions/download-artifact@v4 + with: + name: test_data + path: test/test_data/ + + - name: Mangle build rules to use existing test data + shell: bash + run: | + sed 's/\.wasm//g' test/BUILD > test/BUILD.tmp && mv test/BUILD.tmp test/BUILD + echo "package(default_visibility = [\"//visibility:public\"])" > test/test_data/BUILD + for i in $(cd test/test_data && ls -1 *.wasm | sed 's/\.wasm$//g'); do \ + echo "filegroup(name = \"$i\", srcs = [\"$i.wasm\"])" >> test/test_data/BUILD; \ + done + + - name: Bazel build/test + shell: bash + run: > + ${{ matrix.run_under }} + bazel ${{ matrix.action }} + --verbose_failures + --test_output=errors + --define engine=${{ matrix.engine }} + --disk_cache /tmp/bazel/cache + ${{ matrix.flags }} + -- //test/... ${{ matrix.targets }} + + - name: Bazel build/test (signed Wasm module) + if: ${{ matrix.engine != 'null' && !startsWith(matrix.os, 'windows') }} + run: > + ${{ matrix.run_under }} + bazel ${{ matrix.action }} + --verbose_failures + --test_output=errors + --define engine=${{ matrix.engine }} + --disk_cache /tmp/bazel/cache + ${{ matrix.flags }} + --per_file_copt=src/signature_util.cc,test/signature_util_test.cc@-DPROXY_WASM_VERIFY_WITH_ED25519_PUBKEY=\"$(xxd -p -c 256 test/test_data/signature_key1.pub | cut -b9-)\" + //test:signature_util_test + + - name: remove unaccessed files from cache + shell: bash + run: > + find /tmp/bazel/cache + -type f + -name '*' + -amin +360 + -exec rm {} \; + + - name: save bazel cache + uses: actions/cache/save@v3 + if: always() + with: + path: /tmp/bazel/cache + key: ${{ steps.vars.outputs.CACHE_TAG }}-${{ github.sha }} + diff --git a/.gitignore b/.gitignore index a6ef824c1..54c8a3b00 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /bazel-* +/external +/compile_commands.json +/.cache/ diff --git a/BUILD b/BUILD index 66d16d6ce..6db5fd903 100644 --- a/BUILD +++ b/BUILD @@ -1,11 +1,26 @@ -load("@rules_cc//cc:defs.bzl", "cc_library") +# Copyright 2022 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( "@proxy_wasm_cpp_host//bazel:select.bzl", - "proxy_wasm_select_runtime_v8", - "proxy_wasm_select_runtime_wamr", - "proxy_wasm_select_runtime_wasmtime", - "proxy_wasm_select_runtime_wavm", + "proxy_wasm_select_engine_null", + "proxy_wasm_select_engine_v8", + "proxy_wasm_select_engine_wamr", + "proxy_wasm_select_engine_wasmedge", + "proxy_wasm_select_engine_wasmtime", ) +load("@rules_cc//cc:defs.bzl", "cc_library") licenses(["notice"]) # Apache 2 @@ -13,9 +28,16 @@ package(default_visibility = ["//visibility:public"]) exports_files(["LICENSE"]) +filegroup( + name = "clang_tidy_config", + data = [".clang-tidy"], +) + cc_library( name = "wasm_vm_headers", hdrs = [ + "include/proxy-wasm/limits.h", + "include/proxy-wasm/sdk.h", "include/proxy-wasm/wasm_vm.h", "include/proxy-wasm/word.h", ], @@ -44,6 +66,9 @@ cc_library( "src/bytecode_util.cc", "src/context.cc", "src/exports.cc", + "src/hash.cc", + "src/hash.h", + "src/pairs_util.cc", "src/shared_data.cc", "src/shared_data.h", "src/shared_queue.cc", @@ -51,15 +76,24 @@ cc_library( "src/signature_util.cc", "src/vm_id_handle.cc", "src/wasm.cc", + "src/wasm.h", ], hdrs = [ "include/proxy-wasm/bytecode_util.h", + "include/proxy-wasm/pairs_util.h", "include/proxy-wasm/signature_util.h", ], + linkopts = select({ + "//bazel:crypto_system": ["-lcrypto"], + "//conditions:default": [], + }), deps = [ ":headers", - "@boringssl//:crypto", - ], + ] + select({ + "//bazel:crypto_system": [], + "//conditions:default": ["@boringssl//:crypto"], + }), + alwayslink = 1, ) cc_library( @@ -76,7 +110,10 @@ cc_library( "include/proxy-wasm/null_vm_plugin.h", "include/proxy-wasm/wasm_api_impl.h", ], - defines = ["PROXY_WASM_HAS_RUNTIME_NULL"], + defines = [ + "PROXY_WASM_HAS_RUNTIME_NULL", + "PROXY_WASM_HOST_ENGINE_NULL", + ], deps = [ ":headers", "@com_google_protobuf//:protobuf_lite", @@ -90,7 +127,10 @@ cc_library( "src/v8/v8.cc", ], hdrs = ["include/proxy-wasm/v8.h"], - defines = ["PROXY_WASM_HAS_RUNTIME_V8"], + defines = [ + "PROXY_WASM_HAS_RUNTIME_V8", + "PROXY_WASM_HOST_ENGINE_V8", + ], deps = [ ":wasm_vm_headers", "//external:wee8", @@ -105,13 +145,43 @@ cc_library( "src/wamr/wamr.cc", ], hdrs = ["include/proxy-wasm/wamr.h"], - defines = ["PROXY_WASM_HAS_RUNTIME_WAMR"], + defines = [ + "PROXY_WASM_HAS_RUNTIME_WAMR", + "PROXY_WASM_HOST_ENGINE_WAMR", + ], deps = [ ":wasm_vm_headers", "//external:wamr", ], ) +cc_library( + name = "wasmedge_lib", + srcs = [ + "src/common/types.h", + "src/wasmedge/types.h", + "src/wasmedge/wasmedge.cc", + ], + hdrs = ["include/proxy-wasm/wasmedge.h"], + defines = [ + "PROXY_WASM_HAS_RUNTIME_WASMEDGE", + "PROXY_WASM_HOST_ENGINE_WASMEDGE", + ], + linkopts = select({ + "@platforms//os:macos": [ + "-ldl", + ], + "//conditions:default": [ + "-lrt", + "-ldl", + ], + }), + deps = [ + ":wasm_vm_headers", + "//external:wasmedge", + ], +) + cc_library( name = "wasmtime_lib", srcs = [ @@ -120,28 +190,93 @@ cc_library( "src/wasmtime/wasmtime.cc", ], hdrs = ["include/proxy-wasm/wasmtime.h"], - defines = ["PROXY_WASM_HAS_RUNTIME_WASMTIME"], + copts = [ + "-DWASM_API_EXTERN=", + ], + defines = [ + "PROXY_WASM_HAS_RUNTIME_WASMTIME", + "PROXY_WASM_HOST_ENGINE_WASMTIME", + ], + # See: https://bytecodealliance.github.io/wasmtime/c-api/ + linkopts = select({ + "@platforms//os:macos": [], + "@platforms//os:windows": [ + "ws2_32.lib", + "advapi32.lib", + "userenv.lib", + "ntdll.lib", + "shell32.lib", + "ole32.lib", + "bcrypt.lib", + ], + "//conditions:default": [ + "-ldl", + "-lm", + "-lpthread", + ], + }), deps = [ ":wasm_vm_headers", "//external:wasmtime", ], ) +genrule( + name = "prefixed_wasmtime_sources", + srcs = [ + "src/wasmtime/types.h", + "src/wasmtime/wasmtime.cc", + ], + outs = [ + "src/wasmtime/prefixed_types.h", + "src/wasmtime/prefixed_wasmtime.cc", + ], + cmd = """ + for file in $(SRCS); do + sed -e 's/wasm_/wasmtime_wasm_/g' \ + -e 's/include\\/wasm.h/include\\/prefixed_wasm.h/g' \ + -e 's/wasmtime\\/types.h/wasmtime\\/prefixed_types.h/g' \ + $$file >$(@D)/$$(dirname $$file)/prefixed_$$(basename $$file) + done + """, +) + cc_library( - name = "wavm_lib", + name = "prefixed_wasmtime_lib", srcs = [ - "src/wavm/wavm.cc", + "src/common/types.h", + "src/wasmtime/prefixed_types.h", + "src/wasmtime/prefixed_wasmtime.cc", ], - hdrs = ["include/proxy-wasm/wavm.h"], + hdrs = ["include/proxy-wasm/wasmtime.h"], copts = [ - '-DWAVM_API=""', - "-Wno-non-virtual-dtor", - "-Wno-old-style-cast", + "-DWASM_API_EXTERN=", + ], + defines = [ + "PROXY_WASM_HAS_RUNTIME_WASMTIME", + "PROXY_WASM_HOST_ENGINE_WASMTIME", ], - defines = ["PROXY_WASM_HAS_RUNTIME_WAVM"], + # See: https://bytecodealliance.github.io/wasmtime/c-api/ + linkopts = select({ + "@platforms//os:macos": [], + "@platforms//os:windows": [ + "ws2_32.lib", + "advapi32.lib", + "userenv.lib", + "ntdll.lib", + "shell32.lib", + "ole32.lib", + "bcrypt.lib", + ], + "//conditions:default": [ + "-ldl", + "-lm", + "-lpthread", + ], + }), deps = [ ":wasm_vm_headers", - "//external:wavm", + "//external:prefixed_wasmtime", ], ) @@ -149,14 +284,16 @@ cc_library( name = "lib", deps = [ ":base_lib", - ":null_lib", - ] + proxy_wasm_select_runtime_v8( + ] + proxy_wasm_select_engine_null( + [":null_lib"], + ) + proxy_wasm_select_engine_v8( [":v8_lib"], - ) + proxy_wasm_select_runtime_wamr( + ) + proxy_wasm_select_engine_wamr( [":wamr_lib"], - ) + proxy_wasm_select_runtime_wasmtime( + ) + proxy_wasm_select_engine_wasmedge( + [":wasmedge_lib"], + ) + proxy_wasm_select_engine_wasmtime( [":wasmtime_lib"], - ) + proxy_wasm_select_runtime_wavm( - [":wavm_lib"], + [":prefixed_wasmtime_lib"], ), ) diff --git a/CODEOWNERS b/CODEOWNERS index 2bbe6fa17..e4190bb47 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1 @@ -* @PiotrSikora @mathetake +* @PiotrSikora @martijneken @mpwarres @leonm1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 654a07164..d3f60f57a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,3 +26,7 @@ information on using pull requests. This project follows [Google's Open Source Community Guidelines](https://opensource.google/conduct/). + +## Development + +See the [Development Guidelines](DEVELOPMENT.md). diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 000000000..791fe23a1 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,11 @@ +# Development guidelines + +## Generate compilation database + +[JSON Compilation Database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) files can be used by [clangd](https://clangd.llvm.org/) or similar tools to add source code cross-references and code completion functionality to editors. + +The following command can be used to generate the `compile_commands.json` file: + +``` +BAZEL_BUILD_OPTION_LIST="--define=engine=multi" ./tools/gen_compilation_database.py --include_all //test/... //:lib +``` diff --git a/README.md b/README.md index 8cb5694ee..bd198e723 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ # WebAssembly for Proxies (C++ host implementation) + +## How to Contribute + +See [CONTRIBUTING](CONTRIBUTING.md). diff --git a/WORKSPACE b/WORKSPACE index 2008efc3e..dad42c2f8 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,6 +8,22 @@ load("@proxy_wasm_cpp_host//bazel:dependencies.bzl", "proxy_wasm_cpp_host_depend proxy_wasm_cpp_host_dependencies() -load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") +load("@proxy_wasm_cpp_host//bazel:dependencies_python.bzl", "proxy_wasm_cpp_host_dependencies_python") -rules_foreign_cc_dependencies() +proxy_wasm_cpp_host_dependencies_python() + +load("@proxy_wasm_cpp_host//bazel:dependencies_import.bzl", "proxy_wasm_cpp_host_dependencies_import") + +proxy_wasm_cpp_host_dependencies_import() + +load("@proxy_wasm_cpp_sdk//bazel:repositories.bzl", "proxy_wasm_cpp_sdk_repositories") + +proxy_wasm_cpp_sdk_repositories() + +load("@proxy_wasm_cpp_sdk//bazel:dependencies.bzl", "proxy_wasm_cpp_sdk_dependencies") + +proxy_wasm_cpp_sdk_dependencies() + +load("@proxy_wasm_cpp_sdk//bazel:dependencies_extra.bzl", "proxy_wasm_cpp_sdk_dependencies_extra") + +proxy_wasm_cpp_sdk_dependencies_extra() diff --git a/bazel/BUILD b/bazel/BUILD index b6eb774cd..15f323fa7 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -1,19 +1,72 @@ +# Copyright 2022 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_skylib//lib:selects.bzl", "selects") + +package(default_visibility = ["//visibility:public"]) + +config_setting( + name = "engine_null", + values = {"define": "engine=null"}, +) + config_setting( - name = "runtime_v8", - values = {"define": "runtime=v8"}, + name = "engine_v8", + values = {"define": "engine=v8"}, ) config_setting( - name = "runtime_wamr", - values = {"define": "runtime=wamr"}, + name = "engine_wamr_interp", + values = {"define": "engine=wamr-interp"}, ) config_setting( - name = "runtime_wasmtime", - values = {"define": "runtime=wasmtime"}, + name = "engine_wamr_jit", + values = {"define": "engine=wamr-jit"}, ) config_setting( - name = "runtime_wavm", - values = {"define": "runtime=wavm"}, + name = "engine_wasmedge", + values = {"define": "engine=wasmedge"}, ) + +config_setting( + name = "engine_wasmtime", + values = {"define": "engine=wasmtime"}, +) + +config_setting( + name = "multiengine", + values = {"define": "engine=multi"}, +) + +config_setting( + name = "requested_crypto_system", + values = {"define": "crypto=system"}, +) + +config_setting( + name = "linux_s390x", + values = {"cpu": "s390x"}, +) + +selects.config_setting_group( + name = "crypto_system", + match_any = [ + ":requested_crypto_system", + ":linux_s390x", + ], +) + +exports_files(["tsan_suppressions.txt"]) diff --git a/bazel/cargo/BUILD.bazel b/bazel/cargo/BUILD.bazel deleted file mode 100644 index 1e5fb6888..000000000 --- a/bazel/cargo/BUILD.bazel +++ /dev/null @@ -1,86 +0,0 @@ -""" -@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 = "anyhow", - actual = "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - tags = [ - "cargo-raze", - "manual", - ], -) - -alias( - name = "env_logger", - actual = "@proxy_wasm_cpp_host__env_logger__0_8_3//:env_logger", - tags = [ - "cargo-raze", - "manual", - ], -) - -alias( - name = "once_cell", - actual = "@proxy_wasm_cpp_host__once_cell__1_7_2//:once_cell", - tags = [ - "cargo-raze", - "manual", - ], -) - -alias( - name = "wasmsign", - actual = "@proxy_wasm_cpp_host__wasmsign__0_1_2//:wasmsign", - tags = [ - "cargo-raze", - "manual", - ], -) - -alias( - # Extra aliased target, from raze configuration - # N.B.: The exact form of this is subject to change. - name = "cargo_bin_wasmsign", - actual = "@proxy_wasm_cpp_host__wasmsign__0_1_2//:cargo_bin_wasmsign", - tags = [ - "cargo-raze", - "manual", - ], -) - -alias( - name = "wasmtime", - actual = "@proxy_wasm_cpp_host__wasmtime__0_26_0//:wasmtime", - tags = [ - "cargo-raze", - "manual", - ], -) - -alias( - name = "wasmtime_c_api_macros", - actual = "@proxy_wasm_cpp_host__wasmtime_c_api_macros__0_19_0//:wasmtime_c_api_macros", - tags = [ - "cargo-raze", - "manual", - ], -) - -# Export file for Stardoc support -exports_files( - [ - "crates.bzl", - ], - visibility = ["//visibility:public"], -) diff --git a/bazel/cargo/Cargo.raze.lock b/bazel/cargo/Cargo.raze.lock deleted file mode 100644 index a4c2ece9f..000000000 --- a/bazel/cargo/Cargo.raze.lock +++ /dev/null @@ -1,936 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "addr2line" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" -dependencies = [ - "gimli 0.23.0", -] - -[[package]] -name = "addr2line" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03345e98af8f3d786b6d9f656ccfa6ac316d954e92bc4841f0bba20789d5fb5a" -dependencies = [ - "gimli 0.24.0", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" -dependencies = [ - "memchr", -] - -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - -[[package]] -name = "anyhow" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "backtrace" -version = "0.3.59" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4717cfcbfaa661a0fd48f8453951837ae7e8f81e481fbb136e3202d72805a744" -dependencies = [ - "addr2line 0.15.1", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object 0.24.0", - "rustc-demangle", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "cc" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "2.33.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim", - "textwrap", - "unicode-width", - "vec_map", -] - -[[package]] -name = "cpp_demangle" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390" -dependencies = [ - "cfg-if", - "glob", -] - -[[package]] -name = "cranelift-bforest" -version = "0.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07f641ec9146b7d7498d78cd832007d66ca44a9b61f23474d1fb78e5a3701e99" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1f2c0cd4ac12c954116ab2e26e40df0d51db322a855b5664fa208bc32d6686" -dependencies = [ - "byteorder", - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-entity", - "gimli 0.23.0", - "log", - "regalloc", - "serde", - "smallvec", - "target-lexicon", - "thiserror", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "105e11b2f0ff7ac81f80dd05ec938ce529a75e36f3d598360d806bb5bfa75e5a" -dependencies = [ - "cranelift-codegen-shared", - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e5eba2c1858d50abf023be4d88bd0450cb12d4ec2ba3ffac56353e6d09caf2" -dependencies = [ - "serde", -] - -[[package]] -name = "cranelift-entity" -version = "0.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79fa6fdd77a8d317763cd21668d3e72b96e09ac8a974326c6149f7de5aafa8ed" -dependencies = [ - "serde", -] - -[[package]] -name = "cranelift-frontend" -version = "0.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae11da9ca99f987c29e3eb39ebe10e9b879ecca30f3aeaee13db5e8e02b80fb6" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-native" -version = "0.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100ca4810058e23a5c4dcaedfa25289d1853f4a899d0960265aa7c54a4789351" -dependencies = [ - "cranelift-codegen", - "target-lexicon", -] - -[[package]] -name = "cranelift-wasm" -version = "0.73.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "607826643d74cf2cc36973ebffd1790a11d1781e14e3f95cf5529942b2168a67" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools", - "log", - "serde", - "smallvec", - "thiserror", - "wasmparser", -] - -[[package]] -name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "ed25519-compact" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf396058cc7285b342f9a10ed7a377f088942396c46c4c9a7eb4f0782cb1171" -dependencies = [ - "getrandom", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "env_logger" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17392a012ea30ef05a610aa97dfb49496e71c9f676b27879922ea5bdf60d9d3f" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - -[[package]] -name = "getrandom" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" -dependencies = [ - "fallible-iterator", - "indexmap", - "stable_deref_trait", -] - -[[package]] -name = "gimli" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" - -[[package]] -name = "hermit-abi" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" -dependencies = [ - "libc", -] - -[[package]] -name = "hmac-sha512" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e806677ce663d0a199541030c816847b36e8dc095f70dae4a4f4ad63da5383" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "indexmap" -version = "1.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" -dependencies = [ - "autocfg", - "hashbrown", - "serde", -] - -[[package]] -name = "itertools" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" -dependencies = [ - "either", -] - -[[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.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - -[[package]] -name = "memchr" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" - -[[package]] -name = "memoffset" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d" -dependencies = [ - "autocfg", -] - -[[package]] -name = "miniz_oxide" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] - -[[package]] -name = "more-asserts" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" - -[[package]] -name = "object" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" -dependencies = [ - "crc32fast", - "indexmap", -] - -[[package]] -name = "object" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170" - -[[package]] -name = "once_cell" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" - -[[package]] -name = "parity-wasm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" - -[[package]] -name = "paste" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" - -[[package]] -name = "ppv-lite86" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - -[[package]] -name = "proc-macro2" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "psm" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3abf49e5417290756acfd26501536358560c4a5cc4a0934d390939acb3e7083a" -dependencies = [ - "cc", -] - -[[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" -dependencies = [ - "rand_core", -] - -[[package]] -name = "regalloc" -version = "0.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" -dependencies = [ - "log", - "rustc-hash", - "serde", - "smallvec", -] - -[[package]] -name = "regex" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - -[[package]] -name = "region" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410f7acf3cb3a44527c5d9546bad4bf4e6c460915d5f9f2fc524498bfe8f70ce" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "serde" -version = "1.0.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "smallvec" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "syn" -version = "1.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "target-lexicon" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ae3b39281e4b14b8123bdbaddd472b7dfe215e444181f2f9d2443c2444f834" - -[[package]] -name = "termcolor" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "thiserror" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "unicode-width" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wasmparser" -version = "0.77.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35c86d22e720a07d954ebbed772d01180501afe7d03d464f413bb5f8914a8d6" - -[[package]] -name = "wasmsign" -version = "0.1.2" -source = "git+https://github.com/jedisct1/wasmsign#fa4d5598f778390df09be94232972b5b865a56b8" -dependencies = [ - "anyhow", - "byteorder", - "clap", - "ed25519-compact", - "hmac-sha512", - "parity-wasm", - "thiserror", -] - -[[package]] -name = "wasmtime" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4da03115f8ad36e50edeb6640f4ba27ed7e9a6f05c2f98f728c762966f7054c6" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "cfg-if", - "cpp_demangle", - "indexmap", - "lazy_static", - "libc", - "log", - "paste", - "psm", - "region", - "rustc-demangle", - "serde", - "smallvec", - "target-lexicon", - "wasmparser", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-profiling", - "wasmtime-runtime", - "winapi", -] - -[[package]] -name = "wasmtime-c-api-bazel" -version = "0.25.0" -dependencies = [ - "anyhow", - "env_logger", - "once_cell", - "wasmsign", - "wasmtime", - "wasmtime-c-api-macros", -] - -[[package]] -name = "wasmtime-c-api-macros" -version = "0.19.0" -source = "git+https://github.com/bytecodealliance/wasmtime?tag=v0.26.0#6b77786a6e758e91da9484a1c80b6fa5f88e1b3d" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "wasmtime-cranelift" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73c47553954eab22f432a7a60bcd695eb46508c2088cb0aa1cfd060538db3b6" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "cranelift-wasm", - "wasmparser", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-debug" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5241e603c262b2ee0dfb5b2245ad539d0a99f0589909fbffc91d2a8035f2d20a" -dependencies = [ - "anyhow", - "gimli 0.23.0", - "more-asserts", - "object 0.23.0", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-environ" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8d356abc04754f5936b9377441a4a202f6bba7ad997d2cd66acb3908bc85a3" -dependencies = [ - "anyhow", - "cfg-if", - "cranelift-codegen", - "cranelift-entity", - "cranelift-wasm", - "gimli 0.23.0", - "indexmap", - "log", - "more-asserts", - "region", - "serde", - "thiserror", - "wasmparser", -] - -[[package]] -name = "wasmtime-jit" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b066a3290a903c5beb7d765b3e82e00cd4f8ac0475297f91330fbe8e16bb17" -dependencies = [ - "addr2line 0.14.1", - "anyhow", - "cfg-if", - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", - "gimli 0.23.0", - "log", - "more-asserts", - "object 0.23.0", - "region", - "serde", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-cranelift", - "wasmtime-debug", - "wasmtime-environ", - "wasmtime-obj", - "wasmtime-profiling", - "wasmtime-runtime", - "winapi", -] - -[[package]] -name = "wasmtime-obj" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9d5c6c8924ea1fb2372d26c0546a8c5aab94001d5ddedaa36fd7b090c04de2" -dependencies = [ - "anyhow", - "more-asserts", - "object 0.23.0", - "target-lexicon", - "wasmtime-debug", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-profiling" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44760e80dd5f53e9af6c976120f9f1d35908ee0c646a3144083f0a57b7123ba7" -dependencies = [ - "anyhow", - "cfg-if", - "lazy_static", - "libc", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-runtime", -] - -[[package]] -name = "wasmtime-runtime" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9701c6412897ba3a10fb4e17c4ec29723ed33d6feaaaeaf59f53799107ce7351" -dependencies = [ - "anyhow", - "backtrace", - "cc", - "cfg-if", - "indexmap", - "lazy_static", - "libc", - "log", - "mach", - "memoffset", - "more-asserts", - "rand", - "region", - "thiserror", - "wasmtime-environ", - "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-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[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/Cargo.toml b/bazel/cargo/Cargo.toml deleted file mode 100644 index 1b7bdb132..000000000 --- a/bazel/cargo/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -edition = "2018" -name = "wasmtime-c-api-bazel" -version = "0.25.0" - -[lib] -path = "fake_lib.rs" - -[dependencies] -env_logger = "0.8" -anyhow = "1.0" -once_cell = "1.3" -wasmtime = {version = "0.26.0", default-features = false} -wasmtime-c-api-macros = {git = "https://github.com/bytecodealliance/wasmtime", tag = "v0.26.0", path = "crates/c-api/macros"} -wasmsign = {git = "https://github.com/jedisct1/wasmsign", revision = "fa4d5598f778390df09be94232972b5b865a56b8"} - -[package.metadata.raze] -rust_rules_workspace_name = "rules_rust" -gen_workspace_prefix = "proxy_wasm_cpp_host" -genmode = "Remote" -package_aliases_dir = "." -workspace_path = "//bazel/cargo" - -[package.metadata.raze.crates.wasmsign.'*'] -extra_aliased_targets = ["cargo_bin_wasmsign"] diff --git a/bazel/cargo/crates.bzl b/bazel/cargo/crates.bzl deleted file mode 100644 index c6b0c1920..000000000 --- a/bazel/cargo/crates.bzl +++ /dev/null @@ -1,970 +0,0 @@ -""" -@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 proxy_wasm_cpp_host_fetch_remote_crates(): - """This function defines a collection of repos and should be called in a WORKSPACE file""" - maybe( - http_archive, - name = "proxy_wasm_cpp_host__addr2line__0_14_1", - url = "https://crates.io/api/v1/crates/addr2line/0.14.1/download", - type = "tar.gz", - sha256 = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7", - strip_prefix = "addr2line-0.14.1", - build_file = Label("//bazel/cargo/remote:BUILD.addr2line-0.14.1.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__addr2line__0_15_1", - url = "https://crates.io/api/v1/crates/addr2line/0.15.1/download", - type = "tar.gz", - sha256 = "03345e98af8f3d786b6d9f656ccfa6ac316d954e92bc4841f0bba20789d5fb5a", - strip_prefix = "addr2line-0.15.1", - build_file = Label("//bazel/cargo/remote:BUILD.addr2line-0.15.1.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__adler__1_0_2", - url = "https://crates.io/api/v1/crates/adler/1.0.2/download", - type = "tar.gz", - sha256 = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe", - strip_prefix = "adler-1.0.2", - build_file = Label("//bazel/cargo/remote:BUILD.adler-1.0.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__aho_corasick__0_7_18", - url = "https://crates.io/api/v1/crates/aho-corasick/0.7.18/download", - type = "tar.gz", - sha256 = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f", - strip_prefix = "aho-corasick-0.7.18", - build_file = Label("//bazel/cargo/remote:BUILD.aho-corasick-0.7.18.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__ansi_term__0_11_0", - url = "https://crates.io/api/v1/crates/ansi_term/0.11.0/download", - type = "tar.gz", - sha256 = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b", - strip_prefix = "ansi_term-0.11.0", - build_file = Label("//bazel/cargo/remote:BUILD.ansi_term-0.11.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__anyhow__1_0_40", - url = "https://crates.io/api/v1/crates/anyhow/1.0.40/download", - type = "tar.gz", - sha256 = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b", - strip_prefix = "anyhow-1.0.40", - build_file = Label("//bazel/cargo/remote:BUILD.anyhow-1.0.40.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__atty__0_2_14", - url = "https://crates.io/api/v1/crates/atty/0.2.14/download", - type = "tar.gz", - sha256 = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8", - strip_prefix = "atty-0.2.14", - build_file = Label("//bazel/cargo/remote:BUILD.atty-0.2.14.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__backtrace__0_3_59", - url = "https://crates.io/api/v1/crates/backtrace/0.3.59/download", - type = "tar.gz", - sha256 = "4717cfcbfaa661a0fd48f8453951837ae7e8f81e481fbb136e3202d72805a744", - strip_prefix = "backtrace-0.3.59", - build_file = Label("//bazel/cargo/remote:BUILD.backtrace-0.3.59.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__bincode__1_3_3", - url = "https://crates.io/api/v1/crates/bincode/1.3.3/download", - type = "tar.gz", - sha256 = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad", - strip_prefix = "bincode-1.3.3", - build_file = Label("//bazel/cargo/remote:BUILD.bincode-1.3.3.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__byteorder__1_4_3", - url = "https://crates.io/api/v1/crates/byteorder/1.4.3/download", - type = "tar.gz", - sha256 = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610", - strip_prefix = "byteorder-1.4.3", - build_file = Label("//bazel/cargo/remote:BUILD.byteorder-1.4.3.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cc__1_0_67", - url = "https://crates.io/api/v1/crates/cc/1.0.67/download", - type = "tar.gz", - sha256 = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd", - strip_prefix = "cc-1.0.67", - build_file = Label("//bazel/cargo/remote:BUILD.cc-1.0.67.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__clap__2_33_3", - url = "https://crates.io/api/v1/crates/clap/2.33.3/download", - type = "tar.gz", - sha256 = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002", - strip_prefix = "clap-2.33.3", - build_file = Label("//bazel/cargo/remote:BUILD.clap-2.33.3.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cpp_demangle__0_3_2", - url = "https://crates.io/api/v1/crates/cpp_demangle/0.3.2/download", - type = "tar.gz", - sha256 = "44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390", - strip_prefix = "cpp_demangle-0.3.2", - build_file = Label("//bazel/cargo/remote:BUILD.cpp_demangle-0.3.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cranelift_bforest__0_73_0", - url = "https://crates.io/api/v1/crates/cranelift-bforest/0.73.0/download", - type = "tar.gz", - sha256 = "07f641ec9146b7d7498d78cd832007d66ca44a9b61f23474d1fb78e5a3701e99", - strip_prefix = "cranelift-bforest-0.73.0", - build_file = Label("//bazel/cargo/remote:BUILD.cranelift-bforest-0.73.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cranelift_codegen__0_73_0", - url = "https://crates.io/api/v1/crates/cranelift-codegen/0.73.0/download", - type = "tar.gz", - sha256 = "fd1f2c0cd4ac12c954116ab2e26e40df0d51db322a855b5664fa208bc32d6686", - strip_prefix = "cranelift-codegen-0.73.0", - build_file = Label("//bazel/cargo/remote:BUILD.cranelift-codegen-0.73.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cranelift_codegen_meta__0_73_0", - url = "https://crates.io/api/v1/crates/cranelift-codegen-meta/0.73.0/download", - type = "tar.gz", - sha256 = "105e11b2f0ff7ac81f80dd05ec938ce529a75e36f3d598360d806bb5bfa75e5a", - strip_prefix = "cranelift-codegen-meta-0.73.0", - build_file = Label("//bazel/cargo/remote:BUILD.cranelift-codegen-meta-0.73.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cranelift_codegen_shared__0_73_0", - url = "https://crates.io/api/v1/crates/cranelift-codegen-shared/0.73.0/download", - type = "tar.gz", - sha256 = "51e5eba2c1858d50abf023be4d88bd0450cb12d4ec2ba3ffac56353e6d09caf2", - strip_prefix = "cranelift-codegen-shared-0.73.0", - build_file = Label("//bazel/cargo/remote:BUILD.cranelift-codegen-shared-0.73.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cranelift_entity__0_73_0", - url = "https://crates.io/api/v1/crates/cranelift-entity/0.73.0/download", - type = "tar.gz", - sha256 = "79fa6fdd77a8d317763cd21668d3e72b96e09ac8a974326c6149f7de5aafa8ed", - strip_prefix = "cranelift-entity-0.73.0", - build_file = Label("//bazel/cargo/remote:BUILD.cranelift-entity-0.73.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cranelift_frontend__0_73_0", - url = "https://crates.io/api/v1/crates/cranelift-frontend/0.73.0/download", - type = "tar.gz", - sha256 = "ae11da9ca99f987c29e3eb39ebe10e9b879ecca30f3aeaee13db5e8e02b80fb6", - strip_prefix = "cranelift-frontend-0.73.0", - build_file = Label("//bazel/cargo/remote:BUILD.cranelift-frontend-0.73.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cranelift_native__0_73_0", - url = "https://crates.io/api/v1/crates/cranelift-native/0.73.0/download", - type = "tar.gz", - sha256 = "100ca4810058e23a5c4dcaedfa25289d1853f4a899d0960265aa7c54a4789351", - strip_prefix = "cranelift-native-0.73.0", - build_file = Label("//bazel/cargo/remote:BUILD.cranelift-native-0.73.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__cranelift_wasm__0_73_0", - url = "https://crates.io/api/v1/crates/cranelift-wasm/0.73.0/download", - type = "tar.gz", - sha256 = "607826643d74cf2cc36973ebffd1790a11d1781e14e3f95cf5529942b2168a67", - strip_prefix = "cranelift-wasm-0.73.0", - build_file = Label("//bazel/cargo/remote:BUILD.cranelift-wasm-0.73.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__crc32fast__1_2_1", - url = "https://crates.io/api/v1/crates/crc32fast/1.2.1/download", - type = "tar.gz", - sha256 = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a", - strip_prefix = "crc32fast-1.2.1", - build_file = Label("//bazel/cargo/remote:BUILD.crc32fast-1.2.1.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__ed25519_compact__0_1_9", - url = "https://crates.io/api/v1/crates/ed25519-compact/0.1.9/download", - type = "tar.gz", - sha256 = "aaf396058cc7285b342f9a10ed7a377f088942396c46c4c9a7eb4f0782cb1171", - strip_prefix = "ed25519-compact-0.1.9", - build_file = Label("//bazel/cargo/remote:BUILD.ed25519-compact-0.1.9.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__either__1_6_1", - url = "https://crates.io/api/v1/crates/either/1.6.1/download", - type = "tar.gz", - sha256 = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457", - strip_prefix = "either-1.6.1", - build_file = Label("//bazel/cargo/remote:BUILD.either-1.6.1.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__env_logger__0_8_3", - url = "https://crates.io/api/v1/crates/env_logger/0.8.3/download", - type = "tar.gz", - sha256 = "17392a012ea30ef05a610aa97dfb49496e71c9f676b27879922ea5bdf60d9d3f", - strip_prefix = "env_logger-0.8.3", - build_file = Label("//bazel/cargo/remote:BUILD.env_logger-0.8.3.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__fallible_iterator__0_2_0", - url = "https://crates.io/api/v1/crates/fallible-iterator/0.2.0/download", - type = "tar.gz", - sha256 = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7", - strip_prefix = "fallible-iterator-0.2.0", - build_file = Label("//bazel/cargo/remote:BUILD.fallible-iterator-0.2.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__gimli__0_23_0", - url = "https://crates.io/api/v1/crates/gimli/0.23.0/download", - type = "tar.gz", - sha256 = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce", - strip_prefix = "gimli-0.23.0", - build_file = Label("//bazel/cargo/remote:BUILD.gimli-0.23.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__gimli__0_24_0", - url = "https://crates.io/api/v1/crates/gimli/0.24.0/download", - type = "tar.gz", - sha256 = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189", - strip_prefix = "gimli-0.24.0", - build_file = Label("//bazel/cargo/remote:BUILD.gimli-0.24.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__glob__0_3_0", - url = "https://crates.io/api/v1/crates/glob/0.3.0/download", - type = "tar.gz", - sha256 = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574", - strip_prefix = "glob-0.3.0", - build_file = Label("//bazel/cargo/remote:BUILD.glob-0.3.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__hermit_abi__0_1_18", - url = "https://crates.io/api/v1/crates/hermit-abi/0.1.18/download", - type = "tar.gz", - sha256 = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c", - strip_prefix = "hermit-abi-0.1.18", - build_file = Label("//bazel/cargo/remote:BUILD.hermit-abi-0.1.18.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__hmac_sha512__0_1_9", - url = "https://crates.io/api/v1/crates/hmac-sha512/0.1.9/download", - type = "tar.gz", - sha256 = "77e806677ce663d0a199541030c816847b36e8dc095f70dae4a4f4ad63da5383", - strip_prefix = "hmac-sha512-0.1.9", - build_file = Label("//bazel/cargo/remote:BUILD.hmac-sha512-0.1.9.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__humantime__2_1_0", - url = "https://crates.io/api/v1/crates/humantime/2.1.0/download", - type = "tar.gz", - sha256 = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4", - strip_prefix = "humantime-2.1.0", - build_file = Label("//bazel/cargo/remote:BUILD.humantime-2.1.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__indexmap__1_6_2", - url = "https://crates.io/api/v1/crates/indexmap/1.6.2/download", - type = "tar.gz", - sha256 = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3", - strip_prefix = "indexmap-1.6.2", - build_file = Label("//bazel/cargo/remote:BUILD.indexmap-1.6.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__itertools__0_10_0", - url = "https://crates.io/api/v1/crates/itertools/0.10.0/download", - type = "tar.gz", - sha256 = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319", - strip_prefix = "itertools-0.10.0", - build_file = Label("//bazel/cargo/remote:BUILD.itertools-0.10.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__libc__0_2_94", - url = "https://crates.io/api/v1/crates/libc/0.2.94/download", - type = "tar.gz", - sha256 = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e", - strip_prefix = "libc-0.2.94", - build_file = Label("//bazel/cargo/remote:BUILD.libc-0.2.94.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__mach__0_3_2", - url = "https://crates.io/api/v1/crates/mach/0.3.2/download", - type = "tar.gz", - sha256 = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa", - strip_prefix = "mach-0.3.2", - build_file = Label("//bazel/cargo/remote:BUILD.mach-0.3.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__memchr__2_4_0", - url = "https://crates.io/api/v1/crates/memchr/2.4.0/download", - type = "tar.gz", - sha256 = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc", - strip_prefix = "memchr-2.4.0", - build_file = Label("//bazel/cargo/remote:BUILD.memchr-2.4.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__memoffset__0_6_3", - url = "https://crates.io/api/v1/crates/memoffset/0.6.3/download", - type = "tar.gz", - sha256 = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d", - strip_prefix = "memoffset-0.6.3", - build_file = Label("//bazel/cargo/remote:BUILD.memoffset-0.6.3.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__miniz_oxide__0_4_4", - url = "https://crates.io/api/v1/crates/miniz_oxide/0.4.4/download", - type = "tar.gz", - sha256 = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b", - strip_prefix = "miniz_oxide-0.4.4", - build_file = Label("//bazel/cargo/remote:BUILD.miniz_oxide-0.4.4.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__more_asserts__0_2_1", - url = "https://crates.io/api/v1/crates/more-asserts/0.2.1/download", - type = "tar.gz", - sha256 = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238", - strip_prefix = "more-asserts-0.2.1", - build_file = Label("//bazel/cargo/remote:BUILD.more-asserts-0.2.1.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__object__0_23_0", - url = "https://crates.io/api/v1/crates/object/0.23.0/download", - type = "tar.gz", - sha256 = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4", - strip_prefix = "object-0.23.0", - build_file = Label("//bazel/cargo/remote:BUILD.object-0.23.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__object__0_24_0", - url = "https://crates.io/api/v1/crates/object/0.24.0/download", - type = "tar.gz", - sha256 = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170", - strip_prefix = "object-0.24.0", - build_file = Label("//bazel/cargo/remote:BUILD.object-0.24.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__once_cell__1_7_2", - url = "https://crates.io/api/v1/crates/once_cell/1.7.2/download", - type = "tar.gz", - sha256 = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3", - strip_prefix = "once_cell-1.7.2", - build_file = Label("//bazel/cargo/remote:BUILD.once_cell-1.7.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__parity_wasm__0_42_2", - url = "https://crates.io/api/v1/crates/parity-wasm/0.42.2/download", - type = "tar.gz", - sha256 = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92", - strip_prefix = "parity-wasm-0.42.2", - build_file = Label("//bazel/cargo/remote:BUILD.parity-wasm-0.42.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__paste__1_0_5", - url = "https://crates.io/api/v1/crates/paste/1.0.5/download", - type = "tar.gz", - sha256 = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58", - strip_prefix = "paste-1.0.5", - build_file = Label("//bazel/cargo/remote:BUILD.paste-1.0.5.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__ppv_lite86__0_2_10", - url = "https://crates.io/api/v1/crates/ppv-lite86/0.2.10/download", - type = "tar.gz", - sha256 = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857", - strip_prefix = "ppv-lite86-0.2.10", - build_file = Label("//bazel/cargo/remote:BUILD.ppv-lite86-0.2.10.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__proc_macro2__1_0_26", - url = "https://crates.io/api/v1/crates/proc-macro2/1.0.26/download", - type = "tar.gz", - sha256 = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec", - strip_prefix = "proc-macro2-1.0.26", - build_file = Label("//bazel/cargo/remote:BUILD.proc-macro2-1.0.26.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__psm__0_1_12", - url = "https://crates.io/api/v1/crates/psm/0.1.12/download", - type = "tar.gz", - sha256 = "3abf49e5417290756acfd26501536358560c4a5cc4a0934d390939acb3e7083a", - strip_prefix = "psm-0.1.12", - build_file = Label("//bazel/cargo/remote:BUILD.psm-0.1.12.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__quote__1_0_9", - url = "https://crates.io/api/v1/crates/quote/1.0.9/download", - type = "tar.gz", - sha256 = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7", - strip_prefix = "quote-1.0.9", - build_file = Label("//bazel/cargo/remote:BUILD.quote-1.0.9.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__rand__0_8_3", - url = "https://crates.io/api/v1/crates/rand/0.8.3/download", - type = "tar.gz", - sha256 = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e", - strip_prefix = "rand-0.8.3", - build_file = Label("//bazel/cargo/remote:BUILD.rand-0.8.3.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__rand_chacha__0_3_0", - url = "https://crates.io/api/v1/crates/rand_chacha/0.3.0/download", - type = "tar.gz", - sha256 = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d", - strip_prefix = "rand_chacha-0.3.0", - build_file = Label("//bazel/cargo/remote:BUILD.rand_chacha-0.3.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__rand_core__0_6_2", - url = "https://crates.io/api/v1/crates/rand_core/0.6.2/download", - type = "tar.gz", - sha256 = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7", - strip_prefix = "rand_core-0.6.2", - build_file = Label("//bazel/cargo/remote:BUILD.rand_core-0.6.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__rand_hc__0_3_0", - url = "https://crates.io/api/v1/crates/rand_hc/0.3.0/download", - type = "tar.gz", - sha256 = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73", - strip_prefix = "rand_hc-0.3.0", - build_file = Label("//bazel/cargo/remote:BUILD.rand_hc-0.3.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__regalloc__0_0_31", - url = "https://crates.io/api/v1/crates/regalloc/0.0.31/download", - type = "tar.gz", - sha256 = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5", - strip_prefix = "regalloc-0.0.31", - build_file = Label("//bazel/cargo/remote:BUILD.regalloc-0.0.31.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__regex__1_5_4", - url = "https://crates.io/api/v1/crates/regex/1.5.4/download", - type = "tar.gz", - sha256 = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461", - strip_prefix = "regex-1.5.4", - build_file = Label("//bazel/cargo/remote:BUILD.regex-1.5.4.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__regex_syntax__0_6_25", - url = "https://crates.io/api/v1/crates/regex-syntax/0.6.25/download", - type = "tar.gz", - sha256 = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b", - strip_prefix = "regex-syntax-0.6.25", - build_file = Label("//bazel/cargo/remote:BUILD.regex-syntax-0.6.25.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__region__2_2_0", - url = "https://crates.io/api/v1/crates/region/2.2.0/download", - type = "tar.gz", - sha256 = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0", - strip_prefix = "region-2.2.0", - build_file = Label("//bazel/cargo/remote:BUILD.region-2.2.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__rustc_demangle__0_1_19", - url = "https://crates.io/api/v1/crates/rustc-demangle/0.1.19/download", - type = "tar.gz", - sha256 = "410f7acf3cb3a44527c5d9546bad4bf4e6c460915d5f9f2fc524498bfe8f70ce", - strip_prefix = "rustc-demangle-0.1.19", - build_file = Label("//bazel/cargo/remote:BUILD.rustc-demangle-0.1.19.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__rustc_hash__1_1_0", - url = "https://crates.io/api/v1/crates/rustc-hash/1.1.0/download", - type = "tar.gz", - sha256 = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2", - strip_prefix = "rustc-hash-1.1.0", - build_file = Label("//bazel/cargo/remote:BUILD.rustc-hash-1.1.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__serde__1_0_126", - url = "https://crates.io/api/v1/crates/serde/1.0.126/download", - type = "tar.gz", - sha256 = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03", - strip_prefix = "serde-1.0.126", - build_file = Label("//bazel/cargo/remote:BUILD.serde-1.0.126.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__serde_derive__1_0_126", - url = "https://crates.io/api/v1/crates/serde_derive/1.0.126/download", - type = "tar.gz", - sha256 = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43", - strip_prefix = "serde_derive-1.0.126", - build_file = Label("//bazel/cargo/remote:BUILD.serde_derive-1.0.126.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__smallvec__1_6_1", - url = "https://crates.io/api/v1/crates/smallvec/1.6.1/download", - type = "tar.gz", - sha256 = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e", - strip_prefix = "smallvec-1.6.1", - build_file = Label("//bazel/cargo/remote:BUILD.smallvec-1.6.1.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__stable_deref_trait__1_2_0", - url = "https://crates.io/api/v1/crates/stable_deref_trait/1.2.0/download", - type = "tar.gz", - sha256 = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3", - strip_prefix = "stable_deref_trait-1.2.0", - build_file = Label("//bazel/cargo/remote:BUILD.stable_deref_trait-1.2.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__strsim__0_8_0", - url = "https://crates.io/api/v1/crates/strsim/0.8.0/download", - type = "tar.gz", - sha256 = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a", - strip_prefix = "strsim-0.8.0", - build_file = Label("//bazel/cargo/remote:BUILD.strsim-0.8.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__syn__1_0_72", - url = "https://crates.io/api/v1/crates/syn/1.0.72/download", - type = "tar.gz", - sha256 = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82", - strip_prefix = "syn-1.0.72", - build_file = Label("//bazel/cargo/remote:BUILD.syn-1.0.72.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__target_lexicon__0_12_0", - url = "https://crates.io/api/v1/crates/target-lexicon/0.12.0/download", - type = "tar.gz", - sha256 = "64ae3b39281e4b14b8123bdbaddd472b7dfe215e444181f2f9d2443c2444f834", - strip_prefix = "target-lexicon-0.12.0", - build_file = Label("//bazel/cargo/remote:BUILD.target-lexicon-0.12.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__termcolor__1_1_2", - url = "https://crates.io/api/v1/crates/termcolor/1.1.2/download", - type = "tar.gz", - sha256 = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4", - strip_prefix = "termcolor-1.1.2", - build_file = Label("//bazel/cargo/remote:BUILD.termcolor-1.1.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__textwrap__0_11_0", - url = "https://crates.io/api/v1/crates/textwrap/0.11.0/download", - type = "tar.gz", - sha256 = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060", - strip_prefix = "textwrap-0.11.0", - build_file = Label("//bazel/cargo/remote:BUILD.textwrap-0.11.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__thiserror__1_0_24", - url = "https://crates.io/api/v1/crates/thiserror/1.0.24/download", - type = "tar.gz", - sha256 = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e", - strip_prefix = "thiserror-1.0.24", - build_file = Label("//bazel/cargo/remote:BUILD.thiserror-1.0.24.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__thiserror_impl__1_0_24", - url = "https://crates.io/api/v1/crates/thiserror-impl/1.0.24/download", - type = "tar.gz", - sha256 = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0", - strip_prefix = "thiserror-impl-1.0.24", - build_file = Label("//bazel/cargo/remote:BUILD.thiserror-impl-1.0.24.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__unicode_width__0_1_8", - url = "https://crates.io/api/v1/crates/unicode-width/0.1.8/download", - type = "tar.gz", - sha256 = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3", - strip_prefix = "unicode-width-0.1.8", - build_file = Label("//bazel/cargo/remote:BUILD.unicode-width-0.1.8.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__unicode_xid__0_2_2", - url = "https://crates.io/api/v1/crates/unicode-xid/0.2.2/download", - type = "tar.gz", - sha256 = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3", - strip_prefix = "unicode-xid-0.2.2", - build_file = Label("//bazel/cargo/remote:BUILD.unicode-xid-0.2.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__vec_map__0_8_2", - url = "https://crates.io/api/v1/crates/vec_map/0.8.2/download", - type = "tar.gz", - sha256 = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191", - strip_prefix = "vec_map-0.8.2", - build_file = Label("//bazel/cargo/remote:BUILD.vec_map-0.8.2.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__wasmparser__0_77_0", - url = "https://crates.io/api/v1/crates/wasmparser/0.77.0/download", - type = "tar.gz", - sha256 = "b35c86d22e720a07d954ebbed772d01180501afe7d03d464f413bb5f8914a8d6", - strip_prefix = "wasmparser-0.77.0", - build_file = Label("//bazel/cargo/remote:BUILD.wasmparser-0.77.0.bazel"), - ) - - maybe( - new_git_repository, - name = "proxy_wasm_cpp_host__wasmsign__0_1_2", - remote = "https://github.com/jedisct1/wasmsign", - commit = "fa4d5598f778390df09be94232972b5b865a56b8", - build_file = Label("//bazel/cargo/remote:BUILD.wasmsign-0.1.2.bazel"), - init_submodules = True, - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__wasmtime__0_26_0", - url = "https://crates.io/api/v1/crates/wasmtime/0.26.0/download", - type = "tar.gz", - sha256 = "4da03115f8ad36e50edeb6640f4ba27ed7e9a6f05c2f98f728c762966f7054c6", - strip_prefix = "wasmtime-0.26.0", - build_file = Label("//bazel/cargo/remote:BUILD.wasmtime-0.26.0.bazel"), - ) - - maybe( - new_git_repository, - name = "proxy_wasm_cpp_host__wasmtime_c_api_macros__0_19_0", - remote = "https://github.com/bytecodealliance/wasmtime", - commit = "6b77786a6e758e91da9484a1c80b6fa5f88e1b3d", - build_file = Label("//bazel/cargo/remote:BUILD.wasmtime-c-api-macros-0.19.0.bazel"), - init_submodules = True, - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__wasmtime_cranelift__0_26_0", - url = "https://crates.io/api/v1/crates/wasmtime-cranelift/0.26.0/download", - type = "tar.gz", - sha256 = "b73c47553954eab22f432a7a60bcd695eb46508c2088cb0aa1cfd060538db3b6", - strip_prefix = "wasmtime-cranelift-0.26.0", - build_file = Label("//bazel/cargo/remote:BUILD.wasmtime-cranelift-0.26.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__wasmtime_debug__0_26_0", - url = "https://crates.io/api/v1/crates/wasmtime-debug/0.26.0/download", - type = "tar.gz", - sha256 = "5241e603c262b2ee0dfb5b2245ad539d0a99f0589909fbffc91d2a8035f2d20a", - strip_prefix = "wasmtime-debug-0.26.0", - build_file = Label("//bazel/cargo/remote:BUILD.wasmtime-debug-0.26.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__wasmtime_environ__0_26_0", - url = "https://crates.io/api/v1/crates/wasmtime-environ/0.26.0/download", - type = "tar.gz", - sha256 = "fb8d356abc04754f5936b9377441a4a202f6bba7ad997d2cd66acb3908bc85a3", - strip_prefix = "wasmtime-environ-0.26.0", - build_file = Label("//bazel/cargo/remote:BUILD.wasmtime-environ-0.26.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__wasmtime_jit__0_26_0", - url = "https://crates.io/api/v1/crates/wasmtime-jit/0.26.0/download", - type = "tar.gz", - sha256 = "81b066a3290a903c5beb7d765b3e82e00cd4f8ac0475297f91330fbe8e16bb17", - strip_prefix = "wasmtime-jit-0.26.0", - build_file = Label("//bazel/cargo/remote:BUILD.wasmtime-jit-0.26.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__wasmtime_obj__0_26_0", - url = "https://crates.io/api/v1/crates/wasmtime-obj/0.26.0/download", - type = "tar.gz", - sha256 = "bd9d5c6c8924ea1fb2372d26c0546a8c5aab94001d5ddedaa36fd7b090c04de2", - strip_prefix = "wasmtime-obj-0.26.0", - build_file = Label("//bazel/cargo/remote:BUILD.wasmtime-obj-0.26.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__wasmtime_profiling__0_26_0", - url = "https://crates.io/api/v1/crates/wasmtime-profiling/0.26.0/download", - type = "tar.gz", - sha256 = "44760e80dd5f53e9af6c976120f9f1d35908ee0c646a3144083f0a57b7123ba7", - strip_prefix = "wasmtime-profiling-0.26.0", - build_file = Label("//bazel/cargo/remote:BUILD.wasmtime-profiling-0.26.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__wasmtime_runtime__0_26_0", - url = "https://crates.io/api/v1/crates/wasmtime-runtime/0.26.0/download", - type = "tar.gz", - sha256 = "9701c6412897ba3a10fb4e17c4ec29723ed33d6feaaaeaf59f53799107ce7351", - strip_prefix = "wasmtime-runtime-0.26.0", - build_file = Label("//bazel/cargo/remote:BUILD.wasmtime-runtime-0.26.0.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__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 = "proxy_wasm_cpp_host__winapi_util__0_1_5", - url = "https://crates.io/api/v1/crates/winapi-util/0.1.5/download", - type = "tar.gz", - sha256 = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178", - strip_prefix = "winapi-util-0.1.5", - build_file = Label("//bazel/cargo/remote:BUILD.winapi-util-0.1.5.bazel"), - ) - - maybe( - http_archive, - name = "proxy_wasm_cpp_host__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.addr2line-0.14.1.bazel b/bazel/cargo/remote/BUILD.addr2line-0.14.1.bazel deleted file mode 100644 index 258f44940..000000000 --- a/bazel/cargo/remote/BUILD.addr2line-0.14.1.bazel +++ /dev/null @@ -1,62 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "addr2line" with type "example" omitted - -rust_library( - name = "addr2line", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.14.1", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__gimli__0_23_0//:gimli", - ], -) - -# Unsupported target "correctness" with type "test" omitted - -# Unsupported target "output_equivalence" with type "test" omitted - -# Unsupported target "parse" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.addr2line-0.15.1.bazel b/bazel/cargo/remote/BUILD.addr2line-0.15.1.bazel deleted file mode 100644 index be83fd09f..000000000 --- a/bazel/cargo/remote/BUILD.addr2line-0.15.1.bazel +++ /dev/null @@ -1,62 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "addr2line" with type "example" omitted - -rust_library( - name = "addr2line", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.15.1", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__gimli__0_24_0//:gimli", - ], -) - -# Unsupported target "correctness" with type "test" omitted - -# Unsupported target "output_equivalence" with type "test" omitted - -# Unsupported target "parse" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.adler-1.0.2.bazel b/bazel/cargo/remote/BUILD.adler-1.0.2.bazel deleted file mode 100644 index c5cb69602..000000000 --- a/bazel/cargo/remote/BUILD.adler-1.0.2.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "0BSD OR (MIT OR Apache-2.0)" -]) - -# Generated Targets - -# Unsupported target "bench" with type "bench" omitted - -rust_library( - name = "adler", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.2", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.aho-corasick-0.7.18.bazel b/bazel/cargo/remote/BUILD.aho-corasick-0.7.18.bazel deleted file mode 100644 index 6b70370af..000000000 --- a/bazel/cargo/remote/BUILD.aho-corasick-0.7.18.bazel +++ /dev/null @@ -1,56 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "aho_corasick", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.7.18", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__memchr__2_4_0//:memchr", - ], -) diff --git a/bazel/cargo/remote/BUILD.ansi_term-0.11.0.bazel b/bazel/cargo/remote/BUILD.ansi_term-0.11.0.bazel deleted file mode 100644 index a05ec6e27..000000000 --- a/bazel/cargo/remote/BUILD.ansi_term-0.11.0.bazel +++ /dev/null @@ -1,66 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "colours" with type "example" omitted - -rust_library( - name = "ansi_term", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.11.0", - # buildifier: leave-alone - deps = [ - ] + selects.with_or({ - # cfg(target_os = "windows") - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - "@proxy_wasm_cpp_host__winapi__0_3_9//:winapi", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.anyhow-1.0.40.bazel b/bazel/cargo/remote/BUILD.anyhow-1.0.40.bazel deleted file mode 100644 index ba8033e8b..000000000 --- a/bazel/cargo/remote/BUILD.anyhow-1.0.40.bazel +++ /dev/null @@ -1,113 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "anyhow_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - "std", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.40", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "anyhow", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.40", - # buildifier: leave-alone - deps = [ - ":anyhow_build_script", - ], -) - -# Unsupported target "compiletest" with type "test" omitted - -# Unsupported target "test_autotrait" with type "test" omitted - -# Unsupported target "test_backtrace" with type "test" omitted - -# Unsupported target "test_boxed" with type "test" omitted - -# Unsupported target "test_chain" with type "test" omitted - -# Unsupported target "test_context" with type "test" omitted - -# Unsupported target "test_convert" with type "test" omitted - -# Unsupported target "test_downcast" with type "test" omitted - -# Unsupported target "test_ffi" with type "test" omitted - -# Unsupported target "test_fmt" with type "test" omitted - -# Unsupported target "test_macros" with type "test" omitted - -# Unsupported target "test_repr" with type "test" omitted - -# Unsupported target "test_source" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.atty-0.2.14.bazel b/bazel/cargo/remote/BUILD.atty-0.2.14.bazel deleted file mode 100644 index e5f020a0d..000000000 --- a/bazel/cargo/remote/BUILD.atty-0.2.14.bazel +++ /dev/null @@ -1,89 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "atty" with type "example" omitted - -rust_library( - name = "atty", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.2.14", - # buildifier: leave-alone - deps = [ - ] + selects.with_or({ - # cfg(unix) - ( - "@rules_rust//rust/platform:aarch64-apple-darwin", - "@rules_rust//rust/platform:aarch64-apple-ios", - "@rules_rust//rust/platform:aarch64-linux-android", - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@rules_rust//rust/platform:i686-apple-darwin", - "@rules_rust//rust/platform:i686-linux-android", - "@rules_rust//rust/platform:i686-unknown-freebsd", - "@rules_rust//rust/platform:i686-unknown-linux-gnu", - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@rules_rust//rust/platform:x86_64-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-ios", - "@rules_rust//rust/platform:x86_64-linux-android", - "@rules_rust//rust/platform:x86_64-unknown-freebsd", - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", - ): [ - "@proxy_wasm_cpp_host__libc__0_2_94//:libc", - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(windows) - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - "@proxy_wasm_cpp_host__winapi__0_3_9//:winapi", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel b/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel deleted file mode 100644 index 22a819b6e..000000000 --- a/bazel/cargo/remote/BUILD.autocfg-1.0.1.bazel +++ /dev/null @@ -1,63 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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", - data = [], - 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.backtrace-0.3.59.bazel b/bazel/cargo/remote/BUILD.backtrace-0.3.59.bazel deleted file mode 100644 index bc4593f4c..000000000 --- a/bazel/cargo/remote/BUILD.backtrace-0.3.59.bazel +++ /dev/null @@ -1,128 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "backtrace_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - "std", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.59", - visibility = ["//visibility:private"], - deps = [ - "@proxy_wasm_cpp_host__cc__1_0_67//:cc", - ] + selects.with_or({ - # cfg(windows) - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - ], - "//conditions:default": [], - }), -) - -# Unsupported target "benchmarks" with type "bench" omitted - -# Unsupported target "backtrace" with type "example" omitted - -# Unsupported target "raw" with type "example" omitted - -rust_library( - name = "backtrace", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.59", - # buildifier: leave-alone - deps = [ - ":backtrace_build_script", - "@proxy_wasm_cpp_host__addr2line__0_15_1//:addr2line", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - "@proxy_wasm_cpp_host__libc__0_2_94//:libc", - "@proxy_wasm_cpp_host__miniz_oxide__0_4_4//:miniz_oxide", - "@proxy_wasm_cpp_host__object__0_24_0//:object", - "@proxy_wasm_cpp_host__rustc_demangle__0_1_19//:rustc_demangle", - ] + selects.with_or({ - # cfg(windows) - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - ], - "//conditions:default": [], - }), -) - -# Unsupported target "accuracy" with type "test" omitted - -# Unsupported target "concurrent-panics" with type "test" omitted - -# Unsupported target "long_fn_name" with type "test" omitted - -# Unsupported target "skip_inner_frames" with type "test" omitted - -# Unsupported target "smoke" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.bazel b/bazel/cargo/remote/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/bazel/cargo/remote/BUILD.bincode-1.3.3.bazel b/bazel/cargo/remote/BUILD.bincode-1.3.3.bazel deleted file mode 100644 index e544d8b53..000000000 --- a/bazel/cargo/remote/BUILD.bincode-1.3.3.bazel +++ /dev/null @@ -1,56 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "bincode", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.3.3", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - ], -) - -# Unsupported target "test" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.bitflags-1.2.1.bazel b/bazel/cargo/remote/BUILD.bitflags-1.2.1.bazel deleted file mode 100644 index 2ff7b8554..000000000 --- a/bazel/cargo/remote/BUILD.bitflags-1.2.1.bazel +++ /dev/null @@ -1,85 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "bitflags_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.2.1", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "bitflags", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.2.1", - # buildifier: leave-alone - deps = [ - ":bitflags_build_script", - ], -) diff --git a/bazel/cargo/remote/BUILD.byteorder-1.4.3.bazel b/bazel/cargo/remote/BUILD.byteorder-1.4.3.bazel deleted file mode 100644 index b998b1fbd..000000000 --- a/bazel/cargo/remote/BUILD.byteorder-1.4.3.bazel +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.4.3", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.cc-1.0.67.bazel b/bazel/cargo/remote/BUILD.cc-1.0.67.bazel deleted file mode 100644 index 8e2d391b2..000000000 --- a/bazel/cargo/remote/BUILD.cc-1.0.67.bazel +++ /dev/null @@ -1,85 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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_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_gcc_shim", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/bin/gcc-shim.rs", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.67", - # buildifier: leave-alone - deps = [ - ":cc", - ], -) - -rust_library( - name = "cc", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.67", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "cc_env" with type "test" omitted - -# Unsupported target "cflags" with type "test" omitted - -# Unsupported target "cxxflags" with type "test" omitted - -# Unsupported target "test" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel b/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel deleted file mode 100644 index c921ef918..000000000 --- a/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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", - data = [], - 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.clap-2.33.3.bazel b/bazel/cargo/remote/BUILD.clap-2.33.3.bazel deleted file mode 100644 index 2211f357c..000000000 --- a/bazel/cargo/remote/BUILD.clap-2.33.3.bazel +++ /dev/null @@ -1,93 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "clap", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - "ansi_term", - "atty", - "color", - "default", - "strsim", - "suggestions", - "vec_map", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "2.33.3", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__atty__0_2_14//:atty", - "@proxy_wasm_cpp_host__bitflags__1_2_1//:bitflags", - "@proxy_wasm_cpp_host__strsim__0_8_0//:strsim", - "@proxy_wasm_cpp_host__textwrap__0_11_0//:textwrap", - "@proxy_wasm_cpp_host__unicode_width__0_1_8//:unicode_width", - "@proxy_wasm_cpp_host__vec_map__0_8_2//:vec_map", - ] + selects.with_or({ - # cfg(not(windows)) - ( - "@rules_rust//rust/platform:aarch64-apple-darwin", - "@rules_rust//rust/platform:aarch64-apple-ios", - "@rules_rust//rust/platform:aarch64-linux-android", - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@rules_rust//rust/platform:i686-apple-darwin", - "@rules_rust//rust/platform:i686-linux-android", - "@rules_rust//rust/platform:i686-unknown-freebsd", - "@rules_rust//rust/platform:i686-unknown-linux-gnu", - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@rules_rust//rust/platform:wasm32-unknown-unknown", - "@rules_rust//rust/platform:wasm32-wasi", - "@rules_rust//rust/platform:x86_64-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-ios", - "@rules_rust//rust/platform:x86_64-linux-android", - "@rules_rust//rust/platform:x86_64-unknown-freebsd", - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", - ): [ - "@proxy_wasm_cpp_host__ansi_term__0_11_0//:ansi_term", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.cpp_demangle-0.3.2.bazel b/bazel/cargo/remote/BUILD.cpp_demangle-0.3.2.bazel deleted file mode 100644 index ea8503d58..000000000 --- a/bazel/cargo/remote/BUILD.cpp_demangle-0.3.2.bazel +++ /dev/null @@ -1,119 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 -# buildifier: disable=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "cpp_demangle_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.3.2", - visibility = ["//visibility:private"], - deps = [ - "@proxy_wasm_cpp_host__glob__0_3_0//:glob", - ], -) - -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_afl_runner", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/bin/afl_runner.rs", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.2", - # buildifier: leave-alone - deps = [ - ":cpp_demangle", - ":cpp_demangle_build_script", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - ], -) - -# Unsupported target "cppfilt" with type "example" omitted - -rust_library( - name = "cpp_demangle", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.2", - # buildifier: leave-alone - deps = [ - ":cpp_demangle_build_script", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - ], -) diff --git a/bazel/cargo/remote/BUILD.cranelift-bforest-0.73.0.bazel b/bazel/cargo/remote/BUILD.cranelift-bforest-0.73.0.bazel deleted file mode 100644 index d97edd650..000000000 --- a/bazel/cargo/remote/BUILD.cranelift-bforest-0.73.0.bazel +++ /dev/null @@ -1,54 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "cranelift_bforest", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.73.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__cranelift_entity__0_73_0//:cranelift_entity", - ], -) diff --git a/bazel/cargo/remote/BUILD.cranelift-codegen-0.73.0.bazel b/bazel/cargo/remote/BUILD.cranelift-codegen-0.73.0.bazel deleted file mode 100644 index 8753f4f8a..000000000 --- a/bazel/cargo/remote/BUILD.cranelift-codegen-0.73.0.bazel +++ /dev/null @@ -1,107 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets -# buildifier: disable=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "cranelift_codegen_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - "enable-serde", - "gimli", - "serde", - "std", - "unwind", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.73.0", - visibility = ["//visibility:private"], - deps = [ - "@proxy_wasm_cpp_host__cranelift_codegen_meta__0_73_0//:cranelift_codegen_meta", - ], -) - -rust_library( - name = "cranelift_codegen", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "enable-serde", - "gimli", - "serde", - "std", - "unwind", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.73.0", - # buildifier: leave-alone - deps = [ - ":cranelift_codegen_build_script", - "@proxy_wasm_cpp_host__byteorder__1_4_3//:byteorder", - "@proxy_wasm_cpp_host__cranelift_bforest__0_73_0//:cranelift_bforest", - "@proxy_wasm_cpp_host__cranelift_codegen_shared__0_73_0//:cranelift_codegen_shared", - "@proxy_wasm_cpp_host__cranelift_entity__0_73_0//:cranelift_entity", - "@proxy_wasm_cpp_host__gimli__0_23_0//:gimli", - "@proxy_wasm_cpp_host__log__0_4_14//:log", - "@proxy_wasm_cpp_host__regalloc__0_0_31//:regalloc", - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - "@proxy_wasm_cpp_host__smallvec__1_6_1//:smallvec", - "@proxy_wasm_cpp_host__target_lexicon__0_12_0//:target_lexicon", - "@proxy_wasm_cpp_host__thiserror__1_0_24//:thiserror", - ], -) diff --git a/bazel/cargo/remote/BUILD.cranelift-codegen-meta-0.73.0.bazel b/bazel/cargo/remote/BUILD.cranelift-codegen-meta-0.73.0.bazel deleted file mode 100644 index db0b9ef6d..000000000 --- a/bazel/cargo/remote/BUILD.cranelift-codegen-meta-0.73.0.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "cranelift_codegen_meta", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.73.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__cranelift_codegen_shared__0_73_0//:cranelift_codegen_shared", - "@proxy_wasm_cpp_host__cranelift_entity__0_73_0//:cranelift_entity", - ], -) diff --git a/bazel/cargo/remote/BUILD.cranelift-codegen-shared-0.73.0.bazel b/bazel/cargo/remote/BUILD.cranelift-codegen-shared-0.73.0.bazel deleted file mode 100644 index 246ce325c..000000000 --- a/bazel/cargo/remote/BUILD.cranelift-codegen-shared-0.73.0.bazel +++ /dev/null @@ -1,56 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "cranelift_codegen_shared", - srcs = glob(["**/*.rs"]), - crate_features = [ - "enable-serde", - "serde", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.73.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - ], -) diff --git a/bazel/cargo/remote/BUILD.cranelift-entity-0.73.0.bazel b/bazel/cargo/remote/BUILD.cranelift-entity-0.73.0.bazel deleted file mode 100644 index 029d2c15b..000000000 --- a/bazel/cargo/remote/BUILD.cranelift-entity-0.73.0.bazel +++ /dev/null @@ -1,56 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "cranelift_entity", - srcs = glob(["**/*.rs"]), - crate_features = [ - "enable-serde", - "serde", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.73.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - ], -) diff --git a/bazel/cargo/remote/BUILD.cranelift-frontend-0.73.0.bazel b/bazel/cargo/remote/BUILD.cranelift-frontend-0.73.0.bazel deleted file mode 100644 index d3ae1b2c1..000000000 --- a/bazel/cargo/remote/BUILD.cranelift-frontend-0.73.0.bazel +++ /dev/null @@ -1,59 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "cranelift_frontend", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.73.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__cranelift_codegen__0_73_0//:cranelift_codegen", - "@proxy_wasm_cpp_host__log__0_4_14//:log", - "@proxy_wasm_cpp_host__smallvec__1_6_1//:smallvec", - "@proxy_wasm_cpp_host__target_lexicon__0_12_0//:target_lexicon", - ], -) diff --git a/bazel/cargo/remote/BUILD.cranelift-native-0.73.0.bazel b/bazel/cargo/remote/BUILD.cranelift-native-0.73.0.bazel deleted file mode 100644 index 85ec5cf92..000000000 --- a/bazel/cargo/remote/BUILD.cranelift-native-0.73.0.bazel +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "cranelift_native", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.73.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__cranelift_codegen__0_73_0//:cranelift_codegen", - "@proxy_wasm_cpp_host__target_lexicon__0_12_0//:target_lexicon", - ], -) diff --git a/bazel/cargo/remote/BUILD.cranelift-wasm-0.73.0.bazel b/bazel/cargo/remote/BUILD.cranelift-wasm-0.73.0.bazel deleted file mode 100644 index e6d689ee7..000000000 --- a/bazel/cargo/remote/BUILD.cranelift-wasm-0.73.0.bazel +++ /dev/null @@ -1,68 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "cranelift_wasm", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "enable-serde", - "serde", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.73.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__cranelift_codegen__0_73_0//:cranelift_codegen", - "@proxy_wasm_cpp_host__cranelift_entity__0_73_0//:cranelift_entity", - "@proxy_wasm_cpp_host__cranelift_frontend__0_73_0//:cranelift_frontend", - "@proxy_wasm_cpp_host__itertools__0_10_0//:itertools", - "@proxy_wasm_cpp_host__log__0_4_14//:log", - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - "@proxy_wasm_cpp_host__smallvec__1_6_1//:smallvec", - "@proxy_wasm_cpp_host__thiserror__1_0_24//:thiserror", - "@proxy_wasm_cpp_host__wasmparser__0_77_0//:wasmparser", - ], -) - -# Unsupported target "wasm_testsuite" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.crc32fast-1.2.1.bazel b/bazel/cargo/remote/BUILD.crc32fast-1.2.1.bazel deleted file mode 100644 index a48eb6586..000000000 --- a/bazel/cargo/remote/BUILD.crc32fast-1.2.1.bazel +++ /dev/null @@ -1,90 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "crc32fast_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 = "1.2.1", - visibility = ["//visibility:private"], - deps = [ - ], -) - -# Unsupported target "bench" with type "bench" omitted - -rust_library( - name = "crc32fast", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.2.1", - # buildifier: leave-alone - deps = [ - ":crc32fast_build_script", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - ], -) diff --git a/bazel/cargo/remote/BUILD.ed25519-compact-0.1.9.bazel b/bazel/cargo/remote/BUILD.ed25519-compact-0.1.9.bazel deleted file mode 100644 index 166ee5922..000000000 --- a/bazel/cargo/remote/BUILD.ed25519-compact-0.1.9.bazel +++ /dev/null @@ -1,58 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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", # ISC from expression "ISC" -]) - -# Generated Targets - -rust_library( - name = "ed25519_compact", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "getrandom", - "random", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.9", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__getrandom__0_2_2//:getrandom", - ], -) diff --git a/bazel/cargo/remote/BUILD.either-1.6.1.bazel b/bazel/cargo/remote/BUILD.either-1.6.1.bazel deleted file mode 100644 index 49161e7d1..000000000 --- a/bazel/cargo/remote/BUILD.either-1.6.1.bazel +++ /dev/null @@ -1,53 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "either", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.6.1", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.env_logger-0.8.3.bazel b/bazel/cargo/remote/BUILD.env_logger-0.8.3.bazel deleted file mode 100644 index ca68a4bf8..000000000 --- a/bazel/cargo/remote/BUILD.env_logger-0.8.3.bazel +++ /dev/null @@ -1,71 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "env_logger", - srcs = glob(["**/*.rs"]), - crate_features = [ - "atty", - "default", - "humantime", - "regex", - "termcolor", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.8.3", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__atty__0_2_14//:atty", - "@proxy_wasm_cpp_host__humantime__2_1_0//:humantime", - "@proxy_wasm_cpp_host__log__0_4_14//:log", - "@proxy_wasm_cpp_host__regex__1_5_4//:regex", - "@proxy_wasm_cpp_host__termcolor__1_1_2//:termcolor", - ], -) - -# Unsupported target "init-twice-retains-filter" with type "test" omitted - -# Unsupported target "log-in-log" with type "test" omitted - -# Unsupported target "log_tls_dtors" with type "test" omitted - -# Unsupported target "regexp_filter" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.fallible-iterator-0.2.0.bazel b/bazel/cargo/remote/BUILD.fallible-iterator-0.2.0.bazel deleted file mode 100644 index 8ec69bc6c..000000000 --- a/bazel/cargo/remote/BUILD.fallible-iterator-0.2.0.bazel +++ /dev/null @@ -1,54 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "fallible_iterator", - srcs = glob(["**/*.rs"]), - crate_features = [ - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.2.0", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel b/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel deleted file mode 100644 index b0c3b88f9..000000000 --- a/bazel/cargo/remote/BUILD.getrandom-0.2.2.bazel +++ /dev/null @@ -1,170 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "getrandom_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "std", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.2.2", - visibility = ["//visibility:private"], - deps = [ - ] + selects.with_or({ - # cfg(all(target_arch = "wasm32", target_os = "unknown")) - ( - "@rules_rust//rust/platform:wasm32-unknown-unknown", - ): [ - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(target_os = "wasi") - ( - "@rules_rust//rust/platform:wasm32-wasi", - ): [ - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(unix) - ( - "@rules_rust//rust/platform:aarch64-apple-darwin", - "@rules_rust//rust/platform:aarch64-apple-ios", - "@rules_rust//rust/platform:aarch64-linux-android", - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@rules_rust//rust/platform:i686-apple-darwin", - "@rules_rust//rust/platform:i686-linux-android", - "@rules_rust//rust/platform:i686-unknown-freebsd", - "@rules_rust//rust/platform:i686-unknown-linux-gnu", - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@rules_rust//rust/platform:x86_64-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-ios", - "@rules_rust//rust/platform:x86_64-linux-android", - "@rules_rust//rust/platform:x86_64-unknown-freebsd", - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", - ): [ - ], - "//conditions:default": [], - }), -) - -# Unsupported target "mod" with type "bench" omitted - -rust_library( - name = "getrandom", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.2.2", - # buildifier: leave-alone - deps = [ - ":getrandom_build_script", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - ] + selects.with_or({ - # cfg(all(target_arch = "wasm32", target_os = "unknown")) - ( - "@rules_rust//rust/platform:wasm32-unknown-unknown", - ): [ - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(target_os = "wasi") - ( - "@rules_rust//rust/platform:wasm32-wasi", - ): [ - "@proxy_wasm_cpp_host__wasi__0_10_2_wasi_snapshot_preview1//:wasi", - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(unix) - ( - "@rules_rust//rust/platform:aarch64-apple-darwin", - "@rules_rust//rust/platform:aarch64-apple-ios", - "@rules_rust//rust/platform:aarch64-linux-android", - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@rules_rust//rust/platform:i686-apple-darwin", - "@rules_rust//rust/platform:i686-linux-android", - "@rules_rust//rust/platform:i686-unknown-freebsd", - "@rules_rust//rust/platform:i686-unknown-linux-gnu", - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@rules_rust//rust/platform:x86_64-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-ios", - "@rules_rust//rust/platform:x86_64-linux-android", - "@rules_rust//rust/platform:x86_64-unknown-freebsd", - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", - ): [ - "@proxy_wasm_cpp_host__libc__0_2_94//: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.gimli-0.23.0.bazel b/bazel/cargo/remote/BUILD.gimli-0.23.0.bazel deleted file mode 100644 index 4ea9764f3..000000000 --- a/bazel/cargo/remote/BUILD.gimli-0.23.0.bazel +++ /dev/null @@ -1,78 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 - -# Unsupported target "dwarf-validate" with type "example" omitted - -# Unsupported target "dwarfdump" with type "example" omitted - -# Unsupported target "simple" with type "example" omitted - -# Unsupported target "simple_line" with type "example" omitted - -rust_library( - name = "gimli", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "endian-reader", - "fallible-iterator", - "indexmap", - "read", - "stable_deref_trait", - "std", - "write", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.23.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__fallible_iterator__0_2_0//:fallible_iterator", - "@proxy_wasm_cpp_host__indexmap__1_6_2//:indexmap", - "@proxy_wasm_cpp_host__stable_deref_trait__1_2_0//:stable_deref_trait", - ], -) - -# Unsupported target "convert_self" with type "test" omitted - -# Unsupported target "parse_self" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.gimli-0.24.0.bazel b/bazel/cargo/remote/BUILD.gimli-0.24.0.bazel deleted file mode 100644 index ce3ad9778..000000000 --- a/bazel/cargo/remote/BUILD.gimli-0.24.0.bazel +++ /dev/null @@ -1,68 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 - -# Unsupported target "dwarf-validate" with type "example" omitted - -# Unsupported target "dwarfdump" with type "example" omitted - -# Unsupported target "simple" with type "example" omitted - -# Unsupported target "simple_line" with type "example" omitted - -rust_library( - name = "gimli", - srcs = glob(["**/*.rs"]), - crate_features = [ - "read", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.24.0", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "convert_self" with type "test" omitted - -# Unsupported target "parse_self" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.glob-0.3.0.bazel b/bazel/cargo/remote/BUILD.glob-0.3.0.bazel deleted file mode 100644 index c0f33f2fd..000000000 --- a/bazel/cargo/remote/BUILD.glob-0.3.0.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "glob", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.0", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "glob-std" 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 deleted file mode 100644 index 587832a72..000000000 --- a/bazel/cargo/remote/BUILD.hashbrown-0.9.1.bazel +++ /dev/null @@ -1,64 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = [ - "raw", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.9.1", - # buildifier: leave-alone - deps = [ - ], -) - -# 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.hermit-abi-0.1.18.bazel b/bazel/cargo/remote/BUILD.hermit-abi-0.1.18.bazel deleted file mode 100644 index abbb8011b..000000000 --- a/bazel/cargo/remote/BUILD.hermit-abi-0.1.18.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "hermit_abi", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.18", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__libc__0_2_94//:libc", - ], -) diff --git a/bazel/cargo/remote/BUILD.hmac-sha512-0.1.9.bazel b/bazel/cargo/remote/BUILD.hmac-sha512-0.1.9.bazel deleted file mode 100644 index cc0ccb2ec..000000000 --- a/bazel/cargo/remote/BUILD.hmac-sha512-0.1.9.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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", # ISC from expression "ISC" -]) - -# Generated Targets - -rust_library( - name = "hmac_sha512", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "sha384", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.9", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.humantime-2.1.0.bazel b/bazel/cargo/remote/BUILD.humantime-2.1.0.bazel deleted file mode 100644 index a4fa1f98b..000000000 --- a/bazel/cargo/remote/BUILD.humantime-2.1.0.bazel +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "datetime_format" with type "bench" omitted - -# Unsupported target "datetime_parse" with type "bench" omitted - -rust_library( - name = "humantime", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "2.1.0", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.indexmap-1.6.2.bazel b/bazel/cargo/remote/BUILD.indexmap-1.6.2.bazel deleted file mode 100644 index 5ea95aa02..000000000 --- a/bazel/cargo/remote/BUILD.indexmap-1.6.2.bazel +++ /dev/null @@ -1,102 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 -# buildifier: disable=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "indexmap_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "serde", - "serde-1", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.6.2", - visibility = ["//visibility:private"], - deps = [ - "@proxy_wasm_cpp_host__autocfg__1_0_1//:autocfg", - ], -) - -# Unsupported target "bench" with type "bench" omitted - -# Unsupported target "faststring" with type "bench" omitted - -rust_library( - name = "indexmap", - srcs = glob(["**/*.rs"]), - crate_features = [ - "serde", - "serde-1", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.6.2", - # buildifier: leave-alone - deps = [ - ":indexmap_build_script", - "@proxy_wasm_cpp_host__hashbrown__0_9_1//:hashbrown", - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - ], -) - -# Unsupported target "equivalent_trait" with type "test" omitted - -# Unsupported target "macros_full_path" with type "test" omitted - -# Unsupported target "quick" with type "test" omitted - -# Unsupported target "tests" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.itertools-0.10.0.bazel b/bazel/cargo/remote/BUILD.itertools-0.10.0.bazel deleted file mode 100644 index c2cf7a364..000000000 --- a/bazel/cargo/remote/BUILD.itertools-0.10.0.bazel +++ /dev/null @@ -1,97 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "bench1" with type "bench" omitted - -# Unsupported target "combinations" with type "bench" omitted - -# Unsupported target "combinations_with_replacement" with type "bench" omitted - -# Unsupported target "fold_specialization" with type "bench" omitted - -# Unsupported target "powerset" with type "bench" omitted - -# Unsupported target "tree_fold1" with type "bench" omitted - -# Unsupported target "tuple_combinations" with type "bench" omitted - -# Unsupported target "tuples" with type "bench" omitted - -# Unsupported target "iris" with type "example" omitted - -rust_library( - name = "itertools", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "use_alloc", - "use_std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.10.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__either__1_6_1//:either", - ], -) - -# Unsupported target "adaptors_no_collect" with type "test" omitted - -# Unsupported target "fold_specialization" with type "test" omitted - -# Unsupported target "macros_hygiene" with type "test" omitted - -# Unsupported target "merge_join" with type "test" omitted - -# Unsupported target "peeking_take_while" with type "test" omitted - -# Unsupported target "quick" with type "test" omitted - -# Unsupported target "specializations" with type "test" omitted - -# Unsupported target "test_core" with type "test" omitted - -# Unsupported target "test_std" with type "test" omitted - -# Unsupported target "tuples" with type "test" omitted - -# Unsupported target "zip" 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 deleted file mode 100644 index b414da825..000000000 --- a/bazel/cargo/remote/BUILD.lazy_static-1.4.0.bazel +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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", - data = [], - 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.94.bazel b/bazel/cargo/remote/BUILD.libc-0.2.94.bazel deleted file mode 100644 index 635a21205..000000000 --- a/bazel/cargo/remote/BUILD.libc-0.2.94.bazel +++ /dev/null @@ -1,89 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@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.94", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "libc", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.2.94", - # 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 deleted file mode 100644 index a0d2abe3f..000000000 --- a/bazel/cargo/remote/BUILD.log-0.4.14.bazel +++ /dev/null @@ -1,92 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@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 = [ - "std", - ], - 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 = [ - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.14", - # buildifier: leave-alone - deps = [ - ":log_build_script", - "@proxy_wasm_cpp_host__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.mach-0.3.2.bazel b/bazel/cargo/remote/BUILD.mach-0.3.2.bazel deleted file mode 100644 index edfabfb74..000000000 --- a/bazel/cargo/remote/BUILD.mach-0.3.2.bazel +++ /dev/null @@ -1,70 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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([ - "restricted", # BSD-2-Clause from expression "BSD-2-Clause" -]) - -# Generated Targets - -# Unsupported target "dump_process_registers" with type "example" omitted - -rust_library( - name = "mach", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - "default", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.2", - # buildifier: leave-alone - deps = [ - ] + selects.with_or({ - # cfg(any(target_os = "macos", target_os = "ios")) - ( - "@rules_rust//rust/platform:aarch64-apple-darwin", - "@rules_rust//rust/platform:aarch64-apple-ios", - "@rules_rust//rust/platform:i686-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-ios", - ): [ - "@proxy_wasm_cpp_host__libc__0_2_94//:libc", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.memchr-2.4.0.bazel b/bazel/cargo/remote/BUILD.memchr-2.4.0.bazel deleted file mode 100644 index 38cd7713c..000000000 --- a/bazel/cargo/remote/BUILD.memchr-2.4.0.bazel +++ /dev/null @@ -1,87 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 -# buildifier: disable=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "memchr_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - "std", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "2.4.0", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "memchr", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "2.4.0", - # buildifier: leave-alone - deps = [ - ":memchr_build_script", - ], -) diff --git a/bazel/cargo/remote/BUILD.memoffset-0.6.3.bazel b/bazel/cargo/remote/BUILD.memoffset-0.6.3.bazel deleted file mode 100644 index af0d61a43..000000000 --- a/bazel/cargo/remote/BUILD.memoffset-0.6.3.bazel +++ /dev/null @@ -1,86 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 -# buildifier: disable=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "memoffset_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.6.3", - visibility = ["//visibility:private"], - deps = [ - "@proxy_wasm_cpp_host__autocfg__1_0_1//:autocfg", - ], -) - -rust_library( - name = "memoffset", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.6.3", - # buildifier: leave-alone - deps = [ - ":memoffset_build_script", - ], -) diff --git a/bazel/cargo/remote/BUILD.miniz_oxide-0.4.4.bazel b/bazel/cargo/remote/BUILD.miniz_oxide-0.4.4.bazel deleted file mode 100644 index 414ae0899..000000000 --- a/bazel/cargo/remote/BUILD.miniz_oxide-0.4.4.bazel +++ /dev/null @@ -1,85 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 (Zlib OR Apache-2.0)" -]) - -# Generated Targets -# buildifier: disable=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "miniz_oxide_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.4", - visibility = ["//visibility:private"], - deps = [ - "@proxy_wasm_cpp_host__autocfg__1_0_1//:autocfg", - ], -) - -rust_library( - name = "miniz_oxide", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.4", - # buildifier: leave-alone - deps = [ - ":miniz_oxide_build_script", - "@proxy_wasm_cpp_host__adler__1_0_2//:adler", - ], -) diff --git a/bazel/cargo/remote/BUILD.more-asserts-0.2.1.bazel b/bazel/cargo/remote/BUILD.more-asserts-0.2.1.bazel deleted file mode 100644 index e1ae00f40..000000000 --- a/bazel/cargo/remote/BUILD.more-asserts-0.2.1.bazel +++ /dev/null @@ -1,53 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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", # CC0-1.0 from expression "CC0-1.0" -]) - -# Generated Targets - -rust_library( - name = "more_asserts", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.2.1", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.object-0.23.0.bazel b/bazel/cargo/remote/BUILD.object-0.23.0.bazel deleted file mode 100644 index 6b3f8ad99..000000000 --- a/bazel/cargo/remote/BUILD.object-0.23.0.bazel +++ /dev/null @@ -1,80 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "ar" with type "example" omitted - -# Unsupported target "nm" with type "example" omitted - -# Unsupported target "objcopy" with type "example" omitted - -# Unsupported target "objdump" with type "example" omitted - -# Unsupported target "objectmap" with type "example" omitted - -# Unsupported target "readobj" with type "example" omitted - -rust_library( - name = "object", - srcs = glob(["**/*.rs"]), - crate_features = [ - "coff", - "crc32fast", - "elf", - "indexmap", - "macho", - "read_core", - "std", - "write", - "write_core", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.23.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__crc32fast__1_2_1//:crc32fast", - "@proxy_wasm_cpp_host__indexmap__1_6_2//:indexmap", - ], -) - -# Unsupported target "integration" with type "test" omitted - -# Unsupported target "parse_self" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.object-0.24.0.bazel b/bazel/cargo/remote/BUILD.object-0.24.0.bazel deleted file mode 100644 index e78332fe1..000000000 --- a/bazel/cargo/remote/BUILD.object-0.24.0.bazel +++ /dev/null @@ -1,76 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "ar" with type "example" omitted - -# Unsupported target "nm" with type "example" omitted - -# Unsupported target "objcopy" with type "example" omitted - -# Unsupported target "objdump" with type "example" omitted - -# Unsupported target "objectmap" with type "example" omitted - -# Unsupported target "readobj" with type "example" omitted - -rust_library( - name = "object", - srcs = glob(["**/*.rs"]), - crate_features = [ - "archive", - "coff", - "elf", - "macho", - "pe", - "read_core", - "unaligned", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.24.0", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "integration" with type "test" omitted - -# Unsupported target "parse_self" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.once_cell-1.7.2.bazel b/bazel/cargo/remote/BUILD.once_cell-1.7.2.bazel deleted file mode 100644 index f62082a78..000000000 --- a/bazel/cargo/remote/BUILD.once_cell-1.7.2.bazel +++ /dev/null @@ -1,73 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "example" omitted - -# Unsupported target "bench_acquire" with type "example" omitted - -# Unsupported target "bench_vs_lazy_static" with type "example" omitted - -# Unsupported target "lazy_static" with type "example" omitted - -# Unsupported target "reentrant_init_deadlocks" with type "example" omitted - -# Unsupported target "regex" with type "example" omitted - -# Unsupported target "test_synchronization" with type "example" omitted - -rust_library( - name = "once_cell", - srcs = glob(["**/*.rs"]), - crate_features = [ - "alloc", - "default", - "race", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.7.2", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "it" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.parity-wasm-0.42.2.bazel b/bazel/cargo/remote/BUILD.parity-wasm-0.42.2.bazel deleted file mode 100644 index cdce833cf..000000000 --- a/bazel/cargo/remote/BUILD.parity-wasm-0.42.2.bazel +++ /dev/null @@ -1,71 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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-decoder" with type "example" omitted - -# Unsupported target "build" with type "example" omitted - -# Unsupported target "data" with type "example" omitted - -# Unsupported target "exports" with type "example" omitted - -# Unsupported target "info" with type "example" omitted - -# Unsupported target "inject" with type "example" omitted - -# Unsupported target "roundtrip" with type "example" omitted - -# Unsupported target "show" with type "example" omitted - -rust_library( - name = "parity_wasm", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.42.2", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.paste-1.0.5.bazel b/bazel/cargo/remote/BUILD.paste-1.0.5.bazel deleted file mode 100644 index cd68ac546..000000000 --- a/bazel/cargo/remote/BUILD.paste-1.0.5.bazel +++ /dev/null @@ -1,63 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "paste", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "proc-macro", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.5", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "compiletest" with type "test" omitted - -# Unsupported target "test_attr" with type "test" omitted - -# Unsupported target "test_doc" with type "test" omitted - -# Unsupported target "test_expr" with type "test" omitted - -# Unsupported target "test_item" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.ppv-lite86-0.2.10.bazel b/bazel/cargo/remote/BUILD.ppv-lite86-0.2.10.bazel deleted file mode 100644 index fb8fa0944..000000000 --- a/bazel/cargo/remote/BUILD.ppv-lite86-0.2.10.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "ppv_lite86", - srcs = glob(["**/*.rs"]), - crate_features = [ - "simd", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.2.10", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.proc-macro2-1.0.26.bazel b/bazel/cargo/remote/BUILD.proc-macro2-1.0.26.bazel deleted file mode 100644 index 052ad77e4..000000000 --- a/bazel/cargo/remote/BUILD.proc-macro2-1.0.26.bazel +++ /dev/null @@ -1,98 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "proc_macro2_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - "proc-macro", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.26", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "proc_macro2", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "proc-macro", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.26", - # buildifier: leave-alone - deps = [ - ":proc_macro2_build_script", - "@proxy_wasm_cpp_host__unicode_xid__0_2_2//: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.psm-0.1.12.bazel b/bazel/cargo/remote/BUILD.psm-0.1.12.bazel deleted file mode 100644 index f335e7f55..000000000 --- a/bazel/cargo/remote/BUILD.psm-0.1.12.bazel +++ /dev/null @@ -1,100 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "psm_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.1.12", - visibility = ["//visibility:private"], - deps = [ - "@proxy_wasm_cpp_host__cc__1_0_67//:cc", - ], -) - -# Unsupported target "info" with type "example" omitted - -# Unsupported target "on_stack_fibo" with type "example" omitted - -# Unsupported target "on_stack_fibo_alloc_each_frame" with type "example" omitted - -# Unsupported target "panics" with type "example" omitted - -# Unsupported target "replace_stack_1" with type "example" omitted - -# Unsupported target "thread" with type "example" omitted - -rust_library( - name = "psm", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.12", - # buildifier: leave-alone - deps = [ - ":psm_build_script", - ], -) - -# Unsupported target "stack_direction" with type "test" omitted - -# Unsupported target "stack_direction_2" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.quote-1.0.9.bazel b/bazel/cargo/remote/BUILD.quote-1.0.9.bazel deleted file mode 100644 index 38403bbb9..000000000 --- a/bazel/cargo/remote/BUILD.quote-1.0.9.bazel +++ /dev/null @@ -1,60 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = [ - "default", - "proc-macro", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.9", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__proc_macro2__1_0_26//:proc_macro2", - ], -) - -# Unsupported target "compiletest" with type "test" omitted - -# Unsupported target "test" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.rand-0.8.3.bazel b/bazel/cargo/remote/BUILD.rand-0.8.3.bazel deleted file mode 100644 index c3a7c4037..000000000 --- a/bazel/cargo/remote/BUILD.rand-0.8.3.bazel +++ /dev/null @@ -1,88 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "rand", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - "alloc", - "default", - "getrandom", - "libc", - "rand_chacha", - "rand_hc", - "std", - "std_rng", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.8.3", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__rand_chacha__0_3_0//:rand_chacha", - "@proxy_wasm_cpp_host__rand_core__0_6_2//:rand_core", - ] + selects.with_or({ - # cfg(unix) - ( - "@rules_rust//rust/platform:aarch64-apple-darwin", - "@rules_rust//rust/platform:aarch64-apple-ios", - "@rules_rust//rust/platform:aarch64-linux-android", - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@rules_rust//rust/platform:i686-apple-darwin", - "@rules_rust//rust/platform:i686-linux-android", - "@rules_rust//rust/platform:i686-unknown-freebsd", - "@rules_rust//rust/platform:i686-unknown-linux-gnu", - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@rules_rust//rust/platform:x86_64-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-ios", - "@rules_rust//rust/platform:x86_64-linux-android", - "@rules_rust//rust/platform:x86_64-unknown-freebsd", - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", - ): [ - "@proxy_wasm_cpp_host__libc__0_2_94//:libc", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.rand_chacha-0.3.0.bazel b/bazel/cargo/remote/BUILD.rand_chacha-0.3.0.bazel deleted file mode 100644 index 7a0691c0d..000000000 --- a/bazel/cargo/remote/BUILD.rand_chacha-0.3.0.bazel +++ /dev/null @@ -1,56 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "rand_chacha", - srcs = glob(["**/*.rs"]), - crate_features = [ - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__ppv_lite86__0_2_10//:ppv_lite86", - "@proxy_wasm_cpp_host__rand_core__0_6_2//:rand_core", - ], -) diff --git a/bazel/cargo/remote/BUILD.rand_core-0.6.2.bazel b/bazel/cargo/remote/BUILD.rand_core-0.6.2.bazel deleted file mode 100644 index 7a5581efc..000000000 --- a/bazel/cargo/remote/BUILD.rand_core-0.6.2.bazel +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "rand_core", - srcs = glob(["**/*.rs"]), - crate_features = [ - "alloc", - "getrandom", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.6.2", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__getrandom__0_2_2//:getrandom", - ], -) diff --git a/bazel/cargo/remote/BUILD.rand_hc-0.3.0.bazel b/bazel/cargo/remote/BUILD.rand_hc-0.3.0.bazel deleted file mode 100644 index 7d243a2e4..000000000 --- a/bazel/cargo/remote/BUILD.rand_hc-0.3.0.bazel +++ /dev/null @@ -1,54 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "rand_hc", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__rand_core__0_6_2//:rand_core", - ], -) diff --git a/bazel/cargo/remote/BUILD.regalloc-0.0.31.bazel b/bazel/cargo/remote/BUILD.regalloc-0.0.31.bazel deleted file mode 100644 index 83eacacec..000000000 --- a/bazel/cargo/remote/BUILD.regalloc-0.0.31.bazel +++ /dev/null @@ -1,60 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "regalloc", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "enable-serde", - "serde", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.0.31", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__log__0_4_14//:log", - "@proxy_wasm_cpp_host__rustc_hash__1_1_0//:rustc_hash", - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - "@proxy_wasm_cpp_host__smallvec__1_6_1//:smallvec", - ], -) diff --git a/bazel/cargo/remote/BUILD.regex-1.5.4.bazel b/bazel/cargo/remote/BUILD.regex-1.5.4.bazel deleted file mode 100644 index ee3a06b22..000000000 --- a/bazel/cargo/remote/BUILD.regex-1.5.4.bazel +++ /dev/null @@ -1,94 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = [ - "aho-corasick", - "memchr", - "perf", - "perf-cache", - "perf-dfa", - "perf-inline", - "perf-literal", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.5.4", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__aho_corasick__0_7_18//:aho_corasick", - "@proxy_wasm_cpp_host__memchr__2_4_0//:memchr", - "@proxy_wasm_cpp_host__regex_syntax__0_6_25//: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-syntax-0.6.25.bazel b/bazel/cargo/remote/BUILD.regex-syntax-0.6.25.bazel deleted file mode 100644 index fbc65b8ad..000000000 --- a/bazel/cargo/remote/BUILD.regex-syntax-0.6.25.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.6.25", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.region-2.2.0.bazel b/bazel/cargo/remote/BUILD.region-2.2.0.bazel deleted file mode 100644 index 3f58da6a1..000000000 --- a/bazel/cargo/remote/BUILD.region-2.2.0.bazel +++ /dev/null @@ -1,78 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "region", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "2.2.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__bitflags__1_2_1//:bitflags", - "@proxy_wasm_cpp_host__libc__0_2_94//:libc", - ] + selects.with_or({ - # cfg(any(target_os = "macos", target_os = "ios")) - ( - "@rules_rust//rust/platform:aarch64-apple-darwin", - "@rules_rust//rust/platform:aarch64-apple-ios", - "@rules_rust//rust/platform:i686-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-ios", - ): [ - "@proxy_wasm_cpp_host__mach__0_3_2//:mach", - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(windows) - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - "@proxy_wasm_cpp_host__winapi__0_3_9//:winapi", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.rustc-demangle-0.1.19.bazel b/bazel/cargo/remote/BUILD.rustc-demangle-0.1.19.bazel deleted file mode 100644 index 0ecc0b005..000000000 --- a/bazel/cargo/remote/BUILD.rustc-demangle-0.1.19.bazel +++ /dev/null @@ -1,53 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "rustc_demangle", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.19", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.rustc-hash-1.1.0.bazel b/bazel/cargo/remote/BUILD.rustc-hash-1.1.0.bazel deleted file mode 100644 index f3571d78f..000000000 --- a/bazel/cargo/remote/BUILD.rustc-hash-1.1.0.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 - -rust_library( - name = "rustc_hash", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.1.0", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.serde-1.0.126.bazel b/bazel/cargo/remote/BUILD.serde-1.0.126.bazel deleted file mode 100644 index 35eb68663..000000000 --- a/bazel/cargo/remote/BUILD.serde-1.0.126.bazel +++ /dev/null @@ -1,94 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "serde_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - "derive", - "serde_derive", - "std", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.126", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "serde", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - "derive", - "serde_derive", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - proc_macro_deps = [ - "@proxy_wasm_cpp_host__serde_derive__1_0_126//:serde_derive", - ], - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.126", - # buildifier: leave-alone - deps = [ - ":serde_build_script", - ], -) diff --git a/bazel/cargo/remote/BUILD.serde_derive-1.0.126.bazel b/bazel/cargo/remote/BUILD.serde_derive-1.0.126.bazel deleted file mode 100644 index 922bccf22..000000000 --- a/bazel/cargo/remote/BUILD.serde_derive-1.0.126.bazel +++ /dev/null @@ -1,88 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "serde_derive_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.126", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "serde_derive", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - ], - crate_root = "src/lib.rs", - crate_type = "proc-macro", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.126", - # buildifier: leave-alone - deps = [ - ":serde_derive_build_script", - "@proxy_wasm_cpp_host__proc_macro2__1_0_26//:proc_macro2", - "@proxy_wasm_cpp_host__quote__1_0_9//:quote", - "@proxy_wasm_cpp_host__syn__1_0_72//:syn", - ], -) diff --git a/bazel/cargo/remote/BUILD.smallvec-1.6.1.bazel b/bazel/cargo/remote/BUILD.smallvec-1.6.1.bazel deleted file mode 100644 index f2c0284e3..000000000 --- a/bazel/cargo/remote/BUILD.smallvec-1.6.1.bazel +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "smallvec", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.6.1", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "macro" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.stable_deref_trait-1.2.0.bazel b/bazel/cargo/remote/BUILD.stable_deref_trait-1.2.0.bazel deleted file mode 100644 index 2c57c0915..000000000 --- a/bazel/cargo/remote/BUILD.stable_deref_trait-1.2.0.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "stable_deref_trait", - srcs = glob(["**/*.rs"]), - crate_features = [ - "alloc", - "std", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.2.0", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.strsim-0.8.0.bazel b/bazel/cargo/remote/BUILD.strsim-0.8.0.bazel deleted file mode 100644 index 131b093fc..000000000 --- a/bazel/cargo/remote/BUILD.strsim-0.8.0.bazel +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "benches" with type "bench" omitted - -rust_library( - name = "strsim", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.8.0", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "lib" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.syn-1.0.72.bazel b/bazel/cargo/remote/BUILD.syn-1.0.72.bazel deleted file mode 100644 index 69ce0a205..000000000 --- a/bazel/cargo/remote/BUILD.syn-1.0.72.bazel +++ /dev/null @@ -1,156 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "syn_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "clone-impls", - "default", - "derive", - "parsing", - "printing", - "proc-macro", - "quote", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.72", - visibility = ["//visibility:private"], - deps = [ - ], -) - -# Unsupported target "file" with type "bench" omitted - -# Unsupported target "rust" with type "bench" omitted - -rust_library( - name = "syn", - srcs = glob(["**/*.rs"]), - crate_features = [ - "clone-impls", - "default", - "derive", - "parsing", - "printing", - "proc-macro", - "quote", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.72", - # buildifier: leave-alone - deps = [ - ":syn_build_script", - "@proxy_wasm_cpp_host__proc_macro2__1_0_26//:proc_macro2", - "@proxy_wasm_cpp_host__quote__1_0_9//:quote", - "@proxy_wasm_cpp_host__unicode_xid__0_2_2//: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.target-lexicon-0.12.0.bazel b/bazel/cargo/remote/BUILD.target-lexicon-0.12.0.bazel deleted file mode 100644 index 62e715ca9..000000000 --- a/bazel/cargo/remote/BUILD.target-lexicon-0.12.0.bazel +++ /dev/null @@ -1,89 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets -# buildifier: disable=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "target_lexicon_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.12.0", - visibility = ["//visibility:private"], - deps = [ - ], -) - -# Unsupported target "host" with type "example" omitted - -# Unsupported target "misc" with type "example" omitted - -rust_library( - name = "target_lexicon", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.12.0", - # buildifier: leave-alone - deps = [ - ":target_lexicon_build_script", - ], -) diff --git a/bazel/cargo/remote/BUILD.termcolor-1.1.2.bazel b/bazel/cargo/remote/BUILD.termcolor-1.1.2.bazel deleted file mode 100644 index 67a791cb1..000000000 --- a/bazel/cargo/remote/BUILD.termcolor-1.1.2.bazel +++ /dev/null @@ -1,64 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "termcolor", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.1.2", - # buildifier: leave-alone - deps = [ - ] + selects.with_or({ - # cfg(windows) - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - "@proxy_wasm_cpp_host__winapi_util__0_1_5//:winapi_util", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.textwrap-0.11.0.bazel b/bazel/cargo/remote/BUILD.textwrap-0.11.0.bazel deleted file mode 100644 index 4fd9aab3c..000000000 --- a/bazel/cargo/remote/BUILD.textwrap-0.11.0.bazel +++ /dev/null @@ -1,62 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "linear" with type "bench" omitted - -# Unsupported target "layout" with type "example" omitted - -# Unsupported target "termwidth" with type "example" omitted - -rust_library( - name = "textwrap", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.11.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__unicode_width__0_1_8//:unicode_width", - ], -) - -# Unsupported target "version-numbers" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.thiserror-1.0.24.bazel b/bazel/cargo/remote/BUILD.thiserror-1.0.24.bazel deleted file mode 100644 index 9bc28bc5e..000000000 --- a/bazel/cargo/remote/BUILD.thiserror-1.0.24.bazel +++ /dev/null @@ -1,80 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "thiserror", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - proc_macro_deps = [ - "@proxy_wasm_cpp_host__thiserror_impl__1_0_24//:thiserror_impl", - ], - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.24", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "compiletest" with type "test" omitted - -# Unsupported target "test_backtrace" with type "test" omitted - -# Unsupported target "test_deprecated" with type "test" omitted - -# Unsupported target "test_display" with type "test" omitted - -# Unsupported target "test_error" with type "test" omitted - -# Unsupported target "test_expr" with type "test" omitted - -# Unsupported target "test_from" with type "test" omitted - -# Unsupported target "test_lints" with type "test" omitted - -# Unsupported target "test_option" with type "test" omitted - -# Unsupported target "test_path" with type "test" omitted - -# Unsupported target "test_source" with type "test" omitted - -# Unsupported target "test_transparent" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.thiserror-impl-1.0.24.bazel b/bazel/cargo/remote/BUILD.thiserror-impl-1.0.24.bazel deleted file mode 100644 index ead7dbeb9..000000000 --- a/bazel/cargo/remote/BUILD.thiserror-impl-1.0.24.bazel +++ /dev/null @@ -1,56 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "thiserror_impl", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "proc-macro", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.24", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__proc_macro2__1_0_26//:proc_macro2", - "@proxy_wasm_cpp_host__quote__1_0_9//:quote", - "@proxy_wasm_cpp_host__syn__1_0_72//:syn", - ], -) diff --git a/bazel/cargo/remote/BUILD.unicode-width-0.1.8.bazel b/bazel/cargo/remote/BUILD.unicode-width-0.1.8.bazel deleted file mode 100644 index 7cc937987..000000000 --- a/bazel/cargo/remote/BUILD.unicode-width-0.1.8.bazel +++ /dev/null @@ -1,54 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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_width", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.8", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.unicode-xid-0.2.2.bazel b/bazel/cargo/remote/BUILD.unicode-xid-0.2.2.bazel deleted file mode 100644 index fa0c6424a..000000000 --- a/bazel/cargo/remote/BUILD.unicode-xid-0.2.2.bazel +++ /dev/null @@ -1,58 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 "xid" with type "bench" omitted - -rust_library( - name = "unicode_xid", - srcs = glob(["**/*.rs"]), - crate_features = [ - "default", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.2.2", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "exhaustive_tests" with type "test" omitted diff --git a/bazel/cargo/remote/BUILD.vec_map-0.8.2.bazel b/bazel/cargo/remote/BUILD.vec_map-0.8.2.bazel deleted file mode 100644 index 2a6a47295..000000000 --- a/bazel/cargo/remote/BUILD.vec_map-0.8.2.bazel +++ /dev/null @@ -1,53 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "vec_map", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.8.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 deleted file mode 100644 index d65930a5c..000000000 --- a/bazel/cargo/remote/BUILD.wasi-0.10.2+wasi-snapshot-preview1.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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", - data = [], - 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.wasmparser-0.77.0.bazel b/bazel/cargo/remote/BUILD.wasmparser-0.77.0.bazel deleted file mode 100644 index e7d229e1f..000000000 --- a/bazel/cargo/remote/BUILD.wasmparser-0.77.0.bazel +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -# Unsupported target "benchmark" with type "bench" omitted - -# Unsupported target "simple" with type "example" omitted - -rust_library( - name = "wasmparser", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.77.0", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/cargo/remote/BUILD.wasmsign-0.1.2.bazel b/bazel/cargo/remote/BUILD.wasmsign-0.1.2.bazel deleted file mode 100644 index 7d2a94dcb..000000000 --- a/bazel/cargo/remote/BUILD.wasmsign-0.1.2.bazel +++ /dev/null @@ -1,91 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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([ - "restricted", # no license -]) - -# Generated Targets - -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_wasmsign", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/bin/wasmsign.rs", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.2", - # buildifier: leave-alone - deps = [ - ":wasmsign", - "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - "@proxy_wasm_cpp_host__byteorder__1_4_3//:byteorder", - "@proxy_wasm_cpp_host__clap__2_33_3//:clap", - "@proxy_wasm_cpp_host__ed25519_compact__0_1_9//:ed25519_compact", - "@proxy_wasm_cpp_host__hmac_sha512__0_1_9//:hmac_sha512", - "@proxy_wasm_cpp_host__parity_wasm__0_42_2//:parity_wasm", - "@proxy_wasm_cpp_host__thiserror__1_0_24//:thiserror", - ], -) - -rust_library( - name = "wasmsign", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.2", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - "@proxy_wasm_cpp_host__byteorder__1_4_3//:byteorder", - "@proxy_wasm_cpp_host__clap__2_33_3//:clap", - "@proxy_wasm_cpp_host__ed25519_compact__0_1_9//:ed25519_compact", - "@proxy_wasm_cpp_host__hmac_sha512__0_1_9//:hmac_sha512", - "@proxy_wasm_cpp_host__parity_wasm__0_42_2//:parity_wasm", - "@proxy_wasm_cpp_host__thiserror__1_0_24//:thiserror", - ], -) diff --git a/bazel/cargo/remote/BUILD.wasmtime-0.26.0.bazel b/bazel/cargo/remote/BUILD.wasmtime-0.26.0.bazel deleted file mode 100644 index 0ec4ce0e9..000000000 --- a/bazel/cargo/remote/BUILD.wasmtime-0.26.0.bazel +++ /dev/null @@ -1,87 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "wasmtime", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - proc_macro_deps = [ - "@proxy_wasm_cpp_host__paste__1_0_5//:paste", - ], - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.26.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - "@proxy_wasm_cpp_host__backtrace__0_3_59//:backtrace", - "@proxy_wasm_cpp_host__bincode__1_3_3//:bincode", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - "@proxy_wasm_cpp_host__cpp_demangle__0_3_2//:cpp_demangle", - "@proxy_wasm_cpp_host__indexmap__1_6_2//:indexmap", - "@proxy_wasm_cpp_host__lazy_static__1_4_0//:lazy_static", - "@proxy_wasm_cpp_host__libc__0_2_94//:libc", - "@proxy_wasm_cpp_host__log__0_4_14//:log", - "@proxy_wasm_cpp_host__psm__0_1_12//:psm", - "@proxy_wasm_cpp_host__region__2_2_0//:region", - "@proxy_wasm_cpp_host__rustc_demangle__0_1_19//:rustc_demangle", - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - "@proxy_wasm_cpp_host__smallvec__1_6_1//:smallvec", - "@proxy_wasm_cpp_host__target_lexicon__0_12_0//:target_lexicon", - "@proxy_wasm_cpp_host__wasmparser__0_77_0//:wasmparser", - "@proxy_wasm_cpp_host__wasmtime_environ__0_26_0//:wasmtime_environ", - "@proxy_wasm_cpp_host__wasmtime_jit__0_26_0//:wasmtime_jit", - "@proxy_wasm_cpp_host__wasmtime_profiling__0_26_0//:wasmtime_profiling", - "@proxy_wasm_cpp_host__wasmtime_runtime__0_26_0//:wasmtime_runtime", - ] + selects.with_or({ - # cfg(target_os = "windows") - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - "@proxy_wasm_cpp_host__winapi__0_3_9//:winapi", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.wasmtime-c-api-macros-0.19.0.bazel b/bazel/cargo/remote/BUILD.wasmtime-c-api-macros-0.19.0.bazel deleted file mode 100644 index 108838ec8..000000000 --- a/bazel/cargo/remote/BUILD.wasmtime-c-api-macros-0.19.0.bazel +++ /dev/null @@ -1,55 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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([ - "restricted", # no license -]) - -# Generated Targets - -rust_library( - name = "wasmtime_c_api_macros", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "crates/c-api/macros/src/lib.rs", - crate_type = "proc-macro", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.19.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__proc_macro2__1_0_26//:proc_macro2", - "@proxy_wasm_cpp_host__quote__1_0_9//:quote", - ], -) diff --git a/bazel/cargo/remote/BUILD.wasmtime-cranelift-0.26.0.bazel b/bazel/cargo/remote/BUILD.wasmtime-cranelift-0.26.0.bazel deleted file mode 100644 index 81e4995a2..000000000 --- a/bazel/cargo/remote/BUILD.wasmtime-cranelift-0.26.0.bazel +++ /dev/null @@ -1,59 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "wasmtime_cranelift", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.26.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__cranelift_codegen__0_73_0//:cranelift_codegen", - "@proxy_wasm_cpp_host__cranelift_entity__0_73_0//:cranelift_entity", - "@proxy_wasm_cpp_host__cranelift_frontend__0_73_0//:cranelift_frontend", - "@proxy_wasm_cpp_host__cranelift_wasm__0_73_0//:cranelift_wasm", - "@proxy_wasm_cpp_host__wasmparser__0_77_0//:wasmparser", - "@proxy_wasm_cpp_host__wasmtime_environ__0_26_0//:wasmtime_environ", - ], -) diff --git a/bazel/cargo/remote/BUILD.wasmtime-debug-0.26.0.bazel b/bazel/cargo/remote/BUILD.wasmtime-debug-0.26.0.bazel deleted file mode 100644 index 8d1516e33..000000000 --- a/bazel/cargo/remote/BUILD.wasmtime-debug-0.26.0.bazel +++ /dev/null @@ -1,61 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "wasmtime_debug", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.26.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - "@proxy_wasm_cpp_host__gimli__0_23_0//:gimli", - "@proxy_wasm_cpp_host__more_asserts__0_2_1//:more_asserts", - "@proxy_wasm_cpp_host__object__0_23_0//:object", - "@proxy_wasm_cpp_host__target_lexicon__0_12_0//:target_lexicon", - "@proxy_wasm_cpp_host__thiserror__1_0_24//:thiserror", - "@proxy_wasm_cpp_host__wasmparser__0_77_0//:wasmparser", - "@proxy_wasm_cpp_host__wasmtime_environ__0_26_0//:wasmtime_environ", - ], -) diff --git a/bazel/cargo/remote/BUILD.wasmtime-environ-0.26.0.bazel b/bazel/cargo/remote/BUILD.wasmtime-environ-0.26.0.bazel deleted file mode 100644 index 1967c275d..000000000 --- a/bazel/cargo/remote/BUILD.wasmtime-environ-0.26.0.bazel +++ /dev/null @@ -1,66 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "wasmtime_environ", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.26.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - "@proxy_wasm_cpp_host__cranelift_codegen__0_73_0//:cranelift_codegen", - "@proxy_wasm_cpp_host__cranelift_entity__0_73_0//:cranelift_entity", - "@proxy_wasm_cpp_host__cranelift_wasm__0_73_0//:cranelift_wasm", - "@proxy_wasm_cpp_host__gimli__0_23_0//:gimli", - "@proxy_wasm_cpp_host__indexmap__1_6_2//:indexmap", - "@proxy_wasm_cpp_host__log__0_4_14//:log", - "@proxy_wasm_cpp_host__more_asserts__0_2_1//:more_asserts", - "@proxy_wasm_cpp_host__region__2_2_0//:region", - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - "@proxy_wasm_cpp_host__thiserror__1_0_24//:thiserror", - "@proxy_wasm_cpp_host__wasmparser__0_77_0//:wasmparser", - ], -) diff --git a/bazel/cargo/remote/BUILD.wasmtime-jit-0.26.0.bazel b/bazel/cargo/remote/BUILD.wasmtime-jit-0.26.0.bazel deleted file mode 100644 index 2a61689b8..000000000 --- a/bazel/cargo/remote/BUILD.wasmtime-jit-0.26.0.bazel +++ /dev/null @@ -1,87 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "wasmtime_jit", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.26.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__addr2line__0_14_1//:addr2line", - "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - "@proxy_wasm_cpp_host__cranelift_codegen__0_73_0//:cranelift_codegen", - "@proxy_wasm_cpp_host__cranelift_entity__0_73_0//:cranelift_entity", - "@proxy_wasm_cpp_host__cranelift_frontend__0_73_0//:cranelift_frontend", - "@proxy_wasm_cpp_host__cranelift_native__0_73_0//:cranelift_native", - "@proxy_wasm_cpp_host__cranelift_wasm__0_73_0//:cranelift_wasm", - "@proxy_wasm_cpp_host__gimli__0_23_0//:gimli", - "@proxy_wasm_cpp_host__log__0_4_14//:log", - "@proxy_wasm_cpp_host__more_asserts__0_2_1//:more_asserts", - "@proxy_wasm_cpp_host__object__0_23_0//:object", - "@proxy_wasm_cpp_host__region__2_2_0//:region", - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - "@proxy_wasm_cpp_host__target_lexicon__0_12_0//:target_lexicon", - "@proxy_wasm_cpp_host__thiserror__1_0_24//:thiserror", - "@proxy_wasm_cpp_host__wasmparser__0_77_0//:wasmparser", - "@proxy_wasm_cpp_host__wasmtime_cranelift__0_26_0//:wasmtime_cranelift", - "@proxy_wasm_cpp_host__wasmtime_debug__0_26_0//:wasmtime_debug", - "@proxy_wasm_cpp_host__wasmtime_environ__0_26_0//:wasmtime_environ", - "@proxy_wasm_cpp_host__wasmtime_obj__0_26_0//:wasmtime_obj", - "@proxy_wasm_cpp_host__wasmtime_profiling__0_26_0//:wasmtime_profiling", - "@proxy_wasm_cpp_host__wasmtime_runtime__0_26_0//:wasmtime_runtime", - ] + selects.with_or({ - # cfg(target_os = "windows") - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - "@proxy_wasm_cpp_host__winapi__0_3_9//:winapi", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.wasmtime-obj-0.26.0.bazel b/bazel/cargo/remote/BUILD.wasmtime-obj-0.26.0.bazel deleted file mode 100644 index 6d1e192b6..000000000 --- a/bazel/cargo/remote/BUILD.wasmtime-obj-0.26.0.bazel +++ /dev/null @@ -1,59 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "wasmtime_obj", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.26.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - "@proxy_wasm_cpp_host__more_asserts__0_2_1//:more_asserts", - "@proxy_wasm_cpp_host__object__0_23_0//:object", - "@proxy_wasm_cpp_host__target_lexicon__0_12_0//:target_lexicon", - "@proxy_wasm_cpp_host__wasmtime_debug__0_26_0//:wasmtime_debug", - "@proxy_wasm_cpp_host__wasmtime_environ__0_26_0//:wasmtime_environ", - ], -) diff --git a/bazel/cargo/remote/BUILD.wasmtime-profiling-0.26.0.bazel b/bazel/cargo/remote/BUILD.wasmtime-profiling-0.26.0.bazel deleted file mode 100644 index d2a8183e6..000000000 --- a/bazel/cargo/remote/BUILD.wasmtime-profiling-0.26.0.bazel +++ /dev/null @@ -1,61 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets - -rust_library( - name = "wasmtime_profiling", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.26.0", - # buildifier: leave-alone - deps = [ - "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - "@proxy_wasm_cpp_host__lazy_static__1_4_0//:lazy_static", - "@proxy_wasm_cpp_host__libc__0_2_94//:libc", - "@proxy_wasm_cpp_host__serde__1_0_126//:serde", - "@proxy_wasm_cpp_host__target_lexicon__0_12_0//:target_lexicon", - "@proxy_wasm_cpp_host__wasmtime_environ__0_26_0//:wasmtime_environ", - "@proxy_wasm_cpp_host__wasmtime_runtime__0_26_0//:wasmtime_runtime", - ], -) diff --git a/bazel/cargo/remote/BUILD.wasmtime-runtime-0.26.0.bazel b/bazel/cargo/remote/BUILD.wasmtime-runtime-0.26.0.bazel deleted file mode 100644 index 8df633e5a..000000000 --- a/bazel/cargo/remote/BUILD.wasmtime-runtime-0.26.0.bazel +++ /dev/null @@ -1,161 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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" -]) - -# Generated Targets -# buildifier: disable=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "wasmtime_runtime_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "default", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.26.0", - visibility = ["//visibility:private"], - deps = [ - "@proxy_wasm_cpp_host__cc__1_0_67//:cc", - ] + selects.with_or({ - # cfg(target_os = "linux") - ( - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@rules_rust//rust/platform:i686-unknown-linux-gnu", - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", - ): [ - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(target_os = "macos") - ( - "@rules_rust//rust/platform:aarch64-apple-darwin", - "@rules_rust//rust/platform:i686-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-darwin", - ): [ - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(target_os = "windows") - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - ], - "//conditions:default": [], - }), -) - -rust_library( - name = "wasmtime_runtime", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - "default", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.26.0", - # buildifier: leave-alone - deps = [ - ":wasmtime_runtime_build_script", - "@proxy_wasm_cpp_host__anyhow__1_0_40//:anyhow", - "@proxy_wasm_cpp_host__backtrace__0_3_59//:backtrace", - "@proxy_wasm_cpp_host__cfg_if__1_0_0//:cfg_if", - "@proxy_wasm_cpp_host__indexmap__1_6_2//:indexmap", - "@proxy_wasm_cpp_host__lazy_static__1_4_0//:lazy_static", - "@proxy_wasm_cpp_host__libc__0_2_94//:libc", - "@proxy_wasm_cpp_host__log__0_4_14//:log", - "@proxy_wasm_cpp_host__memoffset__0_6_3//:memoffset", - "@proxy_wasm_cpp_host__more_asserts__0_2_1//:more_asserts", - "@proxy_wasm_cpp_host__rand__0_8_3//:rand", - "@proxy_wasm_cpp_host__region__2_2_0//:region", - "@proxy_wasm_cpp_host__thiserror__1_0_24//:thiserror", - "@proxy_wasm_cpp_host__wasmtime_environ__0_26_0//:wasmtime_environ", - ] + selects.with_or({ - # cfg(target_os = "linux") - ( - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@rules_rust//rust/platform:i686-unknown-linux-gnu", - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", - ): [ - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(target_os = "macos") - ( - "@rules_rust//rust/platform:aarch64-apple-darwin", - "@rules_rust//rust/platform:i686-apple-darwin", - "@rules_rust//rust/platform:x86_64-apple-darwin", - ): [ - "@proxy_wasm_cpp_host__mach__0_3_2//:mach", - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(target_os = "windows") - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - "@proxy_wasm_cpp_host__winapi__0_3_9//:winapi", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel b/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel deleted file mode 100644 index 4772a1e25..000000000 --- a/bazel/cargo/remote/BUILD.winapi-0.3.9.bazel +++ /dev/null @@ -1,113 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "winapi_build_script", - srcs = glob(["**/*.rs"]), - build_script_env = { - }, - crate_features = [ - "basetsd", - "consoleapi", - "errhandlingapi", - "fileapi", - "impl-default", - "memoryapi", - "minwinbase", - "minwindef", - "processenv", - "std", - "sysinfoapi", - "winbase", - "wincon", - "winerror", - "winnt", - ], - crate_root = "build.rs", - data = glob(["**"]), - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.9", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "winapi", - srcs = glob(["**/*.rs"]), - crate_features = [ - "basetsd", - "consoleapi", - "errhandlingapi", - "fileapi", - "impl-default", - "memoryapi", - "minwinbase", - "minwindef", - "processenv", - "std", - "sysinfoapi", - "winbase", - "wincon", - "winerror", - "winnt", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.9", - # buildifier: leave-alone - deps = [ - ":winapi_build_script", - ], -) 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 deleted file mode 100644 index e501d339a..000000000 --- a/bazel/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel +++ /dev/null @@ -1,83 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "winapi_i686_pc_windows_gnu_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.0", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "winapi_i686_pc_windows_gnu", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.0", - # buildifier: leave-alone - deps = [ - ":winapi_i686_pc_windows_gnu_build_script", - ], -) diff --git a/bazel/cargo/remote/BUILD.winapi-util-0.1.5.bazel b/bazel/cargo/remote/BUILD.winapi-util-0.1.5.bazel deleted file mode 100644 index 9978322dd..000000000 --- a/bazel/cargo/remote/BUILD.winapi-util-0.1.5.bazel +++ /dev/null @@ -1,64 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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 = "winapi_util", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.5", - # buildifier: leave-alone - deps = [ - ] + selects.with_or({ - # cfg(windows) - ( - "@rules_rust//rust/platform:i686-pc-windows-msvc", - "@rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - "@proxy_wasm_cpp_host__winapi__0_3_9//:winapi", - ], - "//conditions:default": [], - }), -) 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 deleted file mode 100644 index 5cf1d6c3a..000000000 --- a/bazel/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel +++ /dev/null @@ -1,83 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -# buildifier: disable=load -load( - "@rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -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=out-of-order-load -# buildifier: disable=load-on-top -load( - "@rules_rust//cargo:cargo_build_script.bzl", - "cargo_build_script", -) - -cargo_build_script( - name = "winapi_x86_64_pc_windows_gnu_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.0", - visibility = ["//visibility:private"], - deps = [ - ], -) - -rust_library( - name = "winapi_x86_64_pc_windows_gnu", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - data = [], - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.0", - # buildifier: leave-alone - deps = [ - ":winapi_x86_64_pc_windows_gnu_build_script", - ], -) diff --git a/bazel/cargo/wasmsign/BUILD.bazel b/bazel/cargo/wasmsign/BUILD.bazel new file mode 100644 index 000000000..ceb559374 --- /dev/null +++ b/bazel/cargo/wasmsign/BUILD.bazel @@ -0,0 +1,36 @@ +# Copyright 2024 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("@rules_rust//crate_universe:defs.bzl", "crates_vendor") + +exports_files( + [ + "Cargo.toml", + "Cargo.Bazel.lock", + ], +) + +# Run this target to regenerate cargo_lockfile and vendor_path/*. +# $ bazelisk run bazel/cargo/wasmsign:crates_vendor -- --repin +crates_vendor( + name = "crates_vendor", + cargo_lockfile = ":Cargo.Bazel.lock", + generate_binaries = True, + generate_target_compatible_with = False, + manifests = [":Cargo.toml"], + mode = "remote", + repository_name = "cu", # shorten generated paths for Windows... + tags = ["manual"], + vendor_path = "remote", +) diff --git a/bazel/cargo/wasmsign/Cargo.Bazel.lock b/bazel/cargo/wasmsign/Cargo.Bazel.lock new file mode 100644 index 000000000..b9a45d0b5 --- /dev/null +++ b/bazel/cargo/wasmsign/Cargo.Bazel.lock @@ -0,0 +1,247 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", +] + +[[package]] +name = "ct-codecs" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df" + +[[package]] +name = "ed25519-compact" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e18997d4604542d0736fae2c5ad6de987f0a50530cbcc14a7ce5a685328a252d" +dependencies = [ + "ct-codecs", + "getrandom", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hmac-sha512" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ce1f4656bae589a3fab938f9f09bf58645b7ed01a2c5f8a3c238e01a4ef78a" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "parity-wasm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "syn" +version = "2.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-width" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasmsign" +version = "0.1.2" +source = "git+https://github.com/jedisct1/wasmsign#6a6ef1c6f99063a5bd4ef9efc2ee41c5ea8f4f96" +dependencies = [ + "anyhow", + "byteorder", + "clap", + "ed25519-compact", + "hmac-sha512", + "parity-wasm", + "thiserror", +] + +[[package]] +name = "wasmsign-bazel" +version = "0.1.2" +dependencies = [ + "wasmsign", +] + +[[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/wasmsign/Cargo.toml b/bazel/cargo/wasmsign/Cargo.toml new file mode 100644 index 000000000..5267cb2d1 --- /dev/null +++ b/bazel/cargo/wasmsign/Cargo.toml @@ -0,0 +1,28 @@ +# Copyright 2025 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. + +[package] +edition = "2018" +name = "wasmsign-bazel" +version = "0.1.2" + +[lib] +path = "fake_lib.rs" + +[dependencies] +wasmsign = {git = "https://github.com/jedisct1/wasmsign", revision = "fa4d5598f778390df09be94232972b5b865a56b8"} + +# Ready to upgrade to wasmsign2: +# Which generates: //bazel/cargo/wasmsign/remote:wasmsign2-cli__wasmsign2 +#wasmsign2-cli = {git = "https://github.com/wasm-signatures/wasmsign2", revision = "07c60eee7f4c655d5a91404f5a9ffd97316d01f1"} diff --git a/bazel/cargo/wasmsign/remote/BUILD.ansi_term-0.12.1.bazel b/bazel/cargo/wasmsign/remote/BUILD.ansi_term-0.12.1.bazel new file mode 100644 index 000000000..c9b94b758 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.ansi_term-0.12.1.bazel @@ -0,0 +1,56 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "ansi_term", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=ansi_term", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.12.1", + deps = select({ + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__winapi-0.3.9//:winapi", # cfg(target_os = "windows") + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__winapi-0.3.9//:winapi", # cfg(target_os = "windows") + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__winapi-0.3.9//:winapi", # cfg(target_os = "windows") + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.anyhow-1.0.86.bazel b/bazel/cargo/wasmsign/remote/BUILD.anyhow-1.0.86.bazel new file mode 100644 index 000000000..6c6cb4127 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.anyhow-1.0.86.bazel @@ -0,0 +1,97 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "anyhow", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=anyhow", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.86", + deps = [ + "@cu__anyhow-1.0.86//:build_script_build", + ], +) + +cargo_build_script( + name = "anyhow_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "default", + "std", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=anyhow", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.86", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":anyhow_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.atty-0.2.14.bazel b/bazel/cargo/wasmsign/remote/BUILD.atty-0.2.14.bazel new file mode 100644 index 000000000..041f36f9e --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.atty-0.2.14.bazel @@ -0,0 +1,128 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "atty", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=atty", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.14", + deps = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__winapi-0.3.9//:winapi", # cfg(windows) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__winapi-0.3.9//:winapi", # cfg(windows) + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__winapi-0.3.9//:winapi", # cfg(windows) + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.bazel b/bazel/cargo/wasmsign/remote/BUILD.bazel new file mode 100644 index 000000000..87eba7241 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.bazel @@ -0,0 +1,45 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +package(default_visibility = ["//visibility:public"]) + +exports_files( + [ + "cargo-bazel.json", + "crates.bzl", + "defs.bzl", + ] + glob( + include = ["*.bazel"], + allow_empty = True, + ), +) + +filegroup( + name = "srcs", + srcs = glob( + include = [ + "*.bazel", + "*.bzl", + ], + allow_empty = True, + ), +) + +# Workspace Member Dependencies +alias( + name = "wasmsign", + actual = "@cu__wasmsign-0.1.2//:wasmsign", + tags = ["manual"], +) + +# Binaries +alias( + name = "wasmsign__wasmsign", + actual = "@cu__wasmsign-0.1.2//:wasmsign__bin", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.bitflags-1.3.2.bazel b/bazel/cargo/wasmsign/remote/BUILD.bitflags-1.3.2.bazel new file mode 100644 index 000000000..653792564 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.bitflags-1.3.2.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "bitflags", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=bitflags", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.3.2", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.byteorder-1.5.0.bazel b/bazel/cargo/wasmsign/remote/BUILD.byteorder-1.5.0.bazel new file mode 100644 index 000000000..fd6870278 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.byteorder-1.5.0.bazel @@ -0,0 +1,48 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "byteorder", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=byteorder", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.5.0", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.cfg-if-1.0.0.bazel b/bazel/cargo/wasmsign/remote/BUILD.cfg-if-1.0.0.bazel new file mode 100644 index 000000000..e7c34e5d4 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.cfg-if-1.0.0.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cfg_if", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cfg-if", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.0", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.clap-2.34.0.bazel b/bazel/cargo/wasmsign/remote/BUILD.clap-2.34.0.bazel new file mode 100644 index 000000000..ed355234f --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.clap-2.34.0.bazel @@ -0,0 +1,156 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "clap", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "ansi_term", + "atty", + "color", + "default", + "strsim", + "suggestions", + "vec_map", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=clap", + "manual", + "noclippy", + "norustfmt", + ], + version = "2.34.0", + deps = [ + "@cu__atty-0.2.14//:atty", + "@cu__bitflags-1.3.2//:bitflags", + "@cu__strsim-0.8.0//:strsim", + "@cu__textwrap-0.11.0//:textwrap", + "@cu__unicode-width-0.1.13//:unicode_width", + "@cu__vec_map-0.8.2//:vec_map", + ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:thumbv7em-none-eabi": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:wasm32-unknown-unknown": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:wasm32-wasi": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "@rules_rust//rust/platform:x86_64-unknown-none": [ + "@cu__ansi_term-0.12.1//:ansi_term", # cfg(not(windows)) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.ct-codecs-1.1.1.bazel b/bazel/cargo/wasmsign/remote/BUILD.ct-codecs-1.1.1.bazel new file mode 100644 index 000000000..a0cbb9f65 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.ct-codecs-1.1.1.bazel @@ -0,0 +1,48 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "ct_codecs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=ct-codecs", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.1.1", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.ed25519-compact-1.0.16.bazel b/bazel/cargo/wasmsign/remote/BUILD.ed25519-compact-1.0.16.bazel new file mode 100644 index 000000000..f0da91e4f --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.ed25519-compact-1.0.16.bazel @@ -0,0 +1,57 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "ed25519_compact", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "ct-codecs", + "default", + "getrandom", + "pem", + "random", + "std", + "x25519", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=ed25519-compact", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.16", + deps = [ + "@cu__ct-codecs-1.1.1//:ct_codecs", + "@cu__getrandom-0.2.15//:getrandom", + ], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.getrandom-0.2.15.bazel b/bazel/cargo/wasmsign/remote/BUILD.getrandom-0.2.15.bazel new file mode 100644 index 000000000..619a612bd --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.getrandom-0.2.15.bazel @@ -0,0 +1,124 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "getrandom", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=getrandom", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.15", + deps = [ + "@cu__cfg-if-1.0.0//:cfg_if", + ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:wasm32-wasi": [ + "@cu__wasi-0.11.0-wasi-snapshot-preview1//:wasi", # cfg(target_os = "wasi") + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.hermit-abi-0.1.19.bazel b/bazel/cargo/wasmsign/remote/BUILD.hermit-abi-0.1.19.bazel new file mode 100644 index 000000000..2be88f2ce --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.hermit-abi-0.1.19.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "hermit_abi", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=hermit-abi", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.19", + deps = [ + "@cu__libc-0.2.155//:libc", + ], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.hmac-sha512-1.1.5.bazel b/bazel/cargo/wasmsign/remote/BUILD.hmac-sha512-1.1.5.bazel new file mode 100644 index 000000000..c6f58d5ae --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.hmac-sha512-1.1.5.bazel @@ -0,0 +1,48 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "hmac_sha512", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "sha384", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=hmac-sha512", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.1.5", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.libc-0.2.155.bazel b/bazel/cargo/wasmsign/remote/BUILD.libc-0.2.155.bazel new file mode 100644 index 000000000..61bb833b9 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.libc-0.2.155.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "libc", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=libc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.155", + deps = [ + "@cu__libc-0.2.155//:build_script_build", + ], +) + +cargo_build_script( + name = "libc_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=libc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.155", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":libc_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.parity-wasm-0.42.2.bazel b/bazel/cargo/wasmsign/remote/BUILD.parity-wasm-0.42.2.bazel new file mode 100644 index 000000000..ad79a67a5 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.parity-wasm-0.42.2.bazel @@ -0,0 +1,48 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "parity_wasm", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=parity-wasm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.42.2", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.proc-macro2-1.0.86.bazel b/bazel/cargo/wasmsign/remote/BUILD.proc-macro2-1.0.86.bazel new file mode 100644 index 000000000..072a238b8 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.proc-macro2-1.0.86.bazel @@ -0,0 +1,98 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "proc_macro2", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "proc-macro", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=proc-macro2", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.86", + deps = [ + "@cu__proc-macro2-1.0.86//:build_script_build", + "@cu__unicode-ident-1.0.12//:unicode_ident", + ], +) + +cargo_build_script( + name = "proc-macro2_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "default", + "proc-macro", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=proc-macro2", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.86", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":proc-macro2_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.quote-1.0.36.bazel b/bazel/cargo/wasmsign/remote/BUILD.quote-1.0.36.bazel new file mode 100644 index 000000000..554f71a78 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.quote-1.0.36.bazel @@ -0,0 +1,51 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "quote", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "proc-macro", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=quote", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.36", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + ], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.strsim-0.8.0.bazel b/bazel/cargo/wasmsign/remote/BUILD.strsim-0.8.0.bazel new file mode 100644 index 000000000..928090c3d --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.strsim-0.8.0.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "strsim", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=strsim", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.8.0", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.syn-2.0.72.bazel b/bazel/cargo/wasmsign/remote/BUILD.syn-2.0.72.bazel new file mode 100644 index 000000000..0ac5ed93c --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.syn-2.0.72.bazel @@ -0,0 +1,57 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "syn", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "clone-impls", + "default", + "derive", + "parsing", + "printing", + "proc-macro", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=syn", + "manual", + "noclippy", + "norustfmt", + ], + version = "2.0.72", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + "@cu__unicode-ident-1.0.12//:unicode_ident", + ], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.textwrap-0.11.0.bazel b/bazel/cargo/wasmsign/remote/BUILD.textwrap-0.11.0.bazel new file mode 100644 index 000000000..49e49e09e --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.textwrap-0.11.0.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "textwrap", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=textwrap", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.11.0", + deps = [ + "@cu__unicode-width-0.1.13//:unicode_width", + ], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.thiserror-1.0.63.bazel b/bazel/cargo/wasmsign/remote/BUILD.thiserror-1.0.63.bazel new file mode 100644 index 000000000..588c5d5c2 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.thiserror-1.0.63.bazel @@ -0,0 +1,92 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "thiserror", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + proc_macro_deps = [ + "@cu__thiserror-impl-1.0.63//:thiserror_impl", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=thiserror", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.63", + deps = [ + "@cu__thiserror-1.0.63//:build_script_build", + ], +) + +cargo_build_script( + name = "thiserror_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=thiserror", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.63", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":thiserror_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.thiserror-impl-1.0.63.bazel b/bazel/cargo/wasmsign/remote/BUILD.thiserror-impl-1.0.63.bazel new file mode 100644 index 000000000..fc2cf7141 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.thiserror-impl-1.0.63.bazel @@ -0,0 +1,49 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package(default_visibility = ["//visibility:public"]) + +rust_proc_macro( + name = "thiserror_impl", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=thiserror-impl", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.63", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + "@cu__syn-2.0.72//:syn", + ], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.unicode-ident-1.0.12.bazel b/bazel/cargo/wasmsign/remote/BUILD.unicode-ident-1.0.12.bazel new file mode 100644 index 000000000..caed93c98 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.unicode-ident-1.0.12.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "unicode_ident", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=unicode-ident", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.12", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.unicode-width-0.1.13.bazel b/bazel/cargo/wasmsign/remote/BUILD.unicode-width-0.1.13.bazel new file mode 100644 index 000000000..449da1a99 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.unicode-width-0.1.13.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "unicode_width", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=unicode-width", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.13", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.vec_map-0.8.2.bazel b/bazel/cargo/wasmsign/remote/BUILD.vec_map-0.8.2.bazel new file mode 100644 index 000000000..21fe8eee8 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.vec_map-0.8.2.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "vec_map", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=vec_map", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.8.2", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.wasi-0.11.0+wasi-snapshot-preview1.bazel b/bazel/cargo/wasmsign/remote/BUILD.wasi-0.11.0+wasi-snapshot-preview1.bazel new file mode 100644 index 000000000..b5ff1e516 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.wasi-0.11.0+wasi-snapshot-preview1.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasi", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasi", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.11.0+wasi-snapshot-preview1", +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.wasmsign-0.1.2.bazel b/bazel/cargo/wasmsign/remote/BUILD.wasmsign-0.1.2.bazel new file mode 100644 index 000000000..07b49f69b --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.wasmsign-0.1.2.bazel @@ -0,0 +1,100 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load( + "@rules_rust//rust:defs.bzl", + "rust_binary", + "rust_library", +) + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmsign", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmsign", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.2", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__byteorder-1.5.0//:byteorder", + "@cu__clap-2.34.0//:clap", + "@cu__ed25519-compact-1.0.16//:ed25519_compact", + "@cu__hmac-sha512-1.1.5//:hmac_sha512", + "@cu__parity-wasm-0.42.2//:parity_wasm", + "@cu__thiserror-1.0.63//:thiserror", + ], +) + +rust_binary( + name = "wasmsign__bin", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/bin/wasmsign.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmsign", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.2", + deps = [ + ":wasmsign", + "@cu__anyhow-1.0.86//:anyhow", + "@cu__byteorder-1.5.0//:byteorder", + "@cu__clap-2.34.0//:clap", + "@cu__ed25519-compact-1.0.16//:ed25519_compact", + "@cu__hmac-sha512-1.1.5//:hmac_sha512", + "@cu__parity-wasm-0.42.2//:parity_wasm", + "@cu__thiserror-1.0.63//:thiserror", + ], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.winapi-0.3.9.bazel b/bazel/cargo/wasmsign/remote/BUILD.winapi-0.3.9.bazel new file mode 100644 index 000000000..02f57bf83 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.winapi-0.3.9.bazel @@ -0,0 +1,103 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "winapi", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "consoleapi", + "minwinbase", + "minwindef", + "processenv", + "winbase", + ], + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=winapi", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.3.9", + deps = [ + "@cu__winapi-0.3.9//:build_script_build", + ], +) + +cargo_build_script( + name = "winapi_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "consoleapi", + "minwinbase", + "minwindef", + "processenv", + "winbase", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=winapi", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.3.9", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":winapi_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel b/bazel/cargo/wasmsign/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel new file mode 100644 index 000000000..c1fb3c90b --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "winapi_i686_pc_windows_gnu", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=winapi-i686-pc-windows-gnu", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.0", + deps = [ + "@cu__winapi-i686-pc-windows-gnu-0.4.0//:build_script_build", + ], +) + +cargo_build_script( + name = "winapi-i686-pc-windows-gnu_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=winapi-i686-pc-windows-gnu", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.0", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":winapi-i686-pc-windows-gnu_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmsign/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel b/bazel/cargo/wasmsign/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel new file mode 100644 index 000000000..3468dd114 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "winapi_x86_64_pc_windows_gnu", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=winapi-x86_64-pc-windows-gnu", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.0", + deps = [ + "@cu__winapi-x86_64-pc-windows-gnu-0.4.0//:build_script_build", + ], +) + +cargo_build_script( + name = "winapi-x86_64-pc-windows-gnu_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=winapi-x86_64-pc-windows-gnu", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.0", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":winapi-x86_64-pc-windows-gnu_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmsign/remote/alias_rules.bzl b/bazel/cargo/wasmsign/remote/alias_rules.bzl new file mode 100644 index 000000000..14b04c127 --- /dev/null +++ b/bazel/cargo/wasmsign/remote/alias_rules.bzl @@ -0,0 +1,47 @@ +"""Alias that transitions its target to `compilation_mode=opt`. Use `transition_alias="opt"` to enable.""" + +load("@rules_cc//cc:defs.bzl", "CcInfo") +load("@rules_rust//rust:rust_common.bzl", "COMMON_PROVIDERS") + +def _transition_alias_impl(ctx): + # `ctx.attr.actual` is a list of 1 item due to the transition + providers = [ctx.attr.actual[0][provider] for provider in COMMON_PROVIDERS] + if CcInfo in ctx.attr.actual[0]: + providers.append(ctx.attr.actual[0][CcInfo]) + return providers + +def _change_compilation_mode(compilation_mode): + def _change_compilation_mode_impl(_settings, _attr): + return { + "//command_line_option:compilation_mode": compilation_mode, + } + + return transition( + implementation = _change_compilation_mode_impl, + inputs = [], + outputs = [ + "//command_line_option:compilation_mode", + ], + ) + +def _transition_alias_rule(compilation_mode): + return rule( + implementation = _transition_alias_impl, + provides = COMMON_PROVIDERS, + attrs = { + "actual": attr.label( + mandatory = True, + doc = "`rust_library()` target to transition to `compilation_mode=opt`.", + providers = COMMON_PROVIDERS, + cfg = _change_compilation_mode(compilation_mode), + ), + "_allowlist_function_transition": attr.label( + default = "@bazel_tools//tools/allowlists/function_transition_allowlist", + ), + }, + doc = "Transitions a Rust library crate to the `compilation_mode=opt`.", + ) + +transition_alias_dbg = _transition_alias_rule("dbg") +transition_alias_fastbuild = _transition_alias_rule("fastbuild") +transition_alias_opt = _transition_alias_rule("opt") diff --git a/bazel/cargo/wasmsign/remote/crates.bzl b/bazel/cargo/wasmsign/remote/crates.bzl new file mode 100644 index 000000000..b91fb21aa --- /dev/null +++ b/bazel/cargo/wasmsign/remote/crates.bzl @@ -0,0 +1,32 @@ +############################################################################### +# @generated +# This file is auto-generated by the cargo-bazel tool. +# +# DO NOT MODIFY: Local changes may be replaced in future executions. +############################################################################### +"""Rules for defining repositories for remote `crates_vendor` repositories""" + +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") + +# buildifier: disable=bzl-visibility +load("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:defs.bzl", _crate_repositories = "crate_repositories") + +# buildifier: disable=bzl-visibility +load("@rules_rust//crate_universe/private:crates_vendor.bzl", "crates_vendor_remote_repository") + +def crate_repositories(): + """Generates repositories for vendored crates. + + Returns: + A list of repos visible to the module through the module extension. + """ + maybe( + crates_vendor_remote_repository, + name = "cu", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.bazel"), + defs_module = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:defs.bzl"), + ) + + direct_deps = [struct(repo = "cu", is_dev_dep = False)] + direct_deps.extend(_crate_repositories()) + return direct_deps diff --git a/bazel/cargo/wasmsign/remote/defs.bzl b/bazel/cargo/wasmsign/remote/defs.bzl new file mode 100644 index 000000000..57a80662e --- /dev/null +++ b/bazel/cargo/wasmsign/remote/defs.bzl @@ -0,0 +1,705 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmsign:crates_vendor +############################################################################### +""" +# `crates_repository` API + +- [aliases](#aliases) +- [crate_deps](#crate_deps) +- [all_crate_deps](#all_crate_deps) +- [crate_repositories](#crate_repositories) + +""" + +load("@bazel_skylib//lib:selects.bzl", "selects") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") + +############################################################################### +# MACROS API +############################################################################### + +# An identifier that represent common dependencies (unconditional). +_COMMON_CONDITION = "" + +def _flatten_dependency_maps(all_dependency_maps): + """Flatten a list of dependency maps into one dictionary. + + Dependency maps have the following structure: + + ```python + DEPENDENCIES_MAP = { + # The first key in the map is a Bazel package + # name of the workspace this file is defined in. + "workspace_member_package": { + + # Not all dependencies are supported for all platforms. + # the condition key is the condition required to be true + # on the host platform. + "condition": { + + # An alias to a crate target. # The label of the crate target the + # Aliases are only crate names. # package name refers to. + "package_name": "@full//:label", + } + } + } + ``` + + Args: + all_dependency_maps (list): A list of dicts as described above + + Returns: + dict: A dictionary as described above + """ + dependencies = {} + + for workspace_deps_map in all_dependency_maps: + for pkg_name, conditional_deps_map in workspace_deps_map.items(): + if pkg_name not in dependencies: + non_frozen_map = dict() + for key, values in conditional_deps_map.items(): + non_frozen_map.update({key: dict(values.items())}) + dependencies.setdefault(pkg_name, non_frozen_map) + continue + + for condition, deps_map in conditional_deps_map.items(): + # If the condition has not been recorded, do so and continue + if condition not in dependencies[pkg_name]: + dependencies[pkg_name].setdefault(condition, dict(deps_map.items())) + continue + + # Alert on any miss-matched dependencies + inconsistent_entries = [] + for crate_name, crate_label in deps_map.items(): + existing = dependencies[pkg_name][condition].get(crate_name) + if existing and existing != crate_label: + inconsistent_entries.append((crate_name, existing, crate_label)) + dependencies[pkg_name][condition].update({crate_name: crate_label}) + + return dependencies + +def crate_deps(deps, package_name = None): + """Finds the fully qualified label of the requested crates for the package where this macro is called. + + Args: + deps (list): The desired list of crate targets. + package_name (str, optional): The package name of the set of dependencies to look up. + Defaults to `native.package_name()`. + + Returns: + list: A list of labels to generated rust targets (str) + """ + + if not deps: + return [] + + if package_name == None: + package_name = native.package_name() + + # Join both sets of dependencies + dependencies = _flatten_dependency_maps([ + _NORMAL_DEPENDENCIES, + _NORMAL_DEV_DEPENDENCIES, + _PROC_MACRO_DEPENDENCIES, + _PROC_MACRO_DEV_DEPENDENCIES, + _BUILD_DEPENDENCIES, + _BUILD_PROC_MACRO_DEPENDENCIES, + ]).pop(package_name, {}) + + # Combine all conditional packages so we can easily index over a flat list + # TODO: Perhaps this should actually return select statements and maintain + # the conditionals of the dependencies + flat_deps = {} + for deps_set in dependencies.values(): + for crate_name, crate_label in deps_set.items(): + flat_deps.update({crate_name: crate_label}) + + missing_crates = [] + crate_targets = [] + for crate_target in deps: + if crate_target not in flat_deps: + missing_crates.append(crate_target) + else: + crate_targets.append(flat_deps[crate_target]) + + if missing_crates: + fail("Could not find crates `{}` among dependencies of `{}`. Available dependencies were `{}`".format( + missing_crates, + package_name, + dependencies, + )) + + return crate_targets + +def all_crate_deps( + normal = False, + normal_dev = False, + proc_macro = False, + proc_macro_dev = False, + build = False, + build_proc_macro = False, + package_name = None): + """Finds the fully qualified label of all requested direct crate dependencies \ + for the package where this macro is called. + + If no parameters are set, all normal dependencies are returned. Setting any one flag will + otherwise impact the contents of the returned list. + + Args: + normal (bool, optional): If True, normal dependencies are included in the + output list. + normal_dev (bool, optional): If True, normal dev dependencies will be + included in the output list.. + proc_macro (bool, optional): If True, proc_macro dependencies are included + in the output list. + proc_macro_dev (bool, optional): If True, dev proc_macro dependencies are + included in the output list. + build (bool, optional): If True, build dependencies are included + in the output list. + build_proc_macro (bool, optional): If True, build proc_macro dependencies are + included in the output list. + package_name (str, optional): The package name of the set of dependencies to look up. + Defaults to `native.package_name()` when unset. + + Returns: + list: A list of labels to generated rust targets (str) + """ + + if package_name == None: + package_name = native.package_name() + + # Determine the relevant maps to use + all_dependency_maps = [] + if normal: + all_dependency_maps.append(_NORMAL_DEPENDENCIES) + if normal_dev: + all_dependency_maps.append(_NORMAL_DEV_DEPENDENCIES) + if proc_macro: + all_dependency_maps.append(_PROC_MACRO_DEPENDENCIES) + if proc_macro_dev: + all_dependency_maps.append(_PROC_MACRO_DEV_DEPENDENCIES) + if build: + all_dependency_maps.append(_BUILD_DEPENDENCIES) + if build_proc_macro: + all_dependency_maps.append(_BUILD_PROC_MACRO_DEPENDENCIES) + + # Default to always using normal dependencies + if not all_dependency_maps: + all_dependency_maps.append(_NORMAL_DEPENDENCIES) + + dependencies = _flatten_dependency_maps(all_dependency_maps).pop(package_name, None) + + if not dependencies: + if dependencies == None: + fail("Tried to get all_crate_deps for package " + package_name + " but that package had no Cargo.toml file") + else: + return [] + + crate_deps = list(dependencies.pop(_COMMON_CONDITION, {}).values()) + for condition, deps in dependencies.items(): + crate_deps += selects.with_or({ + tuple(_CONDITIONS[condition]): deps.values(), + "//conditions:default": [], + }) + + return crate_deps + +def aliases( + normal = False, + normal_dev = False, + proc_macro = False, + proc_macro_dev = False, + build = False, + build_proc_macro = False, + package_name = None): + """Produces a map of Crate alias names to their original label + + If no dependency kinds are specified, `normal` and `proc_macro` are used by default. + Setting any one flag will otherwise determine the contents of the returned dict. + + Args: + normal (bool, optional): If True, normal dependencies are included in the + output list. + normal_dev (bool, optional): If True, normal dev dependencies will be + included in the output list.. + proc_macro (bool, optional): If True, proc_macro dependencies are included + in the output list. + proc_macro_dev (bool, optional): If True, dev proc_macro dependencies are + included in the output list. + build (bool, optional): If True, build dependencies are included + in the output list. + build_proc_macro (bool, optional): If True, build proc_macro dependencies are + included in the output list. + package_name (str, optional): The package name of the set of dependencies to look up. + Defaults to `native.package_name()` when unset. + + Returns: + dict: The aliases of all associated packages + """ + if package_name == None: + package_name = native.package_name() + + # Determine the relevant maps to use + all_aliases_maps = [] + if normal: + all_aliases_maps.append(_NORMAL_ALIASES) + if normal_dev: + all_aliases_maps.append(_NORMAL_DEV_ALIASES) + if proc_macro: + all_aliases_maps.append(_PROC_MACRO_ALIASES) + if proc_macro_dev: + all_aliases_maps.append(_PROC_MACRO_DEV_ALIASES) + if build: + all_aliases_maps.append(_BUILD_ALIASES) + if build_proc_macro: + all_aliases_maps.append(_BUILD_PROC_MACRO_ALIASES) + + # Default to always using normal aliases + if not all_aliases_maps: + all_aliases_maps.append(_NORMAL_ALIASES) + all_aliases_maps.append(_PROC_MACRO_ALIASES) + + aliases = _flatten_dependency_maps(all_aliases_maps).pop(package_name, None) + + if not aliases: + return dict() + + common_items = aliases.pop(_COMMON_CONDITION, {}).items() + + # If there are only common items in the dictionary, immediately return them + if not len(aliases.keys()) == 1: + return dict(common_items) + + # Build a single select statement where each conditional has accounted for the + # common set of aliases. + crate_aliases = {"//conditions:default": dict(common_items)} + for condition, deps in aliases.items(): + condition_triples = _CONDITIONS[condition] + for triple in condition_triples: + if triple in crate_aliases: + crate_aliases[triple].update(deps) + else: + crate_aliases.update({triple: dict(deps.items() + common_items)}) + + return select(crate_aliases) + +############################################################################### +# WORKSPACE MEMBER DEPS AND ALIASES +############################################################################### + +_NORMAL_DEPENDENCIES = { + "bazel/cargo/wasmsign": { + _COMMON_CONDITION: { + "wasmsign": Label("@cu__wasmsign-0.1.2//:wasmsign"), + }, + }, +} + +_NORMAL_ALIASES = { + "bazel/cargo/wasmsign": { + _COMMON_CONDITION: { + }, + }, +} + +_NORMAL_DEV_DEPENDENCIES = { + "bazel/cargo/wasmsign": { + }, +} + +_NORMAL_DEV_ALIASES = { + "bazel/cargo/wasmsign": { + }, +} + +_PROC_MACRO_DEPENDENCIES = { + "bazel/cargo/wasmsign": { + }, +} + +_PROC_MACRO_ALIASES = { + "bazel/cargo/wasmsign": { + }, +} + +_PROC_MACRO_DEV_DEPENDENCIES = { + "bazel/cargo/wasmsign": { + }, +} + +_PROC_MACRO_DEV_ALIASES = { + "bazel/cargo/wasmsign": { + }, +} + +_BUILD_DEPENDENCIES = { + "bazel/cargo/wasmsign": { + }, +} + +_BUILD_ALIASES = { + "bazel/cargo/wasmsign": { + }, +} + +_BUILD_PROC_MACRO_DEPENDENCIES = { + "bazel/cargo/wasmsign": { + }, +} + +_BUILD_PROC_MACRO_ALIASES = { + "bazel/cargo/wasmsign": { + }, +} + +_CONDITIONS = { + "aarch64-apple-darwin": ["@rules_rust//rust/platform:aarch64-apple-darwin"], + "aarch64-apple-ios": ["@rules_rust//rust/platform:aarch64-apple-ios"], + "aarch64-apple-ios-sim": ["@rules_rust//rust/platform:aarch64-apple-ios-sim"], + "aarch64-fuchsia": ["@rules_rust//rust/platform:aarch64-fuchsia"], + "aarch64-linux-android": ["@rules_rust//rust/platform:aarch64-linux-android"], + "aarch64-pc-windows-msvc": ["@rules_rust//rust/platform:aarch64-pc-windows-msvc"], + "aarch64-unknown-linux-gnu": ["@rules_rust//rust/platform:aarch64-unknown-linux-gnu"], + "aarch64-unknown-nixos-gnu": ["@rules_rust//rust/platform:aarch64-unknown-nixos-gnu"], + "aarch64-unknown-nto-qnx710": ["@rules_rust//rust/platform:aarch64-unknown-nto-qnx710"], + "arm-unknown-linux-gnueabi": ["@rules_rust//rust/platform:arm-unknown-linux-gnueabi"], + "armv7-linux-androideabi": ["@rules_rust//rust/platform:armv7-linux-androideabi"], + "armv7-unknown-linux-gnueabi": ["@rules_rust//rust/platform:armv7-unknown-linux-gnueabi"], + "cfg(not(windows))": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-apple-ios-sim", "@rules_rust//rust/platform:aarch64-fuchsia", "@rules_rust//rust/platform:aarch64-linux-android", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-linux-androideabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:i686-linux-android", "@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:riscv32imc-unknown-none-elf", "@rules_rust//rust/platform:riscv64gc-unknown-none-elf", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:thumbv7em-none-eabi", "@rules_rust//rust/platform:thumbv8m.main-none-eabi", "@rules_rust//rust/platform:wasm32-unknown-unknown", "@rules_rust//rust/platform:wasm32-wasi", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", "@rules_rust//rust/platform:x86_64-fuchsia", "@rules_rust//rust/platform:x86_64-linux-android", "@rules_rust//rust/platform:x86_64-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu", "@rules_rust//rust/platform:x86_64-unknown-none"], + "cfg(target_os = \"hermit\")": [], + "cfg(target_os = \"wasi\")": ["@rules_rust//rust/platform:wasm32-wasi"], + "cfg(target_os = \"windows\")": ["@rules_rust//rust/platform:aarch64-pc-windows-msvc", "@rules_rust//rust/platform:i686-pc-windows-msvc", "@rules_rust//rust/platform:x86_64-pc-windows-msvc"], + "cfg(unix)": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-apple-ios-sim", "@rules_rust//rust/platform:aarch64-fuchsia", "@rules_rust//rust/platform:aarch64-linux-android", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-linux-androideabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:i686-linux-android", "@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", "@rules_rust//rust/platform:x86_64-fuchsia", "@rules_rust//rust/platform:x86_64-linux-android", "@rules_rust//rust/platform:x86_64-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "cfg(windows)": ["@rules_rust//rust/platform:aarch64-pc-windows-msvc", "@rules_rust//rust/platform:i686-pc-windows-msvc", "@rules_rust//rust/platform:x86_64-pc-windows-msvc"], + "i686-apple-darwin": ["@rules_rust//rust/platform:i686-apple-darwin"], + "i686-linux-android": ["@rules_rust//rust/platform:i686-linux-android"], + "i686-pc-windows-gnu": [], + "i686-pc-windows-msvc": ["@rules_rust//rust/platform:i686-pc-windows-msvc"], + "i686-unknown-freebsd": ["@rules_rust//rust/platform:i686-unknown-freebsd"], + "i686-unknown-linux-gnu": ["@rules_rust//rust/platform:i686-unknown-linux-gnu"], + "powerpc-unknown-linux-gnu": ["@rules_rust//rust/platform:powerpc-unknown-linux-gnu"], + "riscv32imc-unknown-none-elf": ["@rules_rust//rust/platform:riscv32imc-unknown-none-elf"], + "riscv64gc-unknown-none-elf": ["@rules_rust//rust/platform:riscv64gc-unknown-none-elf"], + "s390x-unknown-linux-gnu": ["@rules_rust//rust/platform:s390x-unknown-linux-gnu"], + "thumbv7em-none-eabi": ["@rules_rust//rust/platform:thumbv7em-none-eabi"], + "thumbv8m.main-none-eabi": ["@rules_rust//rust/platform:thumbv8m.main-none-eabi"], + "wasm32-unknown-unknown": ["@rules_rust//rust/platform:wasm32-unknown-unknown"], + "wasm32-wasi": ["@rules_rust//rust/platform:wasm32-wasi"], + "x86_64-apple-darwin": ["@rules_rust//rust/platform:x86_64-apple-darwin"], + "x86_64-apple-ios": ["@rules_rust//rust/platform:x86_64-apple-ios"], + "x86_64-fuchsia": ["@rules_rust//rust/platform:x86_64-fuchsia"], + "x86_64-linux-android": ["@rules_rust//rust/platform:x86_64-linux-android"], + "x86_64-pc-windows-gnu": [], + "x86_64-pc-windows-msvc": ["@rules_rust//rust/platform:x86_64-pc-windows-msvc"], + "x86_64-unknown-freebsd": ["@rules_rust//rust/platform:x86_64-unknown-freebsd"], + "x86_64-unknown-linux-gnu": ["@rules_rust//rust/platform:x86_64-unknown-linux-gnu"], + "x86_64-unknown-nixos-gnu": ["@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "x86_64-unknown-none": ["@rules_rust//rust/platform:x86_64-unknown-none"], +} + +############################################################################### + +def crate_repositories(): + """A macro for defining repositories for all generated crates. + + Returns: + A list of repos visible to the module through the module extension. + """ + maybe( + http_archive, + name = "cu__ansi_term-0.12.1", + sha256 = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2", + type = "tar.gz", + urls = ["https://static.crates.io/crates/ansi_term/0.12.1/download"], + strip_prefix = "ansi_term-0.12.1", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.ansi_term-0.12.1.bazel"), + ) + + maybe( + http_archive, + name = "cu__anyhow-1.0.86", + sha256 = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da", + type = "tar.gz", + urls = ["https://static.crates.io/crates/anyhow/1.0.86/download"], + strip_prefix = "anyhow-1.0.86", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.anyhow-1.0.86.bazel"), + ) + + maybe( + http_archive, + name = "cu__atty-0.2.14", + sha256 = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8", + type = "tar.gz", + urls = ["https://static.crates.io/crates/atty/0.2.14/download"], + strip_prefix = "atty-0.2.14", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.atty-0.2.14.bazel"), + ) + + maybe( + http_archive, + name = "cu__bitflags-1.3.2", + sha256 = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a", + type = "tar.gz", + urls = ["https://static.crates.io/crates/bitflags/1.3.2/download"], + strip_prefix = "bitflags-1.3.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.bitflags-1.3.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__byteorder-1.5.0", + sha256 = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/byteorder/1.5.0/download"], + strip_prefix = "byteorder-1.5.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.byteorder-1.5.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cfg-if-1.0.0", + sha256 = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cfg-if/1.0.0/download"], + strip_prefix = "cfg-if-1.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.cfg-if-1.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__clap-2.34.0", + sha256 = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c", + type = "tar.gz", + urls = ["https://static.crates.io/crates/clap/2.34.0/download"], + strip_prefix = "clap-2.34.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.clap-2.34.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__ct-codecs-1.1.1", + sha256 = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df", + type = "tar.gz", + urls = ["https://static.crates.io/crates/ct-codecs/1.1.1/download"], + strip_prefix = "ct-codecs-1.1.1", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.ct-codecs-1.1.1.bazel"), + ) + + maybe( + http_archive, + name = "cu__ed25519-compact-1.0.16", + sha256 = "e18997d4604542d0736fae2c5ad6de987f0a50530cbcc14a7ce5a685328a252d", + type = "tar.gz", + urls = ["https://static.crates.io/crates/ed25519-compact/1.0.16/download"], + strip_prefix = "ed25519-compact-1.0.16", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.ed25519-compact-1.0.16.bazel"), + ) + + maybe( + http_archive, + name = "cu__getrandom-0.2.15", + sha256 = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7", + type = "tar.gz", + urls = ["https://static.crates.io/crates/getrandom/0.2.15/download"], + strip_prefix = "getrandom-0.2.15", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.getrandom-0.2.15.bazel"), + ) + + maybe( + http_archive, + name = "cu__hermit-abi-0.1.19", + sha256 = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33", + type = "tar.gz", + urls = ["https://static.crates.io/crates/hermit-abi/0.1.19/download"], + strip_prefix = "hermit-abi-0.1.19", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.hermit-abi-0.1.19.bazel"), + ) + + maybe( + http_archive, + name = "cu__hmac-sha512-1.1.5", + sha256 = "e4ce1f4656bae589a3fab938f9f09bf58645b7ed01a2c5f8a3c238e01a4ef78a", + type = "tar.gz", + urls = ["https://static.crates.io/crates/hmac-sha512/1.1.5/download"], + strip_prefix = "hmac-sha512-1.1.5", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.hmac-sha512-1.1.5.bazel"), + ) + + maybe( + http_archive, + name = "cu__libc-0.2.155", + sha256 = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c", + type = "tar.gz", + urls = ["https://static.crates.io/crates/libc/0.2.155/download"], + strip_prefix = "libc-0.2.155", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.libc-0.2.155.bazel"), + ) + + maybe( + http_archive, + name = "cu__parity-wasm-0.42.2", + sha256 = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92", + type = "tar.gz", + urls = ["https://static.crates.io/crates/parity-wasm/0.42.2/download"], + strip_prefix = "parity-wasm-0.42.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.parity-wasm-0.42.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__proc-macro2-1.0.86", + sha256 = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77", + type = "tar.gz", + urls = ["https://static.crates.io/crates/proc-macro2/1.0.86/download"], + strip_prefix = "proc-macro2-1.0.86", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.proc-macro2-1.0.86.bazel"), + ) + + maybe( + http_archive, + name = "cu__quote-1.0.36", + sha256 = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7", + type = "tar.gz", + urls = ["https://static.crates.io/crates/quote/1.0.36/download"], + strip_prefix = "quote-1.0.36", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.quote-1.0.36.bazel"), + ) + + maybe( + http_archive, + name = "cu__strsim-0.8.0", + sha256 = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a", + type = "tar.gz", + urls = ["https://static.crates.io/crates/strsim/0.8.0/download"], + strip_prefix = "strsim-0.8.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.strsim-0.8.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__syn-2.0.72", + sha256 = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af", + type = "tar.gz", + urls = ["https://static.crates.io/crates/syn/2.0.72/download"], + strip_prefix = "syn-2.0.72", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.syn-2.0.72.bazel"), + ) + + maybe( + http_archive, + name = "cu__textwrap-0.11.0", + sha256 = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060", + type = "tar.gz", + urls = ["https://static.crates.io/crates/textwrap/0.11.0/download"], + strip_prefix = "textwrap-0.11.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.textwrap-0.11.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__thiserror-1.0.63", + sha256 = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724", + type = "tar.gz", + urls = ["https://static.crates.io/crates/thiserror/1.0.63/download"], + strip_prefix = "thiserror-1.0.63", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.thiserror-1.0.63.bazel"), + ) + + maybe( + http_archive, + name = "cu__thiserror-impl-1.0.63", + sha256 = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261", + type = "tar.gz", + urls = ["https://static.crates.io/crates/thiserror-impl/1.0.63/download"], + strip_prefix = "thiserror-impl-1.0.63", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.thiserror-impl-1.0.63.bazel"), + ) + + maybe( + http_archive, + name = "cu__unicode-ident-1.0.12", + sha256 = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/unicode-ident/1.0.12/download"], + strip_prefix = "unicode-ident-1.0.12", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.unicode-ident-1.0.12.bazel"), + ) + + maybe( + http_archive, + name = "cu__unicode-width-0.1.13", + sha256 = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d", + type = "tar.gz", + urls = ["https://static.crates.io/crates/unicode-width/0.1.13/download"], + strip_prefix = "unicode-width-0.1.13", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.unicode-width-0.1.13.bazel"), + ) + + maybe( + http_archive, + name = "cu__vec_map-0.8.2", + sha256 = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191", + type = "tar.gz", + urls = ["https://static.crates.io/crates/vec_map/0.8.2/download"], + strip_prefix = "vec_map-0.8.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.vec_map-0.8.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasi-0.11.0-wasi-snapshot-preview1", + sha256 = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasi/0.11.0+wasi-snapshot-preview1/download"], + strip_prefix = "wasi-0.11.0+wasi-snapshot-preview1", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.wasi-0.11.0+wasi-snapshot-preview1.bazel"), + ) + + maybe( + new_git_repository, + name = "cu__wasmsign-0.1.2", + commit = "6a6ef1c6f99063a5bd4ef9efc2ee41c5ea8f4f96", + init_submodules = True, + remote = "https://github.com/jedisct1/wasmsign", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.wasmsign-0.1.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__winapi-0.3.9", + sha256 = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419", + type = "tar.gz", + urls = ["https://static.crates.io/crates/winapi/0.3.9/download"], + strip_prefix = "winapi-0.3.9", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.winapi-0.3.9.bazel"), + ) + + maybe( + http_archive, + name = "cu__winapi-i686-pc-windows-gnu-0.4.0", + sha256 = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6", + type = "tar.gz", + urls = ["https://static.crates.io/crates/winapi-i686-pc-windows-gnu/0.4.0/download"], + strip_prefix = "winapi-i686-pc-windows-gnu-0.4.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__winapi-x86_64-pc-windows-gnu-0.4.0", + sha256 = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f", + type = "tar.gz", + urls = ["https://static.crates.io/crates/winapi-x86_64-pc-windows-gnu/0.4.0/download"], + strip_prefix = "winapi-x86_64-pc-windows-gnu-0.4.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel"), + ) + + return [ + struct(repo = "cu__wasmsign-0.1.2", is_dev_dep = False), + ] diff --git a/bazel/cargo/wasmtime/BUILD.bazel b/bazel/cargo/wasmtime/BUILD.bazel new file mode 100644 index 000000000..969a2a96a --- /dev/null +++ b/bazel/cargo/wasmtime/BUILD.bazel @@ -0,0 +1,35 @@ +# Copyright 2024 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("@rules_rust//crate_universe:defs.bzl", "crates_vendor") + +exports_files( + [ + "Cargo.toml", + "Cargo.Bazel.lock", + ], +) + +# Run this target to regenerate cargo_lockfile and vendor_path/*. +# $ bazelisk run bazel/cargo/wasmtime:crates_vendor -- --repin +crates_vendor( + name = "crates_vendor", + cargo_lockfile = ":Cargo.Bazel.lock", + generate_target_compatible_with = False, + manifests = [":Cargo.toml"], + mode = "remote", + repository_name = "cu", # shorten generated paths for Windows... + tags = ["manual"], + vendor_path = "remote", +) diff --git a/bazel/cargo/wasmtime/Cargo.Bazel.lock b/bazel/cargo/wasmtime/Cargo.Bazel.lock new file mode 100644 index 000000000..93579f697 --- /dev/null +++ b/bazel/cargo/wasmtime/Cargo.Bazel.lock @@ -0,0 +1,1031 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "cc" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + +[[package]] +name = "cranelift-bforest" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b80c3a50b9c4c7e5b5f73c0ed746687774fc9e36ef652b110da8daebf0c6e0e6" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-bitset" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38778758c2ca918b05acb2199134e0c561fb577c50574259b26190b6c2d95ded" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-codegen" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58258667ad10e468bfc13a8d620f50dfcd4bb35d668123e97defa2549b9ad397" +dependencies = [ + "bumpalo", + "cranelift-bforest", + "cranelift-bitset", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli", + "hashbrown 0.14.5", + "log", + "regalloc2", + "rustc-hash", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043f0b702e529dcb07ff92bd7d40e7d5317b5493595172c5eb0983343751ee06" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7763578888ab53eca5ce7da141953f828e82c2bfadcffc106d10d1866094ffbb" + +[[package]] +name = "cranelift-control" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db15f08c05df570f11e8ab33cb1ec449a64b37c8a3498377b77650bef33d8b" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5289cdb399381a27e7bbfa1b42185916007c3d49aeef70b1d01cb4caa8010130" +dependencies = [ + "cranelift-bitset", + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-frontend" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ba8ab24eb9470477e98ddfa3c799a649ac5a0d9a2042868c4c952133c234e8" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b72a3c5c166a70426dcb209bdd0bb71a787c1ea76023dc0974fbabca770e8f9" + +[[package]] +name = "cranelift-native" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a42424c956bbc31fc5c2706073df896156c5420ae8fa2a5d48dbc7b295d71b" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49778df4289933d735b93c30a345513e030cf83101de0036e19b760f8aa09f68" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +dependencies = [ + "fallible-iterator", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "serde", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "indexmap" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +dependencies = [ + "equivalent", + "hashbrown 0.14.5", + "serde", +] + +[[package]] +name = "is-terminal" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix", +] + +[[package]] +name = "object" +version = "0.36.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +dependencies = [ + "crc32fast", + "hashbrown 0.14.5", + "indexmap", + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "postcard" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" +dependencies = [ + "cobs", + "embedded-io", + "serde", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.204" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.204" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.120" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] + +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "syn" +version = "2.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasm-encoder" +version = "0.215.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb56df3e06b8e6b77e37d2969a50ba51281029a9aeb3855e76b7f49b6418847" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasmparser" +version = "0.215.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fbde0881f24199b81cf49b6ff8f9c145ac8eb1b7fc439adb5c099734f7d90e" +dependencies = [ + "ahash", + "bitflags", + "hashbrown 0.14.5", + "indexmap", + "semver", + "serde", +] + +[[package]] +name = "wasmprinter" +version = "0.215.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e9a325d85053408209b3d2ce5eaddd0dd6864d1cff7a007147ba073157defc" +dependencies = [ + "anyhow", + "termcolor", + "wasmparser", +] + +[[package]] +name = "wasmtime" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a5883d64dfc8423c56e3d8df27cffc44db25336aa468e8e0724fddf30a333d7" +dependencies = [ + "anyhow", + "bitflags", + "bumpalo", + "cc", + "cfg-if", + "hashbrown 0.14.5", + "indexmap", + "libc", + "libm", + "log", + "mach2", + "memfd", + "object", + "once_cell", + "paste", + "postcard", + "psm", + "rustix", + "serde", + "serde_derive", + "smallvec", + "sptr", + "target-lexicon", + "wasmparser", + "wasmtime-asm-macros", + "wasmtime-component-macro", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-slab", + "wasmtime-versioned-export-macros", + "windows-sys", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c4dc7e2a379c0dd6be5b55857d14c4b277f43a9c429a9e14403eb61776ae3be" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-c-api-bazel" +version = "24.0.0" +dependencies = [ + "anyhow", + "env_logger", + "log", + "once_cell", + "tracing", + "wasmtime", + "wasmtime-c-api-macros", +] + +[[package]] +name = "wasmtime-c-api-macros" +version = "24.0.0" +source = "git+https://github.com/bytecodealliance/wasmtime?tag=v24.0.0#6fc3d274c7994dad20c816ccc0739bf766b39a11" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "wasmtime-component-macro" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b07773d1c3dab5f014ec61316ee317aa424033e17e70a63abdf7c3a47e58fcf" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser", +] + +[[package]] +name = "wasmtime-component-util" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e38d735320f4e83478369ce649ad8fe87c6b893220902e798547a225fc0c5874" + +[[package]] +name = "wasmtime-cranelift" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e570d831d0785d93d7d8c722b1eb9a34e0d0c1534317666f65892818358a2da9" +dependencies = [ + "anyhow", + "cfg-if", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli", + "log", + "object", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-environ", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-environ" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5fe80dfbd81687431a7d4f25929fae1ae96894786d5c96b14ae41164ee97377" +dependencies = [ + "anyhow", + "cranelift-bitset", + "cranelift-entity", + "gimli", + "indexmap", + "log", + "object", + "postcard", + "serde", + "serde_derive", + "target-lexicon", + "wasm-encoder", + "wasmparser", + "wasmprinter", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15de8429db996f0d17a4163a35eccc3f874cbfb50f29c379951ea1bbb39452e" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "windows-sys", +] + +[[package]] +name = "wasmtime-slab" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f68d38fa6b30c5e1fc7d608263062997306f79e577ebd197ddcd6b0f55d87d1" + +[[package]] +name = "wasmtime-types" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6634e7079d9c5cfc81af8610ed59b488cc5b7f9777a2f4c1667a2565c2e45249" +dependencies = [ + "anyhow", + "cranelift-entity", + "serde", + "serde_derive", + "smallvec", + "wasmparser", +] + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3850e3511d6c7f11a72d571890b0ed5f6204681f7f050b9de2690e7f13123fed" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "wasmtime-wit-bindgen" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb331ac7ed1d5ba49cddcdb6b11973752a857148858bb308777d2fc5584121f" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "wit-parser", +] + +[[package]] +name = "winapi-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-parser" +version = "0.215.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "935a97eaffd57c3b413aa510f8f0b550a4a9fe7d59e79cd8b89a83dcb860321f" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/bazel/cargo/wasmtime/Cargo.toml b/bazel/cargo/wasmtime/Cargo.toml new file mode 100644 index 000000000..b038be7fd --- /dev/null +++ b/bazel/cargo/wasmtime/Cargo.toml @@ -0,0 +1,31 @@ +# Copyright 2025 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. + +[package] +edition = "2021" +name = "wasmtime-c-api-bazel" +version = "24.0.0" +rust-version = "1.78.0" + +[lib] +path = "fake_lib.rs" + +[dependencies] +env_logger = "0.10" +anyhow = "1.0" +once_cell = "1.12" +log = {version = "0.4.8", default-features = false} +tracing = "0.1.26" +wasmtime = {version = "24.0.0", default-features = false, features = ['cranelift', 'runtime', 'gc', 'std']} +wasmtime-c-api-macros = {git = "https://github.com/bytecodealliance/wasmtime", tag = "v24.0.0"} diff --git a/bazel/cargo/wasmtime/remote/BUILD.ahash-0.8.11.bazel b/bazel/cargo/wasmtime/remote/BUILD.ahash-0.8.11.bazel new file mode 100644 index 000000000..3efe4bb2b --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.ahash-0.8.11.bazel @@ -0,0 +1,192 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "ahash", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=ahash", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.8.11", + deps = [ + "@cu__ahash-0.8.11//:build_script_build", + "@cu__cfg-if-1.0.0//:cfg_if", + "@cu__zerocopy-0.7.35//:zerocopy", + ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:wasm32-unknown-unknown": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:wasm32-wasi": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "@rules_rust//rust/platform:x86_64-unknown-none": [ + "@cu__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) + ], + "//conditions:default": [], + }), +) + +cargo_build_script( + name = "ahash_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=ahash", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.8.11", + visibility = ["//visibility:private"], + deps = [ + "@cu__version_check-0.9.5//:version_check", + ], +) + +alias( + name = "build_script_build", + actual = ":ahash_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.aho-corasick-1.1.3.bazel b/bazel/cargo/wasmtime/remote/BUILD.aho-corasick-1.1.3.bazel new file mode 100644 index 000000000..193a2843c --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.aho-corasick-1.1.3.bazel @@ -0,0 +1,51 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "aho_corasick", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "perf-literal", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=aho-corasick", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.1.3", + deps = [ + "@cu__memchr-2.7.4//:memchr", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.anyhow-1.0.86.bazel b/bazel/cargo/wasmtime/remote/BUILD.anyhow-1.0.86.bazel new file mode 100644 index 000000000..3021b737f --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.anyhow-1.0.86.bazel @@ -0,0 +1,97 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "anyhow", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=anyhow", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.86", + deps = [ + "@cu__anyhow-1.0.86//:build_script_build", + ], +) + +cargo_build_script( + name = "anyhow_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "default", + "std", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=anyhow", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.86", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":anyhow_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.arbitrary-1.3.2.bazel b/bazel/cargo/wasmtime/remote/BUILD.arbitrary-1.3.2.bazel new file mode 100644 index 000000000..d36ba3e9a --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.arbitrary-1.3.2.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "arbitrary", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=arbitrary", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.3.2", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.bazel b/bazel/cargo/wasmtime/remote/BUILD.bazel new file mode 100644 index 000000000..db793c6e6 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.bazel @@ -0,0 +1,74 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +package(default_visibility = ["//visibility:public"]) + +exports_files( + [ + "cargo-bazel.json", + "crates.bzl", + "defs.bzl", + ] + glob( + include = ["*.bazel"], + allow_empty = True, + ), +) + +filegroup( + name = "srcs", + srcs = glob( + include = [ + "*.bazel", + "*.bzl", + ], + allow_empty = True, + ), +) + +# Workspace Member Dependencies +alias( + name = "anyhow", + actual = "@cu__anyhow-1.0.86//:anyhow", + tags = ["manual"], +) + +alias( + name = "env_logger", + actual = "@cu__env_logger-0.10.2//:env_logger", + tags = ["manual"], +) + +alias( + name = "log", + actual = "@cu__log-0.4.22//:log", + tags = ["manual"], +) + +alias( + name = "once_cell", + actual = "@cu__once_cell-1.19.0//:once_cell", + tags = ["manual"], +) + +alias( + name = "tracing", + actual = "@cu__tracing-0.1.40//:tracing", + tags = ["manual"], +) + +alias( + name = "wasmtime", + actual = "@cu__wasmtime-24.0.0//:wasmtime", + tags = ["manual"], +) + +alias( + name = "wasmtime-c-api-macros", + actual = "@cu__wasmtime-c-api-macros-24.0.0//:wasmtime_c_api_macros", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.bitflags-2.6.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.bitflags-2.6.0.bazel new file mode 100644 index 000000000..31767882b --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.bitflags-2.6.0.bazel @@ -0,0 +1,119 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "bitflags", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "std", # aarch64-apple-darwin + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "std", # aarch64-apple-ios + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "std", # aarch64-apple-ios-sim + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "std", # aarch64-fuchsia + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "std", # aarch64-linux-android + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "std", # aarch64-unknown-linux-gnu + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "std", # aarch64-unknown-nixos-gnu + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "std", # aarch64-unknown-nto-qnx710 + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "std", # arm-unknown-linux-gnueabi + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "std", # armv7-linux-androideabi + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "std", # armv7-unknown-linux-gnueabi + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "std", # i686-apple-darwin + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "std", # i686-linux-android + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "std", # i686-unknown-freebsd + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "std", # i686-unknown-linux-gnu + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "std", # powerpc-unknown-linux-gnu + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "std", # s390x-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "std", # x86_64-apple-darwin + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "std", # x86_64-apple-ios + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "std", # x86_64-fuchsia + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "std", # x86_64-linux-android + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "std", # x86_64-unknown-freebsd + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "std", # x86_64-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "std", # x86_64-unknown-nixos-gnu + ], + "//conditions:default": [], + }), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=bitflags", + "manual", + "noclippy", + "norustfmt", + ], + version = "2.6.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.bumpalo-3.16.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.bumpalo-3.16.0.bazel new file mode 100644 index 000000000..2dd737714 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.bumpalo-3.16.0.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "bumpalo", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=bumpalo", + "manual", + "noclippy", + "norustfmt", + ], + version = "3.16.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cc-1.1.7.bazel b/bazel/cargo/wasmtime/remote/BUILD.cc-1.1.7.bazel new file mode 100644 index 000000000..14f88e535 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cc-1.1.7.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cc", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cc", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.1.7", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cfg-if-1.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cfg-if-1.0.0.bazel new file mode 100644 index 000000000..f9019274b --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cfg-if-1.0.0.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cfg_if", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cfg-if", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cobs-0.2.3.bazel b/bazel/cargo/wasmtime/remote/BUILD.cobs-0.2.3.bazel new file mode 100644 index 000000000..00da2e823 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cobs-0.2.3.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cobs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cobs", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.3", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-bforest-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-bforest-0.111.0.bazel new file mode 100644 index 000000000..a4651a993 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-bforest-0.111.0.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_bforest", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-bforest", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__cranelift-entity-0.111.0//:cranelift_entity", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-bitset-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-bitset-0.111.0.bazel new file mode 100644 index 000000000..7d70417f0 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-bitset-0.111.0.bazel @@ -0,0 +1,53 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_bitset", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "enable-serde", + ], + crate_root = "src/lib.rs", + edition = "2021", + proc_macro_deps = [ + "@cu__serde_derive-1.0.204//:serde_derive", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-bitset", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__serde-1.0.204//:serde", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-codegen-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-codegen-0.111.0.bazel new file mode 100644 index 000000000..cb569892f --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-codegen-0.111.0.bazel @@ -0,0 +1,120 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_codegen", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "gimli", + "host-arch", + "std", + "trace-log", + "unwind", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-codegen", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__bumpalo-3.16.0//:bumpalo", + "@cu__cranelift-bforest-0.111.0//:cranelift_bforest", + "@cu__cranelift-bitset-0.111.0//:cranelift_bitset", + "@cu__cranelift-codegen-0.111.0//:build_script_build", + "@cu__cranelift-codegen-shared-0.111.0//:cranelift_codegen_shared", + "@cu__cranelift-control-0.111.0//:cranelift_control", + "@cu__cranelift-entity-0.111.0//:cranelift_entity", + "@cu__gimli-0.29.0//:gimli", + "@cu__hashbrown-0.14.5//:hashbrown", + "@cu__log-0.4.22//:log", + "@cu__regalloc2-0.9.3//:regalloc2", + "@cu__rustc-hash-1.1.0//:rustc_hash", + "@cu__smallvec-1.13.2//:smallvec", + "@cu__target-lexicon-0.12.16//:target_lexicon", + ], +) + +cargo_build_script( + name = "cranelift-codegen_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "gimli", + "host-arch", + "std", + "trace-log", + "unwind", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-codegen", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + visibility = ["//visibility:private"], + deps = [ + "@cu__cranelift-codegen-meta-0.111.0//:cranelift_codegen_meta", + "@cu__cranelift-isle-0.111.0//:cranelift_isle", + ], +) + +alias( + name = "build_script_build", + actual = ":cranelift-codegen_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-codegen-meta-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-codegen-meta-0.111.0.bazel new file mode 100644 index 000000000..9ccb599a1 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-codegen-meta-0.111.0.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_codegen_meta", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-codegen-meta", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__cranelift-codegen-shared-0.111.0//:cranelift_codegen_shared", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-codegen-shared-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-codegen-shared-0.111.0.bazel new file mode 100644 index 000000000..8820100ff --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-codegen-shared-0.111.0.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_codegen_shared", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-codegen-shared", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-control-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-control-0.111.0.bazel new file mode 100644 index 000000000..51c64ada2 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-control-0.111.0.bazel @@ -0,0 +1,51 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_control", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "fuzz", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-control", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__arbitrary-1.3.2//:arbitrary", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-entity-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-entity-0.111.0.bazel new file mode 100644 index 000000000..f59f1f47b --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-entity-0.111.0.bazel @@ -0,0 +1,56 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_entity", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "enable-serde", + "serde", + "serde_derive", + ], + crate_root = "src/lib.rs", + edition = "2021", + proc_macro_deps = [ + "@cu__serde_derive-1.0.204//:serde_derive", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-entity", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__cranelift-bitset-0.111.0//:cranelift_bitset", + "@cu__serde-1.0.204//:serde", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-frontend-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-frontend-0.111.0.bazel new file mode 100644 index 000000000..b1ae57324 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-frontend-0.111.0.bazel @@ -0,0 +1,54 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_frontend", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-frontend", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__cranelift-codegen-0.111.0//:cranelift_codegen", + "@cu__log-0.4.22//:log", + "@cu__smallvec-1.13.2//:smallvec", + "@cu__target-lexicon-0.12.16//:target_lexicon", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-isle-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-isle-0.111.0.bazel new file mode 100644 index 000000000..687a5406a --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-isle-0.111.0.bazel @@ -0,0 +1,95 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_isle", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-isle", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__cranelift-isle-0.111.0//:build_script_build", + ], +) + +cargo_build_script( + name = "cranelift-isle_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "default", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-isle", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":cranelift-isle_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-native-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-native-0.111.0.bazel new file mode 100644 index 000000000..c6b0a99f0 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-native-0.111.0.bazel @@ -0,0 +1,60 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_native", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-native", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__cranelift-codegen-0.111.0//:cranelift_codegen", + "@cu__target-lexicon-0.12.16//:target_lexicon", + ] + select({ + "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_arch = "s390x", target_arch = "riscv64")) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_arch = "s390x", target_arch = "riscv64")) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.cranelift-wasm-0.111.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.cranelift-wasm-0.111.0.bazel new file mode 100644 index 000000000..38d4bb412 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.cranelift-wasm-0.111.0.bazel @@ -0,0 +1,58 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cranelift_wasm", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=cranelift-wasm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.111.0", + deps = [ + "@cu__cranelift-codegen-0.111.0//:cranelift_codegen", + "@cu__cranelift-entity-0.111.0//:cranelift_entity", + "@cu__cranelift-frontend-0.111.0//:cranelift_frontend", + "@cu__itertools-0.12.1//:itertools", + "@cu__log-0.4.22//:log", + "@cu__smallvec-1.13.2//:smallvec", + "@cu__wasmparser-0.215.0//:wasmparser", + "@cu__wasmtime-types-24.0.0//:wasmtime_types", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.crc32fast-1.4.2.bazel b/bazel/cargo/wasmtime/remote/BUILD.crc32fast-1.4.2.bazel new file mode 100644 index 000000000..063a0afb7 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.crc32fast-1.4.2.bazel @@ -0,0 +1,50 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "crc32fast", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "std", + ], + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=crc32fast", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.4.2", + deps = [ + "@cu__cfg-if-1.0.0//:cfg_if", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.either-1.13.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.either-1.13.0.bazel new file mode 100644 index 000000000..043006849 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.either-1.13.0.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "either", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "use_std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=either", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.13.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.embedded-io-0.4.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.embedded-io-0.4.0.bazel new file mode 100644 index 000000000..c9ef73301 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.embedded-io-0.4.0.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "embedded_io", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "alloc", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=embedded-io", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.env_logger-0.10.2.bazel b/bazel/cargo/wasmtime/remote/BUILD.env_logger-0.10.2.bazel new file mode 100644 index 000000000..ce9eb6262 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.env_logger-0.10.2.bazel @@ -0,0 +1,58 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "env_logger", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "auto-color", + "color", + "default", + "humantime", + "regex", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=env_logger", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.10.2", + deps = [ + "@cu__humantime-2.1.0//:humantime", + "@cu__is-terminal-0.4.12//:is_terminal", + "@cu__log-0.4.22//:log", + "@cu__regex-1.10.5//:regex", + "@cu__termcolor-1.4.1//:termcolor", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.equivalent-1.0.1.bazel b/bazel/cargo/wasmtime/remote/BUILD.equivalent-1.0.1.bazel new file mode 100644 index 000000000..c3be9a81d --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.equivalent-1.0.1.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "equivalent", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=equivalent", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.1", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.errno-0.3.9.bazel b/bazel/cargo/wasmtime/remote/BUILD.errno-0.3.9.bazel new file mode 100644 index 000000000..904e5aba0 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.errno-0.3.9.bazel @@ -0,0 +1,134 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "errno", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=errno", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.3.9", + deps = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:wasm32-wasi": [ + "@cu__libc-0.2.155//:libc", # cfg(target_os = "wasi") + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(unix) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.fallible-iterator-0.3.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.fallible-iterator-0.3.0.bazel new file mode 100644 index 000000000..b2bdbf6fc --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.fallible-iterator-0.3.0.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "fallible_iterator", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=fallible-iterator", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.3.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.gimli-0.29.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.gimli-0.29.0.bazel new file mode 100644 index 000000000..852f5bdee --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.gimli-0.29.0.bazel @@ -0,0 +1,53 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "gimli", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "read", + "read-core", + "std", + "write", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=gimli", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.29.0", + deps = [ + "@cu__indexmap-2.3.0//:indexmap", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.hashbrown-0.13.2.bazel b/bazel/cargo/wasmtime/remote/BUILD.hashbrown-0.13.2.bazel new file mode 100644 index 000000000..4bcf220d3 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.hashbrown-0.13.2.bazel @@ -0,0 +1,52 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "hashbrown", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "ahash", + "default", + "inline-more", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=hashbrown", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.13.2", + deps = [ + "@cu__ahash-0.8.11//:ahash", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.hashbrown-0.14.5.bazel b/bazel/cargo/wasmtime/remote/BUILD.hashbrown-0.14.5.bazel new file mode 100644 index 000000000..921bfbbea --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.hashbrown-0.14.5.bazel @@ -0,0 +1,53 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "hashbrown", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "ahash", + "raw", + "serde", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=hashbrown", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.14.5", + deps = [ + "@cu__ahash-0.8.11//:ahash", + "@cu__serde-1.0.204//:serde", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.heck-0.4.1.bazel b/bazel/cargo/wasmtime/remote/BUILD.heck-0.4.1.bazel new file mode 100644 index 000000000..5f94cda10 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.heck-0.4.1.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "heck", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=heck", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.1", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.hermit-abi-0.3.9.bazel b/bazel/cargo/wasmtime/remote/BUILD.hermit-abi-0.3.9.bazel new file mode 100644 index 000000000..75dff9155 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.hermit-abi-0.3.9.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "hermit_abi", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=hermit-abi", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.3.9", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.humantime-2.1.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.humantime-2.1.0.bazel new file mode 100644 index 000000000..d1691cafd --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.humantime-2.1.0.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "humantime", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=humantime", + "manual", + "noclippy", + "norustfmt", + ], + version = "2.1.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.id-arena-2.2.1.bazel b/bazel/cargo/wasmtime/remote/BUILD.id-arena-2.2.1.bazel new file mode 100644 index 000000000..1248a97fb --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.id-arena-2.2.1.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "id_arena", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=id-arena", + "manual", + "noclippy", + "norustfmt", + ], + version = "2.2.1", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.indexmap-2.3.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.indexmap-2.3.0.bazel new file mode 100644 index 000000000..07d4be633 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.indexmap-2.3.0.bazel @@ -0,0 +1,54 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "indexmap", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "serde", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=indexmap", + "manual", + "noclippy", + "norustfmt", + ], + version = "2.3.0", + deps = [ + "@cu__equivalent-1.0.1//:equivalent", + "@cu__hashbrown-0.14.5//:hashbrown", + "@cu__serde-1.0.204//:serde", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.is-terminal-0.4.12.bazel b/bazel/cargo/wasmtime/remote/BUILD.is-terminal-0.4.12.bazel new file mode 100644 index 000000000..84a3f0fb0 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.is-terminal-0.4.12.bazel @@ -0,0 +1,131 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "is_terminal", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=is-terminal", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.12", + deps = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:wasm32-wasi": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(unix, target_os = "wasi")) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.itertools-0.12.1.bazel b/bazel/cargo/wasmtime/remote/BUILD.itertools-0.12.1.bazel new file mode 100644 index 000000000..6578e4624 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.itertools-0.12.1.bazel @@ -0,0 +1,52 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "itertools", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "use_alloc", + "use_std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=itertools", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.12.1", + deps = [ + "@cu__either-1.13.0//:either", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.itoa-1.0.11.bazel b/bazel/cargo/wasmtime/remote/BUILD.itoa-1.0.11.bazel new file mode 100644 index 000000000..71c5cae88 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.itoa-1.0.11.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "itoa", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=itoa", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.11", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.leb128-0.2.5.bazel b/bazel/cargo/wasmtime/remote/BUILD.leb128-0.2.5.bazel new file mode 100644 index 000000000..12f06a0c6 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.leb128-0.2.5.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "leb128", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=leb128", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.5", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.libc-0.2.155.bazel b/bazel/cargo/wasmtime/remote/BUILD.libc-0.2.155.bazel new file mode 100644 index 000000000..07f451864 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.libc-0.2.155.bazel @@ -0,0 +1,203 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "libc", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "extra_traits", # aarch64-apple-darwin + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "extra_traits", # aarch64-apple-ios + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "extra_traits", # aarch64-apple-ios-sim + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "extra_traits", # aarch64-fuchsia + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "extra_traits", # aarch64-linux-android + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "extra_traits", # aarch64-unknown-nto-qnx710 + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "extra_traits", # armv7-linux-androideabi + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "extra_traits", # i686-apple-darwin + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "extra_traits", # i686-linux-android + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "extra_traits", # i686-unknown-freebsd + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "extra_traits", # powerpc-unknown-linux-gnu + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "extra_traits", # s390x-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "extra_traits", # x86_64-apple-darwin + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "extra_traits", # x86_64-apple-ios + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "extra_traits", # x86_64-fuchsia + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "extra_traits", # x86_64-linux-android + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "extra_traits", # x86_64-unknown-freebsd + ], + "//conditions:default": [], + }), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=libc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.155", + deps = [ + "@cu__libc-0.2.155//:build_script_build", + ], +) + +cargo_build_script( + name = "libc_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "default", + "std", + ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "extra_traits", # aarch64-apple-darwin + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "extra_traits", # aarch64-apple-ios + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "extra_traits", # aarch64-apple-ios-sim + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "extra_traits", # aarch64-fuchsia + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "extra_traits", # aarch64-linux-android + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "extra_traits", # aarch64-unknown-nto-qnx710 + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "extra_traits", # armv7-linux-androideabi + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "extra_traits", # i686-apple-darwin + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "extra_traits", # i686-linux-android + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "extra_traits", # i686-unknown-freebsd + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "extra_traits", # powerpc-unknown-linux-gnu + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "extra_traits", # s390x-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "extra_traits", # x86_64-apple-darwin + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "extra_traits", # x86_64-apple-ios + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "extra_traits", # x86_64-fuchsia + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "extra_traits", # x86_64-linux-android + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "extra_traits", # x86_64-unknown-freebsd + ], + "//conditions:default": [], + }), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=libc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.155", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":libc_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.libm-0.2.8.bazel b/bazel/cargo/wasmtime/remote/BUILD.libm-0.2.8.bazel new file mode 100644 index 000000000..cf70de29c --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.libm-0.2.8.bazel @@ -0,0 +1,95 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "libm", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=libm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.8", + deps = [ + "@cu__libm-0.2.8//:build_script_build", + ], +) + +cargo_build_script( + name = "libm_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "default", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=libm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.8", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":libm_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.linux-raw-sys-0.4.14.bazel b/bazel/cargo/wasmtime/remote/BUILD.linux-raw-sys-0.4.14.bazel new file mode 100644 index 000000000..733fee359 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.linux-raw-sys-0.4.14.bazel @@ -0,0 +1,79 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "linux_raw_sys", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "general", + "ioctl", + "no_std", + ] + select({ + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "elf", # aarch64-unknown-linux-gnu + "errno", # aarch64-unknown-linux-gnu + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "elf", # aarch64-unknown-nixos-gnu + "errno", # aarch64-unknown-nixos-gnu + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "elf", # arm-unknown-linux-gnueabi + "errno", # arm-unknown-linux-gnueabi + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "elf", # armv7-unknown-linux-gnueabi + "errno", # armv7-unknown-linux-gnueabi + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "elf", # i686-unknown-linux-gnu + "errno", # i686-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "elf", # x86_64-unknown-linux-gnu + "errno", # x86_64-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "elf", # x86_64-unknown-nixos-gnu + "errno", # x86_64-unknown-nixos-gnu + ], + "//conditions:default": [], + }), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=linux-raw-sys", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.14", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.log-0.4.22.bazel b/bazel/cargo/wasmtime/remote/BUILD.log-0.4.22.bazel new file mode 100644 index 000000000..7afd4d234 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.log-0.4.22.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "log", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=log", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.22", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.mach2-0.4.2.bazel b/bazel/cargo/wasmtime/remote/BUILD.mach2-0.4.2.bazel new file mode 100644 index 000000000..6c5f412cc --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.mach2-0.4.2.bazel @@ -0,0 +1,68 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "mach2", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=mach2", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.2", + deps = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "macos", target_os = "ios")) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "macos", target_os = "ios")) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "macos", target_os = "ios")) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "macos", target_os = "ios")) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "macos", target_os = "ios")) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "macos", target_os = "ios")) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.memchr-2.7.4.bazel b/bazel/cargo/wasmtime/remote/BUILD.memchr-2.7.4.bazel new file mode 100644 index 000000000..bee4bd07c --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.memchr-2.7.4.bazel @@ -0,0 +1,48 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "memchr", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "alloc", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=memchr", + "manual", + "noclippy", + "norustfmt", + ], + version = "2.7.4", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.memfd-0.6.4.bazel b/bazel/cargo/wasmtime/remote/BUILD.memfd-0.6.4.bazel new file mode 100644 index 000000000..db840ec0d --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.memfd-0.6.4.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "memfd", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=memfd", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.6.4", + deps = [ + "@cu__rustix-0.38.34//:rustix", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.object-0.36.2.bazel b/bazel/cargo/wasmtime/remote/BUILD.object-0.36.2.bazel new file mode 100644 index 000000000..11133ca1e --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.object-0.36.2.bazel @@ -0,0 +1,62 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "object", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "coff", + "elf", + "macho", + "pe", + "read_core", + "std", + "write", + "write_core", + "write_std", + "xcoff", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=object", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.36.2", + deps = [ + "@cu__crc32fast-1.4.2//:crc32fast", + "@cu__hashbrown-0.14.5//:hashbrown", + "@cu__indexmap-2.3.0//:indexmap", + "@cu__memchr-2.7.4//:memchr", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.once_cell-1.19.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.once_cell-1.19.0.bazel new file mode 100644 index 000000000..d4155cdc0 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.once_cell-1.19.0.bazel @@ -0,0 +1,50 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "once_cell", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "alloc", + "default", + "race", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=once_cell", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.19.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.paste-1.0.15.bazel b/bazel/cargo/wasmtime/remote/BUILD.paste-1.0.15.bazel new file mode 100644 index 000000000..aa2c97e31 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.paste-1.0.15.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package(default_visibility = ["//visibility:public"]) + +rust_proc_macro( + name = "paste", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=paste", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.15", + deps = [ + "@cu__paste-1.0.15//:build_script_build", + ], +) + +cargo_build_script( + name = "paste_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=paste", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.15", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":paste_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.pin-project-lite-0.2.14.bazel b/bazel/cargo/wasmtime/remote/BUILD.pin-project-lite-0.2.14.bazel new file mode 100644 index 000000000..65aba34bd --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.pin-project-lite-0.2.14.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "pin_project_lite", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=pin-project-lite", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.14", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.postcard-1.0.8.bazel b/bazel/cargo/wasmtime/remote/BUILD.postcard-1.0.8.bazel new file mode 100644 index 000000000..d3af18cb4 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.postcard-1.0.8.bazel @@ -0,0 +1,54 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "postcard", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "alloc", + "embedded-io", + "use-std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=postcard", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.8", + deps = [ + "@cu__cobs-0.2.3//:cobs", + "@cu__embedded-io-0.4.0//:embedded_io", + "@cu__serde-1.0.204//:serde", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.proc-macro2-1.0.86.bazel b/bazel/cargo/wasmtime/remote/BUILD.proc-macro2-1.0.86.bazel new file mode 100644 index 000000000..f5ffa7899 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.proc-macro2-1.0.86.bazel @@ -0,0 +1,98 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "proc_macro2", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "proc-macro", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=proc-macro2", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.86", + deps = [ + "@cu__proc-macro2-1.0.86//:build_script_build", + "@cu__unicode-ident-1.0.12//:unicode_ident", + ], +) + +cargo_build_script( + name = "proc-macro2_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "default", + "proc-macro", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=proc-macro2", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.86", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":proc-macro2_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.psm-0.1.21.bazel b/bazel/cargo/wasmtime/remote/BUILD.psm-0.1.21.bazel new file mode 100644 index 000000000..ec02d2243 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.psm-0.1.21.bazel @@ -0,0 +1,92 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "psm", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=psm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.21", + deps = [ + "@cu__psm-0.1.21//:build_script_build", + ], +) + +cargo_build_script( + name = "psm_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=psm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.21", + visibility = ["//visibility:private"], + deps = [ + "@cu__cc-1.1.7//:cc", + ], +) + +alias( + name = "build_script_build", + actual = ":psm_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.quote-1.0.36.bazel b/bazel/cargo/wasmtime/remote/BUILD.quote-1.0.36.bazel new file mode 100644 index 000000000..3ad108f8f --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.quote-1.0.36.bazel @@ -0,0 +1,51 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "quote", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "proc-macro", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=quote", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.36", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.regalloc2-0.9.3.bazel b/bazel/cargo/wasmtime/remote/BUILD.regalloc2-0.9.3.bazel new file mode 100644 index 000000000..cbd3ed5fd --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.regalloc2-0.9.3.bazel @@ -0,0 +1,57 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "regalloc2", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "checker", + "default", + "std", + "trace-log", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=regalloc2", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.9.3", + deps = [ + "@cu__hashbrown-0.13.2//:hashbrown", + "@cu__log-0.4.22//:log", + "@cu__rustc-hash-1.1.0//:rustc_hash", + "@cu__slice-group-by-0.3.1//:slice_group_by", + "@cu__smallvec-1.13.2//:smallvec", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.regex-1.10.5.bazel b/bazel/cargo/wasmtime/remote/BUILD.regex-1.10.5.bazel new file mode 100644 index 000000000..efdf89bd0 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.regex-1.10.5.bazel @@ -0,0 +1,60 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "regex", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "perf", + "perf-backtrack", + "perf-cache", + "perf-dfa", + "perf-inline", + "perf-literal", + "perf-onepass", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=regex", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.10.5", + deps = [ + "@cu__aho-corasick-1.1.3//:aho_corasick", + "@cu__memchr-2.7.4//:memchr", + "@cu__regex-automata-0.4.7//:regex_automata", + "@cu__regex-syntax-0.8.4//:regex_syntax", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.regex-automata-0.4.7.bazel b/bazel/cargo/wasmtime/remote/BUILD.regex-automata-0.4.7.bazel new file mode 100644 index 000000000..da56abc92 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.regex-automata-0.4.7.bazel @@ -0,0 +1,64 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "regex_automata", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "alloc", + "dfa-onepass", + "hybrid", + "meta", + "nfa-backtrack", + "nfa-pikevm", + "nfa-thompson", + "perf-inline", + "perf-literal", + "perf-literal-multisubstring", + "perf-literal-substring", + "std", + "syntax", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=regex-automata", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.4.7", + deps = [ + "@cu__aho-corasick-1.1.3//:aho_corasick", + "@cu__memchr-2.7.4//:memchr", + "@cu__regex-syntax-0.8.4//:regex_syntax", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.regex-syntax-0.8.4.bazel b/bazel/cargo/wasmtime/remote/BUILD.regex-syntax-0.8.4.bazel new file mode 100644 index 000000000..36b411c94 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.regex-syntax-0.8.4.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "regex_syntax", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=regex-syntax", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.8.4", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.rustc-hash-1.1.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.rustc-hash-1.1.0.bazel new file mode 100644 index 000000000..4892ae611 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.rustc-hash-1.1.0.bazel @@ -0,0 +1,48 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "rustc_hash", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=rustc-hash", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.1.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.rustix-0.38.34.bazel b/bazel/cargo/wasmtime/remote/BUILD.rustix-0.38.34.bazel new file mode 100644 index 000000000..8cde617b3 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.rustix-0.38.34.bazel @@ -0,0 +1,385 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "rustix", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + aliases = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:aarch64-apple-ios": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:aarch64-apple-ios-sim": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:aarch64-fuchsia": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:aarch64-linux-android": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(windows) + }, + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:armv7-linux-androideabi": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:i686-apple-darwin": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:i686-linux-android": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:i686-pc-windows-msvc": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(windows) + }, + "@rules_rust//rust/platform:i686-unknown-freebsd": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:thumbv7em-none-eabi": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:thumbv8m.main-none-eabi": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:wasm32-unknown-unknown": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:wasm32-wasi": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:x86_64-apple-darwin": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:x86_64-apple-ios": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:x86_64-fuchsia": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:x86_64-linux-android": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(windows) + }, + "@rules_rust//rust/platform:x86_64-unknown-freebsd": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "@rules_rust//rust/platform:x86_64-unknown-none": { + "@cu__errno-0.3.9//:errno": "libc_errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + }, + "//conditions:default": {}, + }), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "alloc", + "default", + "libc-extra-traits", + "mm", + "std", + "use-libc-auxv", + ] + select({ + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "fs", # aarch64-unknown-linux-gnu + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "fs", # aarch64-unknown-nixos-gnu + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "fs", # arm-unknown-linux-gnueabi + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "fs", # armv7-unknown-linux-gnueabi + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "fs", # i686-unknown-linux-gnu + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "fs", # powerpc-unknown-linux-gnu + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "fs", # s390x-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "fs", # x86_64-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "fs", # x86_64-unknown-nixos-gnu + ], + "//conditions:default": [], + }), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=rustix", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.38.34", + deps = [ + "@cu__bitflags-2.6.0//:bitflags", + "@cu__rustix-0.38.34//:build_script_build", + ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__errno-0.3.9//:errno", # cfg(windows) + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__errno-0.3.9//:errno", # cfg(windows) + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:thumbv7em-none-eabi": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:wasm32-unknown-unknown": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:wasm32-wasi": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__errno-0.3.9//:errno", # cfg(windows) + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__linux-raw-sys-0.4.14//:linux_raw_sys", # cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))) + ], + "@rules_rust//rust/platform:x86_64-unknown-none": [ + "@cu__errno-0.3.9//:errno", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + "@cu__libc-0.2.155//:libc", # cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))))) + ], + "//conditions:default": [], + }), +) + +cargo_build_script( + name = "rustix_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "alloc", + "default", + "libc-extra-traits", + "mm", + "std", + "use-libc-auxv", + ] + select({ + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "fs", # aarch64-unknown-linux-gnu + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "fs", # aarch64-unknown-nixos-gnu + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "fs", # arm-unknown-linux-gnueabi + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "fs", # armv7-unknown-linux-gnueabi + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "fs", # i686-unknown-linux-gnu + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "fs", # powerpc-unknown-linux-gnu + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "fs", # s390x-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "fs", # x86_64-unknown-linux-gnu + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "fs", # x86_64-unknown-nixos-gnu + ], + "//conditions:default": [], + }), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=rustix", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.38.34", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":rustix_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.ryu-1.0.18.bazel b/bazel/cargo/wasmtime/remote/BUILD.ryu-1.0.18.bazel new file mode 100644 index 000000000..59399d34a --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.ryu-1.0.18.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "ryu", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=ryu", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.18", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.semver-1.0.23.bazel b/bazel/cargo/wasmtime/remote/BUILD.semver-1.0.23.bazel new file mode 100644 index 000000000..cb1d7f86c --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.semver-1.0.23.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "semver", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=semver", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.23", + deps = [ + "@cu__semver-1.0.23//:build_script_build", + ], +) + +cargo_build_script( + name = "semver_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=semver", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.23", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":semver_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.serde-1.0.204.bazel b/bazel/cargo/wasmtime/remote/BUILD.serde-1.0.204.bazel new file mode 100644 index 000000000..7e417ffd9 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.serde-1.0.204.bazel @@ -0,0 +1,104 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "serde", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "alloc", + "derive", + "serde_derive", + "std", + ], + crate_root = "src/lib.rs", + edition = "2018", + proc_macro_deps = [ + "@cu__serde_derive-1.0.204//:serde_derive", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=serde", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.204", + deps = [ + "@cu__serde-1.0.204//:build_script_build", + ], +) + +cargo_build_script( + name = "serde_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "alloc", + "derive", + "serde_derive", + "std", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=serde", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.204", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":serde_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.serde_derive-1.0.204.bazel b/bazel/cargo/wasmtime/remote/BUILD.serde_derive-1.0.204.bazel new file mode 100644 index 000000000..ef5fe8588 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.serde_derive-1.0.204.bazel @@ -0,0 +1,52 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package(default_visibility = ["//visibility:public"]) + +rust_proc_macro( + name = "serde_derive", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=serde_derive", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.204", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + "@cu__syn-2.0.72//:syn", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.serde_json-1.0.120.bazel b/bazel/cargo/wasmtime/remote/BUILD.serde_json-1.0.120.bazel new file mode 100644 index 000000000..108736275 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.serde_json-1.0.120.bazel @@ -0,0 +1,92 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "serde_json", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=serde_json", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.120", + deps = [ + "@cu__itoa-1.0.11//:itoa", + "@cu__ryu-1.0.18//:ryu", + "@cu__serde-1.0.204//:serde", + "@cu__serde_json-1.0.120//:build_script_build", + ], +) + +cargo_build_script( + name = "serde_json_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=serde_json", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.120", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":serde_json_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.slice-group-by-0.3.1.bazel b/bazel/cargo/wasmtime/remote/BUILD.slice-group-by-0.3.1.bazel new file mode 100644 index 000000000..8f7e3cdc9 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.slice-group-by-0.3.1.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "slice_group_by", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=slice-group-by", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.3.1", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.smallvec-1.13.2.bazel b/bazel/cargo/wasmtime/remote/BUILD.smallvec-1.13.2.bazel new file mode 100644 index 000000000..d6bcdee92 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.smallvec-1.13.2.bazel @@ -0,0 +1,51 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "smallvec", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "serde", + "union", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=smallvec", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.13.2", + deps = [ + "@cu__serde-1.0.204//:serde", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.sptr-0.3.2.bazel b/bazel/cargo/wasmtime/remote/BUILD.sptr-0.3.2.bazel new file mode 100644 index 000000000..e4da3ae80 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.sptr-0.3.2.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "sptr", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=sptr", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.3.2", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.stable_deref_trait-1.2.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.stable_deref_trait-1.2.0.bazel new file mode 100644 index 000000000..3bce00c61 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.stable_deref_trait-1.2.0.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "stable_deref_trait", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=stable_deref_trait", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.2.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.syn-2.0.72.bazel b/bazel/cargo/wasmtime/remote/BUILD.syn-2.0.72.bazel new file mode 100644 index 000000000..acacb26fd --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.syn-2.0.72.bazel @@ -0,0 +1,60 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "syn", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "clone-impls", + "default", + "derive", + "extra-traits", + "full", + "parsing", + "printing", + "proc-macro", + "visit-mut", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=syn", + "manual", + "noclippy", + "norustfmt", + ], + version = "2.0.72", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + "@cu__unicode-ident-1.0.12//:unicode_ident", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.target-lexicon-0.12.16.bazel b/bazel/cargo/wasmtime/remote/BUILD.target-lexicon-0.12.16.bazel new file mode 100644 index 000000000..200965695 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.target-lexicon-0.12.16.bazel @@ -0,0 +1,95 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "target_lexicon", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=target-lexicon", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.12.16", + deps = [ + "@cu__target-lexicon-0.12.16//:build_script_build", + ], +) + +cargo_build_script( + name = "target-lexicon_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "default", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=target-lexicon", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.12.16", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":target-lexicon_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.termcolor-1.4.1.bazel b/bazel/cargo/wasmtime/remote/BUILD.termcolor-1.4.1.bazel new file mode 100644 index 000000000..ccdaaf3f8 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.termcolor-1.4.1.bazel @@ -0,0 +1,56 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "termcolor", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=termcolor", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.4.1", + deps = select({ + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__winapi-util-0.1.8//:winapi_util", # cfg(windows) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__winapi-util-0.1.8//:winapi_util", # cfg(windows) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__winapi-util-0.1.8//:winapi_util", # cfg(windows) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.thiserror-1.0.63.bazel b/bazel/cargo/wasmtime/remote/BUILD.thiserror-1.0.63.bazel new file mode 100644 index 000000000..075c39ee8 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.thiserror-1.0.63.bazel @@ -0,0 +1,92 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "thiserror", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + proc_macro_deps = [ + "@cu__thiserror-impl-1.0.63//:thiserror_impl", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=thiserror", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.63", + deps = [ + "@cu__thiserror-1.0.63//:build_script_build", + ], +) + +cargo_build_script( + name = "thiserror_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=thiserror", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.63", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":thiserror_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.thiserror-impl-1.0.63.bazel b/bazel/cargo/wasmtime/remote/BUILD.thiserror-impl-1.0.63.bazel new file mode 100644 index 000000000..827631585 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.thiserror-impl-1.0.63.bazel @@ -0,0 +1,49 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package(default_visibility = ["//visibility:public"]) + +rust_proc_macro( + name = "thiserror_impl", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=thiserror-impl", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.63", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + "@cu__syn-2.0.72//:syn", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.tracing-0.1.40.bazel b/bazel/cargo/wasmtime/remote/BUILD.tracing-0.1.40.bazel new file mode 100644 index 000000000..e8bbf2590 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.tracing-0.1.40.bazel @@ -0,0 +1,57 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "tracing", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "attributes", + "default", + "std", + "tracing-attributes", + ], + crate_root = "src/lib.rs", + edition = "2018", + proc_macro_deps = [ + "@cu__tracing-attributes-0.1.27//:tracing_attributes", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=tracing", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.40", + deps = [ + "@cu__pin-project-lite-0.2.14//:pin_project_lite", + "@cu__tracing-core-0.1.32//:tracing_core", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.tracing-attributes-0.1.27.bazel b/bazel/cargo/wasmtime/remote/BUILD.tracing-attributes-0.1.27.bazel new file mode 100644 index 000000000..8dc144d30 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.tracing-attributes-0.1.27.bazel @@ -0,0 +1,49 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package(default_visibility = ["//visibility:public"]) + +rust_proc_macro( + name = "tracing_attributes", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=tracing-attributes", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.27", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + "@cu__syn-2.0.72//:syn", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.tracing-core-0.1.32.bazel b/bazel/cargo/wasmtime/remote/BUILD.tracing-core-0.1.32.bazel new file mode 100644 index 000000000..cd5b7378b --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.tracing-core-0.1.32.bazel @@ -0,0 +1,51 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "tracing_core", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "once_cell", + "std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=tracing-core", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.32", + deps = [ + "@cu__once_cell-1.19.0//:once_cell", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.unicode-ident-1.0.12.bazel b/bazel/cargo/wasmtime/remote/BUILD.unicode-ident-1.0.12.bazel new file mode 100644 index 000000000..e21e8cd07 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.unicode-ident-1.0.12.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "unicode_ident", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=unicode-ident", + "manual", + "noclippy", + "norustfmt", + ], + version = "1.0.12", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.unicode-xid-0.2.4.bazel b/bazel/cargo/wasmtime/remote/BUILD.unicode-xid-0.2.4.bazel new file mode 100644 index 000000000..a8b5dda0b --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.unicode-xid-0.2.4.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "unicode_xid", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=unicode-xid", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.2.4", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.version_check-0.9.5.bazel b/bazel/cargo/wasmtime/remote/BUILD.version_check-0.9.5.bazel new file mode 100644 index 000000000..e24cea268 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.version_check-0.9.5.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "version_check", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2015", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=version_check", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.9.5", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasm-encoder-0.215.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasm-encoder-0.215.0.bazel new file mode 100644 index 000000000..e24ef2076 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasm-encoder-0.215.0.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasm_encoder", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasm-encoder", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.215.0", + deps = [ + "@cu__leb128-0.2.5//:leb128", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmparser-0.215.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmparser-0.215.0.bazel new file mode 100644 index 000000000..3f3d22eb9 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmparser-0.215.0.bazel @@ -0,0 +1,57 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmparser", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "serde", + "std", + "validate", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmparser", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.215.0", + deps = [ + "@cu__ahash-0.8.11//:ahash", + "@cu__bitflags-2.6.0//:bitflags", + "@cu__hashbrown-0.14.5//:hashbrown", + "@cu__indexmap-2.3.0//:indexmap", + "@cu__semver-1.0.23//:semver", + "@cu__serde-1.0.204//:serde", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmprinter-0.215.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmprinter-0.215.0.bazel new file mode 100644 index 000000000..5ee382b0f --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmprinter-0.215.0.bazel @@ -0,0 +1,49 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmprinter", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmprinter", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.215.0", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__termcolor-1.4.1//:termcolor", + "@cu__wasmparser-0.215.0//:wasmparser", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-24.0.0.bazel new file mode 100644 index 000000000..1f77ab476 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-24.0.0.bazel @@ -0,0 +1,230 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmtime", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "cranelift", + "gc", + "runtime", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + proc_macro_deps = [ + "@cu__paste-1.0.15//:paste", + "@cu__serde_derive-1.0.204//:serde_derive", + "@cu__wasmtime-versioned-export-macros-24.0.0//:wasmtime_versioned_export_macros", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__bitflags-2.6.0//:bitflags", + "@cu__bumpalo-3.16.0//:bumpalo", + "@cu__cfg-if-1.0.0//:cfg_if", + "@cu__hashbrown-0.14.5//:hashbrown", + "@cu__indexmap-2.3.0//:indexmap", + "@cu__libc-0.2.155//:libc", + "@cu__libm-0.2.8//:libm", + "@cu__log-0.4.22//:log", + "@cu__object-0.36.2//:object", + "@cu__once_cell-1.19.0//:once_cell", + "@cu__postcard-1.0.8//:postcard", + "@cu__serde-1.0.204//:serde", + "@cu__smallvec-1.13.2//:smallvec", + "@cu__sptr-0.3.2//:sptr", + "@cu__target-lexicon-0.12.16//:target_lexicon", + "@cu__wasmparser-0.215.0//:wasmparser", + "@cu__wasmtime-24.0.0//:build_script_build", + "@cu__wasmtime-asm-macros-24.0.0//:wasmtime_asm_macros", + "@cu__wasmtime-cranelift-24.0.0//:wasmtime_cranelift", + "@cu__wasmtime-environ-24.0.0//:wasmtime_environ", + "@cu__wasmtime-jit-icache-coherence-24.0.0//:wasmtime_jit_icache_coherence", + "@cu__wasmtime-slab-24.0.0//:wasmtime_slab", + ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__mach2-0.4.2//:mach2", # cfg(target_os = "macos") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-fuchsia": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(target_os = "windows") + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@cu__memfd-0.6.4//:memfd", # cfg(target_os = "linux") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@cu__memfd-0.6.4//:memfd", # cfg(target_os = "linux") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@cu__memfd-0.6.4//:memfd", # cfg(target_os = "linux") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@cu__memfd-0.6.4//:memfd", # cfg(target_os = "linux") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__mach2-0.4.2//:mach2", # cfg(target_os = "macos") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(target_os = "windows") + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__memfd-0.6.4//:memfd", # cfg(target_os = "linux") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@cu__memfd-0.6.4//:memfd", # cfg(target_os = "linux") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__memfd-0.6.4//:memfd", # cfg(target_os = "linux") + "@cu__psm-0.1.21//:psm", # cfg(target_arch = "s390x") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__mach2-0.4.2//:mach2", # cfg(target_os = "macos") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-fuchsia": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(target_os = "windows") + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__memfd-0.6.4//:memfd", # cfg(target_os = "linux") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__memfd-0.6.4//:memfd", # cfg(target_os = "linux") + "@cu__rustix-0.38.34//:rustix", # cfg(unix) + ], + "//conditions:default": [], + }), +) + +cargo_build_script( + name = "wasmtime_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_features = [ + "cranelift", + "gc", + "runtime", + "std", + ], + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + proc_macro_deps = [ + "@cu__wasmtime-versioned-export-macros-24.0.0//:wasmtime_versioned_export_macros", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + visibility = ["//visibility:private"], + deps = [ + "@cu__cc-1.1.7//:cc", + ], +) + +alias( + name = "build_script_build", + actual = ":wasmtime_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-asm-macros-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-asm-macros-24.0.0.bazel new file mode 100644 index 000000000..d90c660db --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-asm-macros-24.0.0.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmtime_asm_macros", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-asm-macros", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__cfg-if-1.0.0//:cfg_if", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-c-api-macros-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-c-api-macros-24.0.0.bazel new file mode 100644 index 000000000..735e52d30 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-c-api-macros-24.0.0.bazel @@ -0,0 +1,48 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package(default_visibility = ["//visibility:public"]) + +rust_proc_macro( + name = "wasmtime_c_api_macros", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-c-api-macros", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-component-macro-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-component-macro-24.0.0.bazel new file mode 100644 index 000000000..5e50e4fc8 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-component-macro-24.0.0.bazel @@ -0,0 +1,96 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package(default_visibility = ["//visibility:public"]) + +rust_proc_macro( + name = "wasmtime_component_macro", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-component-macro", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + "@cu__syn-2.0.72//:syn", + "@cu__wasmtime-component-macro-24.0.0//:build_script_build", + "@cu__wasmtime-component-util-24.0.0//:wasmtime_component_util", + "@cu__wasmtime-wit-bindgen-24.0.0//:wasmtime_wit_bindgen", + "@cu__wit-parser-0.215.0//:wit_parser", + ], +) + +cargo_build_script( + name = "wasmtime-component-macro_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-component-macro", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":wasmtime-component-macro_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-component-util-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-component-util-24.0.0.bazel new file mode 100644 index 000000000..9823cd36b --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-component-util-24.0.0.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmtime_component_util", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-component-util", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-cranelift-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-cranelift-24.0.0.bazel new file mode 100644 index 000000000..4687bb7c8 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-cranelift-24.0.0.bazel @@ -0,0 +1,67 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmtime_cranelift", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "gc", + ], + crate_root = "src/lib.rs", + edition = "2021", + proc_macro_deps = [ + "@cu__wasmtime-versioned-export-macros-24.0.0//:wasmtime_versioned_export_macros", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-cranelift", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__cfg-if-1.0.0//:cfg_if", + "@cu__cranelift-codegen-0.111.0//:cranelift_codegen", + "@cu__cranelift-control-0.111.0//:cranelift_control", + "@cu__cranelift-entity-0.111.0//:cranelift_entity", + "@cu__cranelift-frontend-0.111.0//:cranelift_frontend", + "@cu__cranelift-native-0.111.0//:cranelift_native", + "@cu__cranelift-wasm-0.111.0//:cranelift_wasm", + "@cu__gimli-0.29.0//:gimli", + "@cu__log-0.4.22//:log", + "@cu__object-0.36.2//:object", + "@cu__target-lexicon-0.12.16//:target_lexicon", + "@cu__thiserror-1.0.63//:thiserror", + "@cu__wasmparser-0.215.0//:wasmparser", + "@cu__wasmtime-environ-24.0.0//:wasmtime_environ", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-environ-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-environ-24.0.0.bazel new file mode 100644 index 000000000..879839848 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-environ-24.0.0.bazel @@ -0,0 +1,68 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmtime_environ", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "compile", + "gc", + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + proc_macro_deps = [ + "@cu__serde_derive-1.0.204//:serde_derive", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-environ", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__cranelift-bitset-0.111.0//:cranelift_bitset", + "@cu__cranelift-entity-0.111.0//:cranelift_entity", + "@cu__gimli-0.29.0//:gimli", + "@cu__indexmap-2.3.0//:indexmap", + "@cu__log-0.4.22//:log", + "@cu__object-0.36.2//:object", + "@cu__postcard-1.0.8//:postcard", + "@cu__serde-1.0.204//:serde", + "@cu__target-lexicon-0.12.16//:target_lexicon", + "@cu__wasm-encoder-0.215.0//:wasm_encoder", + "@cu__wasmparser-0.215.0//:wasmparser", + "@cu__wasmprinter-0.215.0//:wasmprinter", + "@cu__wasmtime-types-24.0.0//:wasmtime_types", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-jit-icache-coherence-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-jit-icache-coherence-24.0.0.bazel new file mode 100644 index 000000000..a1c3e8bdd --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-jit-icache-coherence-24.0.0.bazel @@ -0,0 +1,113 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmtime_jit_icache_coherence", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-jit-icache-coherence", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__cfg-if-1.0.0//:cfg_if", + ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(target_os = "windows") + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(target_os = "windows") + ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(target_os = "windows") + ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__libc-0.2.155//:libc", # cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "android")) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-slab-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-slab-24.0.0.bazel new file mode 100644 index 000000000..6a2147b54 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-slab-24.0.0.bazel @@ -0,0 +1,44 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmtime_slab", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-slab", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-types-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-types-24.0.0.bazel new file mode 100644 index 000000000..4305c4a59 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-types-24.0.0.bazel @@ -0,0 +1,57 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmtime_types", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "std", + ], + crate_root = "src/lib.rs", + edition = "2021", + proc_macro_deps = [ + "@cu__serde_derive-1.0.204//:serde_derive", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-types", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__cranelift-entity-0.111.0//:cranelift_entity", + "@cu__serde-1.0.204//:serde", + "@cu__smallvec-1.13.2//:smallvec", + "@cu__wasmparser-0.215.0//:wasmparser", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-versioned-export-macros-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-versioned-export-macros-24.0.0.bazel new file mode 100644 index 000000000..27dcf699a --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-versioned-export-macros-24.0.0.bazel @@ -0,0 +1,49 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package(default_visibility = ["//visibility:public"]) + +rust_proc_macro( + name = "wasmtime_versioned_export_macros", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-versioned-export-macros", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + "@cu__syn-2.0.72//:syn", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wasmtime-wit-bindgen-24.0.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-wit-bindgen-24.0.0.bazel new file mode 100644 index 000000000..53a8655c1 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wasmtime-wit-bindgen-24.0.0.bazel @@ -0,0 +1,50 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wasmtime_wit_bindgen", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wasmtime-wit-bindgen", + "manual", + "noclippy", + "norustfmt", + ], + version = "24.0.0", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__heck-0.4.1//:heck", + "@cu__indexmap-2.3.0//:indexmap", + "@cu__wit-parser-0.215.0//:wit_parser", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.winapi-util-0.1.8.bazel b/bazel/cargo/wasmtime/remote/BUILD.winapi-util-0.1.8.bazel new file mode 100644 index 000000000..7df210fa1 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.winapi-util-0.1.8.bazel @@ -0,0 +1,56 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "winapi_util", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=winapi-util", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.1.8", + deps = select({ + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__windows-sys-0.52.0//:windows_sys", # cfg(windows) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows-sys-0.52.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows-sys-0.52.0.bazel new file mode 100644 index 000000000..eaa163139 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows-sys-0.52.0.bazel @@ -0,0 +1,63 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_sys", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "Win32", + "Win32_Foundation", + "Win32_Security", + "Win32_Storage", + "Win32_Storage_FileSystem", + "Win32_System", + "Win32_System_Console", + "Win32_System_Diagnostics", + "Win32_System_Diagnostics_Debug", + "Win32_System_Kernel", + "Win32_System_Memory", + "Win32_System_SystemInformation", + "Win32_System_Threading", + "default", + ], + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows-sys", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.0", + deps = [ + "@cu__windows-targets-0.52.6//:windows_targets", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows-targets-0.52.6.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows-targets-0.52.6.bazel new file mode 100644 index 000000000..eddc343ce --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows-targets-0.52.6.bazel @@ -0,0 +1,65 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_targets", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows-targets", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + deps = select({ + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ + "@cu__windows_aarch64_msvc-0.52.6//:windows_aarch64_msvc", # cfg(all(target_arch = "aarch64", target_env = "msvc", not(windows_raw_dylib))) + ], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [ + "@cu__windows_i686_msvc-0.52.6//:windows_i686_msvc", # cfg(all(target_arch = "x86", target_env = "msvc", not(windows_raw_dylib))) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@cu__windows_i686_gnu-0.52.6//:windows_i686_gnu", # cfg(all(target_arch = "x86", target_env = "gnu", not(target_abi = "llvm"), not(windows_raw_dylib))) + ], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ + "@cu__windows_x86_64_msvc-0.52.6//:windows_x86_64_msvc", # cfg(all(any(target_arch = "x86_64", target_arch = "arm64ec"), target_env = "msvc", not(windows_raw_dylib))) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@cu__windows_x86_64_gnu-0.52.6//:windows_x86_64_gnu", # cfg(all(target_arch = "x86_64", target_env = "gnu", not(target_abi = "llvm"), not(windows_raw_dylib))) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@cu__windows_x86_64_gnu-0.52.6//:windows_x86_64_gnu", # cfg(all(target_arch = "x86_64", target_env = "gnu", not(target_abi = "llvm"), not(windows_raw_dylib))) + ], + "//conditions:default": [], + }), +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows_aarch64_gnullvm-0.52.6.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows_aarch64_gnullvm-0.52.6.bazel new file mode 100644 index 000000000..ec79e2200 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows_aarch64_gnullvm-0.52.6.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_aarch64_gnullvm", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_aarch64_gnullvm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + deps = [ + "@cu__windows_aarch64_gnullvm-0.52.6//:build_script_build", + ], +) + +cargo_build_script( + name = "windows_aarch64_gnullvm_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_aarch64_gnullvm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":windows_aarch64_gnullvm_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows_aarch64_msvc-0.52.6.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows_aarch64_msvc-0.52.6.bazel new file mode 100644 index 000000000..47ac38a7a --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows_aarch64_msvc-0.52.6.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_aarch64_msvc", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_aarch64_msvc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + deps = [ + "@cu__windows_aarch64_msvc-0.52.6//:build_script_build", + ], +) + +cargo_build_script( + name = "windows_aarch64_msvc_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_aarch64_msvc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":windows_aarch64_msvc_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows_i686_gnu-0.52.6.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows_i686_gnu-0.52.6.bazel new file mode 100644 index 000000000..e3f0ef486 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows_i686_gnu-0.52.6.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_i686_gnu", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_i686_gnu", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + deps = [ + "@cu__windows_i686_gnu-0.52.6//:build_script_build", + ], +) + +cargo_build_script( + name = "windows_i686_gnu_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_i686_gnu", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":windows_i686_gnu_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows_i686_gnullvm-0.52.6.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows_i686_gnullvm-0.52.6.bazel new file mode 100644 index 000000000..d89f239b5 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows_i686_gnullvm-0.52.6.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_i686_gnullvm", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_i686_gnullvm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + deps = [ + "@cu__windows_i686_gnullvm-0.52.6//:build_script_build", + ], +) + +cargo_build_script( + name = "windows_i686_gnullvm_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_i686_gnullvm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":windows_i686_gnullvm_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows_i686_msvc-0.52.6.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows_i686_msvc-0.52.6.bazel new file mode 100644 index 000000000..f6e758e5b --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows_i686_msvc-0.52.6.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_i686_msvc", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_i686_msvc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + deps = [ + "@cu__windows_i686_msvc-0.52.6//:build_script_build", + ], +) + +cargo_build_script( + name = "windows_i686_msvc_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_i686_msvc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":windows_i686_msvc_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows_x86_64_gnu-0.52.6.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows_x86_64_gnu-0.52.6.bazel new file mode 100644 index 000000000..cbccf337a --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows_x86_64_gnu-0.52.6.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_x86_64_gnu", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_x86_64_gnu", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + deps = [ + "@cu__windows_x86_64_gnu-0.52.6//:build_script_build", + ], +) + +cargo_build_script( + name = "windows_x86_64_gnu_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_x86_64_gnu", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":windows_x86_64_gnu_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows_x86_64_gnullvm-0.52.6.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows_x86_64_gnullvm-0.52.6.bazel new file mode 100644 index 000000000..91ac1adff --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows_x86_64_gnullvm-0.52.6.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_x86_64_gnullvm", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_x86_64_gnullvm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + deps = [ + "@cu__windows_x86_64_gnullvm-0.52.6//:build_script_build", + ], +) + +cargo_build_script( + name = "windows_x86_64_gnullvm_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_x86_64_gnullvm", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":windows_x86_64_gnullvm_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.windows_x86_64_msvc-0.52.6.bazel b/bazel/cargo/wasmtime/remote/BUILD.windows_x86_64_msvc-0.52.6.bazel new file mode 100644 index 000000000..fda09849a --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.windows_x86_64_msvc-0.52.6.bazel @@ -0,0 +1,89 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "windows_x86_64_msvc", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_x86_64_msvc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + deps = [ + "@cu__windows_x86_64_msvc-0.52.6//:build_script_build", + ], +) + +cargo_build_script( + name = "windows_x86_64_msvc_bs", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + crate_name = "build_script_build", + crate_root = "build.rs", + data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + edition = "2021", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=windows_x86_64_msvc", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.52.6", + visibility = ["//visibility:private"], +) + +alias( + name = "build_script_build", + actual = ":windows_x86_64_msvc_bs", + tags = ["manual"], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.wit-parser-0.215.0.bazel b/bazel/cargo/wasmtime/remote/BUILD.wit-parser-0.215.0.bazel new file mode 100644 index 000000000..f2e6ad6a2 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.wit-parser-0.215.0.bazel @@ -0,0 +1,58 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "wit_parser", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2021", + proc_macro_deps = [ + "@cu__serde_derive-1.0.204//:serde_derive", + ], + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=wit-parser", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.215.0", + deps = [ + "@cu__anyhow-1.0.86//:anyhow", + "@cu__id-arena-2.2.1//:id_arena", + "@cu__indexmap-2.3.0//:indexmap", + "@cu__log-0.4.22//:log", + "@cu__semver-1.0.23//:semver", + "@cu__serde-1.0.204//:serde", + "@cu__serde_json-1.0.120//:serde_json", + "@cu__unicode-xid-0.2.4//:unicode_xid", + "@cu__wasmparser-0.215.0//:wasmparser", + ], +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.zerocopy-0.7.35.bazel b/bazel/cargo/wasmtime/remote/BUILD.zerocopy-0.7.35.bazel new file mode 100644 index 000000000..5bb874604 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.zerocopy-0.7.35.bazel @@ -0,0 +1,47 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "zerocopy", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "simd", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=zerocopy", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.7.35", +) diff --git a/bazel/cargo/wasmtime/remote/BUILD.zerocopy-derive-0.7.35.bazel b/bazel/cargo/wasmtime/remote/BUILD.zerocopy-derive-0.7.35.bazel new file mode 100644 index 000000000..dc6f82dfc --- /dev/null +++ b/bazel/cargo/wasmtime/remote/BUILD.zerocopy-derive-0.7.35.bazel @@ -0,0 +1,49 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_proc_macro") + +package(default_visibility = ["//visibility:public"]) + +rust_proc_macro( + name = "zerocopy_derive", + srcs = glob( + include = ["**/*.rs"], + allow_empty = False, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=zerocopy-derive", + "manual", + "noclippy", + "norustfmt", + ], + version = "0.7.35", + deps = [ + "@cu__proc-macro2-1.0.86//:proc_macro2", + "@cu__quote-1.0.36//:quote", + "@cu__syn-2.0.72//:syn", + ], +) diff --git a/bazel/cargo/wasmtime/remote/alias_rules.bzl b/bazel/cargo/wasmtime/remote/alias_rules.bzl new file mode 100644 index 000000000..14b04c127 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/alias_rules.bzl @@ -0,0 +1,47 @@ +"""Alias that transitions its target to `compilation_mode=opt`. Use `transition_alias="opt"` to enable.""" + +load("@rules_cc//cc:defs.bzl", "CcInfo") +load("@rules_rust//rust:rust_common.bzl", "COMMON_PROVIDERS") + +def _transition_alias_impl(ctx): + # `ctx.attr.actual` is a list of 1 item due to the transition + providers = [ctx.attr.actual[0][provider] for provider in COMMON_PROVIDERS] + if CcInfo in ctx.attr.actual[0]: + providers.append(ctx.attr.actual[0][CcInfo]) + return providers + +def _change_compilation_mode(compilation_mode): + def _change_compilation_mode_impl(_settings, _attr): + return { + "//command_line_option:compilation_mode": compilation_mode, + } + + return transition( + implementation = _change_compilation_mode_impl, + inputs = [], + outputs = [ + "//command_line_option:compilation_mode", + ], + ) + +def _transition_alias_rule(compilation_mode): + return rule( + implementation = _transition_alias_impl, + provides = COMMON_PROVIDERS, + attrs = { + "actual": attr.label( + mandatory = True, + doc = "`rust_library()` target to transition to `compilation_mode=opt`.", + providers = COMMON_PROVIDERS, + cfg = _change_compilation_mode(compilation_mode), + ), + "_allowlist_function_transition": attr.label( + default = "@bazel_tools//tools/allowlists/function_transition_allowlist", + ), + }, + doc = "Transitions a Rust library crate to the `compilation_mode=opt`.", + ) + +transition_alias_dbg = _transition_alias_rule("dbg") +transition_alias_fastbuild = _transition_alias_rule("fastbuild") +transition_alias_opt = _transition_alias_rule("opt") diff --git a/bazel/cargo/wasmtime/remote/crates.bzl b/bazel/cargo/wasmtime/remote/crates.bzl new file mode 100644 index 000000000..c2726d29f --- /dev/null +++ b/bazel/cargo/wasmtime/remote/crates.bzl @@ -0,0 +1,32 @@ +############################################################################### +# @generated +# This file is auto-generated by the cargo-bazel tool. +# +# DO NOT MODIFY: Local changes may be replaced in future executions. +############################################################################### +"""Rules for defining repositories for remote `crates_vendor` repositories""" + +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") + +# buildifier: disable=bzl-visibility +load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:defs.bzl", _crate_repositories = "crate_repositories") + +# buildifier: disable=bzl-visibility +load("@rules_rust//crate_universe/private:crates_vendor.bzl", "crates_vendor_remote_repository") + +def crate_repositories(): + """Generates repositories for vendored crates. + + Returns: + A list of repos visible to the module through the module extension. + """ + maybe( + crates_vendor_remote_repository, + name = "cu", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.bazel"), + defs_module = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:defs.bzl"), + ) + + direct_deps = [struct(repo = "cu", is_dev_dep = False)] + direct_deps.extend(_crate_repositories()) + return direct_deps diff --git a/bazel/cargo/wasmtime/remote/defs.bzl b/bazel/cargo/wasmtime/remote/defs.bzl new file mode 100644 index 000000000..0f2656ce1 --- /dev/null +++ b/bazel/cargo/wasmtime/remote/defs.bzl @@ -0,0 +1,1537 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @//bazel/cargo/wasmtime:crates_vendor +############################################################################### +""" +# `crates_repository` API + +- [aliases](#aliases) +- [crate_deps](#crate_deps) +- [all_crate_deps](#all_crate_deps) +- [crate_repositories](#crate_repositories) + +""" + +load("@bazel_skylib//lib:selects.bzl", "selects") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") + +############################################################################### +# MACROS API +############################################################################### + +# An identifier that represent common dependencies (unconditional). +_COMMON_CONDITION = "" + +def _flatten_dependency_maps(all_dependency_maps): + """Flatten a list of dependency maps into one dictionary. + + Dependency maps have the following structure: + + ```python + DEPENDENCIES_MAP = { + # The first key in the map is a Bazel package + # name of the workspace this file is defined in. + "workspace_member_package": { + + # Not all dependencies are supported for all platforms. + # the condition key is the condition required to be true + # on the host platform. + "condition": { + + # An alias to a crate target. # The label of the crate target the + # Aliases are only crate names. # package name refers to. + "package_name": "@full//:label", + } + } + } + ``` + + Args: + all_dependency_maps (list): A list of dicts as described above + + Returns: + dict: A dictionary as described above + """ + dependencies = {} + + for workspace_deps_map in all_dependency_maps: + for pkg_name, conditional_deps_map in workspace_deps_map.items(): + if pkg_name not in dependencies: + non_frozen_map = dict() + for key, values in conditional_deps_map.items(): + non_frozen_map.update({key: dict(values.items())}) + dependencies.setdefault(pkg_name, non_frozen_map) + continue + + for condition, deps_map in conditional_deps_map.items(): + # If the condition has not been recorded, do so and continue + if condition not in dependencies[pkg_name]: + dependencies[pkg_name].setdefault(condition, dict(deps_map.items())) + continue + + # Alert on any miss-matched dependencies + inconsistent_entries = [] + for crate_name, crate_label in deps_map.items(): + existing = dependencies[pkg_name][condition].get(crate_name) + if existing and existing != crate_label: + inconsistent_entries.append((crate_name, existing, crate_label)) + dependencies[pkg_name][condition].update({crate_name: crate_label}) + + return dependencies + +def crate_deps(deps, package_name = None): + """Finds the fully qualified label of the requested crates for the package where this macro is called. + + Args: + deps (list): The desired list of crate targets. + package_name (str, optional): The package name of the set of dependencies to look up. + Defaults to `native.package_name()`. + + Returns: + list: A list of labels to generated rust targets (str) + """ + + if not deps: + return [] + + if package_name == None: + package_name = native.package_name() + + # Join both sets of dependencies + dependencies = _flatten_dependency_maps([ + _NORMAL_DEPENDENCIES, + _NORMAL_DEV_DEPENDENCIES, + _PROC_MACRO_DEPENDENCIES, + _PROC_MACRO_DEV_DEPENDENCIES, + _BUILD_DEPENDENCIES, + _BUILD_PROC_MACRO_DEPENDENCIES, + ]).pop(package_name, {}) + + # Combine all conditional packages so we can easily index over a flat list + # TODO: Perhaps this should actually return select statements and maintain + # the conditionals of the dependencies + flat_deps = {} + for deps_set in dependencies.values(): + for crate_name, crate_label in deps_set.items(): + flat_deps.update({crate_name: crate_label}) + + missing_crates = [] + crate_targets = [] + for crate_target in deps: + if crate_target not in flat_deps: + missing_crates.append(crate_target) + else: + crate_targets.append(flat_deps[crate_target]) + + if missing_crates: + fail("Could not find crates `{}` among dependencies of `{}`. Available dependencies were `{}`".format( + missing_crates, + package_name, + dependencies, + )) + + return crate_targets + +def all_crate_deps( + normal = False, + normal_dev = False, + proc_macro = False, + proc_macro_dev = False, + build = False, + build_proc_macro = False, + package_name = None): + """Finds the fully qualified label of all requested direct crate dependencies \ + for the package where this macro is called. + + If no parameters are set, all normal dependencies are returned. Setting any one flag will + otherwise impact the contents of the returned list. + + Args: + normal (bool, optional): If True, normal dependencies are included in the + output list. + normal_dev (bool, optional): If True, normal dev dependencies will be + included in the output list.. + proc_macro (bool, optional): If True, proc_macro dependencies are included + in the output list. + proc_macro_dev (bool, optional): If True, dev proc_macro dependencies are + included in the output list. + build (bool, optional): If True, build dependencies are included + in the output list. + build_proc_macro (bool, optional): If True, build proc_macro dependencies are + included in the output list. + package_name (str, optional): The package name of the set of dependencies to look up. + Defaults to `native.package_name()` when unset. + + Returns: + list: A list of labels to generated rust targets (str) + """ + + if package_name == None: + package_name = native.package_name() + + # Determine the relevant maps to use + all_dependency_maps = [] + if normal: + all_dependency_maps.append(_NORMAL_DEPENDENCIES) + if normal_dev: + all_dependency_maps.append(_NORMAL_DEV_DEPENDENCIES) + if proc_macro: + all_dependency_maps.append(_PROC_MACRO_DEPENDENCIES) + if proc_macro_dev: + all_dependency_maps.append(_PROC_MACRO_DEV_DEPENDENCIES) + if build: + all_dependency_maps.append(_BUILD_DEPENDENCIES) + if build_proc_macro: + all_dependency_maps.append(_BUILD_PROC_MACRO_DEPENDENCIES) + + # Default to always using normal dependencies + if not all_dependency_maps: + all_dependency_maps.append(_NORMAL_DEPENDENCIES) + + dependencies = _flatten_dependency_maps(all_dependency_maps).pop(package_name, None) + + if not dependencies: + if dependencies == None: + fail("Tried to get all_crate_deps for package " + package_name + " but that package had no Cargo.toml file") + else: + return [] + + crate_deps = list(dependencies.pop(_COMMON_CONDITION, {}).values()) + for condition, deps in dependencies.items(): + crate_deps += selects.with_or({ + tuple(_CONDITIONS[condition]): deps.values(), + "//conditions:default": [], + }) + + return crate_deps + +def aliases( + normal = False, + normal_dev = False, + proc_macro = False, + proc_macro_dev = False, + build = False, + build_proc_macro = False, + package_name = None): + """Produces a map of Crate alias names to their original label + + If no dependency kinds are specified, `normal` and `proc_macro` are used by default. + Setting any one flag will otherwise determine the contents of the returned dict. + + Args: + normal (bool, optional): If True, normal dependencies are included in the + output list. + normal_dev (bool, optional): If True, normal dev dependencies will be + included in the output list.. + proc_macro (bool, optional): If True, proc_macro dependencies are included + in the output list. + proc_macro_dev (bool, optional): If True, dev proc_macro dependencies are + included in the output list. + build (bool, optional): If True, build dependencies are included + in the output list. + build_proc_macro (bool, optional): If True, build proc_macro dependencies are + included in the output list. + package_name (str, optional): The package name of the set of dependencies to look up. + Defaults to `native.package_name()` when unset. + + Returns: + dict: The aliases of all associated packages + """ + if package_name == None: + package_name = native.package_name() + + # Determine the relevant maps to use + all_aliases_maps = [] + if normal: + all_aliases_maps.append(_NORMAL_ALIASES) + if normal_dev: + all_aliases_maps.append(_NORMAL_DEV_ALIASES) + if proc_macro: + all_aliases_maps.append(_PROC_MACRO_ALIASES) + if proc_macro_dev: + all_aliases_maps.append(_PROC_MACRO_DEV_ALIASES) + if build: + all_aliases_maps.append(_BUILD_ALIASES) + if build_proc_macro: + all_aliases_maps.append(_BUILD_PROC_MACRO_ALIASES) + + # Default to always using normal aliases + if not all_aliases_maps: + all_aliases_maps.append(_NORMAL_ALIASES) + all_aliases_maps.append(_PROC_MACRO_ALIASES) + + aliases = _flatten_dependency_maps(all_aliases_maps).pop(package_name, None) + + if not aliases: + return dict() + + common_items = aliases.pop(_COMMON_CONDITION, {}).items() + + # If there are only common items in the dictionary, immediately return them + if not len(aliases.keys()) == 1: + return dict(common_items) + + # Build a single select statement where each conditional has accounted for the + # common set of aliases. + crate_aliases = {"//conditions:default": dict(common_items)} + for condition, deps in aliases.items(): + condition_triples = _CONDITIONS[condition] + for triple in condition_triples: + if triple in crate_aliases: + crate_aliases[triple].update(deps) + else: + crate_aliases.update({triple: dict(deps.items() + common_items)}) + + return select(crate_aliases) + +############################################################################### +# WORKSPACE MEMBER DEPS AND ALIASES +############################################################################### + +_NORMAL_DEPENDENCIES = { + "bazel/cargo/wasmtime": { + _COMMON_CONDITION: { + "anyhow": Label("@cu__anyhow-1.0.86//:anyhow"), + "env_logger": Label("@cu__env_logger-0.10.2//:env_logger"), + "log": Label("@cu__log-0.4.22//:log"), + "once_cell": Label("@cu__once_cell-1.19.0//:once_cell"), + "tracing": Label("@cu__tracing-0.1.40//:tracing"), + "wasmtime": Label("@cu__wasmtime-24.0.0//:wasmtime"), + }, + }, +} + +_NORMAL_ALIASES = { + "bazel/cargo/wasmtime": { + _COMMON_CONDITION: { + }, + }, +} + +_NORMAL_DEV_DEPENDENCIES = { + "bazel/cargo/wasmtime": { + }, +} + +_NORMAL_DEV_ALIASES = { + "bazel/cargo/wasmtime": { + }, +} + +_PROC_MACRO_DEPENDENCIES = { + "bazel/cargo/wasmtime": { + _COMMON_CONDITION: { + "wasmtime-c-api-macros": Label("@cu__wasmtime-c-api-macros-24.0.0//:wasmtime_c_api_macros"), + }, + }, +} + +_PROC_MACRO_ALIASES = { + "bazel/cargo/wasmtime": { + }, +} + +_PROC_MACRO_DEV_DEPENDENCIES = { + "bazel/cargo/wasmtime": { + }, +} + +_PROC_MACRO_DEV_ALIASES = { + "bazel/cargo/wasmtime": { + }, +} + +_BUILD_DEPENDENCIES = { + "bazel/cargo/wasmtime": { + }, +} + +_BUILD_ALIASES = { + "bazel/cargo/wasmtime": { + }, +} + +_BUILD_PROC_MACRO_DEPENDENCIES = { + "bazel/cargo/wasmtime": { + }, +} + +_BUILD_PROC_MACRO_ALIASES = { + "bazel/cargo/wasmtime": { + }, +} + +_CONDITIONS = { + "aarch64-apple-darwin": ["@rules_rust//rust/platform:aarch64-apple-darwin"], + "aarch64-apple-ios": ["@rules_rust//rust/platform:aarch64-apple-ios"], + "aarch64-apple-ios-sim": ["@rules_rust//rust/platform:aarch64-apple-ios-sim"], + "aarch64-fuchsia": ["@rules_rust//rust/platform:aarch64-fuchsia"], + "aarch64-linux-android": ["@rules_rust//rust/platform:aarch64-linux-android"], + "aarch64-pc-windows-gnullvm": [], + "aarch64-pc-windows-msvc": ["@rules_rust//rust/platform:aarch64-pc-windows-msvc"], + "aarch64-unknown-linux-gnu": ["@rules_rust//rust/platform:aarch64-unknown-linux-gnu"], + "aarch64-unknown-nixos-gnu": ["@rules_rust//rust/platform:aarch64-unknown-nixos-gnu"], + "aarch64-unknown-nto-qnx710": ["@rules_rust//rust/platform:aarch64-unknown-nto-qnx710"], + "arm-unknown-linux-gnueabi": ["@rules_rust//rust/platform:arm-unknown-linux-gnueabi"], + "armv7-linux-androideabi": ["@rules_rust//rust/platform:armv7-linux-androideabi"], + "armv7-unknown-linux-gnueabi": ["@rules_rust//rust/platform:armv7-unknown-linux-gnueabi"], + "cfg(all(any(target_arch = \"x86_64\", target_arch = \"arm64ec\"), target_env = \"msvc\", not(windows_raw_dylib)))": ["@rules_rust//rust/platform:x86_64-pc-windows-msvc"], + "cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": ["@rules_rust//rust/platform:aarch64-linux-android", "@rules_rust//rust/platform:armv7-linux-androideabi", "@rules_rust//rust/platform:i686-linux-android", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-linux-android"], + "cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"))))": ["@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-apple-ios-sim", "@rules_rust//rust/platform:aarch64-fuchsia", "@rules_rust//rust/platform:aarch64-linux-android", "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710", "@rules_rust//rust/platform:armv7-linux-androideabi", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:i686-linux-android", "@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:riscv32imc-unknown-none-elf", "@rules_rust//rust/platform:riscv64gc-unknown-none-elf", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:thumbv7em-none-eabi", "@rules_rust//rust/platform:thumbv8m.main-none-eabi", "@rules_rust//rust/platform:wasm32-unknown-unknown", "@rules_rust//rust/platform:wasm32-wasi", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", "@rules_rust//rust/platform:x86_64-fuchsia", "@rules_rust//rust/platform:x86_64-linux-android", "@rules_rust//rust/platform:x86_64-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-none"], + "cfg(all(target_arch = \"aarch64\", target_env = \"msvc\", not(windows_raw_dylib)))": ["@rules_rust//rust/platform:aarch64-pc-windows-msvc"], + "cfg(all(target_arch = \"x86\", target_env = \"gnu\", not(target_abi = \"llvm\"), not(windows_raw_dylib)))": ["@rules_rust//rust/platform:i686-unknown-linux-gnu"], + "cfg(all(target_arch = \"x86\", target_env = \"msvc\", not(windows_raw_dylib)))": ["@rules_rust//rust/platform:i686-pc-windows-msvc"], + "cfg(all(target_arch = \"x86_64\", target_env = \"gnu\", not(target_abi = \"llvm\"), not(windows_raw_dylib)))": ["@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "cfg(any())": [], + "cfg(any(target_arch = \"s390x\", target_arch = \"riscv64\"))": ["@rules_rust//rust/platform:riscv64gc-unknown-none-elf", "@rules_rust//rust/platform:s390x-unknown-linux-gnu"], + "cfg(any(target_os = \"linux\", target_os = \"macos\", target_os = \"freebsd\", target_os = \"android\"))": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-linux-android", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-linux-androideabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:i686-linux-android", "@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-linux-android", "@rules_rust//rust/platform:x86_64-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "cfg(any(target_os = \"macos\", target_os = \"ios\"))": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-apple-ios-sim", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios"], + "cfg(any(unix, target_os = \"wasi\"))": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-apple-ios-sim", "@rules_rust//rust/platform:aarch64-fuchsia", "@rules_rust//rust/platform:aarch64-linux-android", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-linux-androideabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:i686-linux-android", "@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:wasm32-wasi", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", "@rules_rust//rust/platform:x86_64-fuchsia", "@rules_rust//rust/platform:x86_64-linux-android", "@rules_rust//rust/platform:x86_64-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "cfg(not(all(target_arch = \"arm\", target_os = \"none\")))": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-apple-ios-sim", "@rules_rust//rust/platform:aarch64-fuchsia", "@rules_rust//rust/platform:aarch64-linux-android", "@rules_rust//rust/platform:aarch64-pc-windows-msvc", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-linux-androideabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:i686-linux-android", "@rules_rust//rust/platform:i686-pc-windows-msvc", "@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:riscv32imc-unknown-none-elf", "@rules_rust//rust/platform:riscv64gc-unknown-none-elf", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:wasm32-unknown-unknown", "@rules_rust//rust/platform:wasm32-wasi", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", "@rules_rust//rust/platform:x86_64-fuchsia", "@rules_rust//rust/platform:x86_64-linux-android", "@rules_rust//rust/platform:x86_64-pc-windows-msvc", "@rules_rust//rust/platform:x86_64-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu", "@rules_rust//rust/platform:x86_64-unknown-none"], + "cfg(target_arch = \"s390x\")": ["@rules_rust//rust/platform:s390x-unknown-linux-gnu"], + "cfg(target_os = \"hermit\")": [], + "cfg(target_os = \"linux\")": ["@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "cfg(target_os = \"macos\")": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-darwin"], + "cfg(target_os = \"wasi\")": ["@rules_rust//rust/platform:wasm32-wasi"], + "cfg(target_os = \"windows\")": ["@rules_rust//rust/platform:aarch64-pc-windows-msvc", "@rules_rust//rust/platform:i686-pc-windows-msvc", "@rules_rust//rust/platform:x86_64-pc-windows-msvc"], + "cfg(unix)": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-apple-ios-sim", "@rules_rust//rust/platform:aarch64-fuchsia", "@rules_rust//rust/platform:aarch64-linux-android", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-linux-androideabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:i686-linux-android", "@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", "@rules_rust//rust/platform:x86_64-fuchsia", "@rules_rust//rust/platform:x86_64-linux-android", "@rules_rust//rust/platform:x86_64-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "cfg(windows)": ["@rules_rust//rust/platform:aarch64-pc-windows-msvc", "@rules_rust//rust/platform:i686-pc-windows-msvc", "@rules_rust//rust/platform:x86_64-pc-windows-msvc"], + "i686-apple-darwin": ["@rules_rust//rust/platform:i686-apple-darwin"], + "i686-linux-android": ["@rules_rust//rust/platform:i686-linux-android"], + "i686-pc-windows-gnullvm": [], + "i686-pc-windows-msvc": ["@rules_rust//rust/platform:i686-pc-windows-msvc"], + "i686-unknown-freebsd": ["@rules_rust//rust/platform:i686-unknown-freebsd"], + "i686-unknown-linux-gnu": ["@rules_rust//rust/platform:i686-unknown-linux-gnu"], + "powerpc-unknown-linux-gnu": ["@rules_rust//rust/platform:powerpc-unknown-linux-gnu"], + "riscv32imc-unknown-none-elf": ["@rules_rust//rust/platform:riscv32imc-unknown-none-elf"], + "riscv64gc-unknown-none-elf": ["@rules_rust//rust/platform:riscv64gc-unknown-none-elf"], + "s390x-unknown-linux-gnu": ["@rules_rust//rust/platform:s390x-unknown-linux-gnu"], + "thumbv7em-none-eabi": ["@rules_rust//rust/platform:thumbv7em-none-eabi"], + "thumbv8m.main-none-eabi": ["@rules_rust//rust/platform:thumbv8m.main-none-eabi"], + "wasm32-unknown-unknown": ["@rules_rust//rust/platform:wasm32-unknown-unknown"], + "wasm32-wasi": ["@rules_rust//rust/platform:wasm32-wasi"], + "x86_64-apple-darwin": ["@rules_rust//rust/platform:x86_64-apple-darwin"], + "x86_64-apple-ios": ["@rules_rust//rust/platform:x86_64-apple-ios"], + "x86_64-fuchsia": ["@rules_rust//rust/platform:x86_64-fuchsia"], + "x86_64-linux-android": ["@rules_rust//rust/platform:x86_64-linux-android"], + "x86_64-pc-windows-gnullvm": [], + "x86_64-pc-windows-msvc": ["@rules_rust//rust/platform:x86_64-pc-windows-msvc"], + "x86_64-unknown-freebsd": ["@rules_rust//rust/platform:x86_64-unknown-freebsd"], + "x86_64-unknown-linux-gnu": ["@rules_rust//rust/platform:x86_64-unknown-linux-gnu"], + "x86_64-unknown-nixos-gnu": ["@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "x86_64-unknown-none": ["@rules_rust//rust/platform:x86_64-unknown-none"], +} + +############################################################################### + +def crate_repositories(): + """A macro for defining repositories for all generated crates. + + Returns: + A list of repos visible to the module through the module extension. + """ + maybe( + http_archive, + name = "cu__ahash-0.8.11", + sha256 = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011", + type = "tar.gz", + urls = ["https://static.crates.io/crates/ahash/0.8.11/download"], + strip_prefix = "ahash-0.8.11", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.ahash-0.8.11.bazel"), + ) + + maybe( + http_archive, + name = "cu__aho-corasick-1.1.3", + sha256 = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916", + type = "tar.gz", + urls = ["https://static.crates.io/crates/aho-corasick/1.1.3/download"], + strip_prefix = "aho-corasick-1.1.3", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.aho-corasick-1.1.3.bazel"), + ) + + maybe( + http_archive, + name = "cu__anyhow-1.0.86", + sha256 = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da", + type = "tar.gz", + urls = ["https://static.crates.io/crates/anyhow/1.0.86/download"], + strip_prefix = "anyhow-1.0.86", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.anyhow-1.0.86.bazel"), + ) + + maybe( + http_archive, + name = "cu__arbitrary-1.3.2", + sha256 = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110", + type = "tar.gz", + urls = ["https://static.crates.io/crates/arbitrary/1.3.2/download"], + strip_prefix = "arbitrary-1.3.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.arbitrary-1.3.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__bitflags-2.6.0", + sha256 = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de", + type = "tar.gz", + urls = ["https://static.crates.io/crates/bitflags/2.6.0/download"], + strip_prefix = "bitflags-2.6.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.bitflags-2.6.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__bumpalo-3.16.0", + sha256 = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c", + type = "tar.gz", + urls = ["https://static.crates.io/crates/bumpalo/3.16.0/download"], + strip_prefix = "bumpalo-3.16.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.bumpalo-3.16.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cc-1.1.7", + sha256 = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cc/1.1.7/download"], + strip_prefix = "cc-1.1.7", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cc-1.1.7.bazel"), + ) + + maybe( + http_archive, + name = "cu__cfg-if-1.0.0", + sha256 = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cfg-if/1.0.0/download"], + strip_prefix = "cfg-if-1.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cfg-if-1.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cobs-0.2.3", + sha256 = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cobs/0.2.3/download"], + strip_prefix = "cobs-0.2.3", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cobs-0.2.3.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-bforest-0.111.0", + sha256 = "b80c3a50b9c4c7e5b5f73c0ed746687774fc9e36ef652b110da8daebf0c6e0e6", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-bforest/0.111.0/download"], + strip_prefix = "cranelift-bforest-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-bforest-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-bitset-0.111.0", + sha256 = "38778758c2ca918b05acb2199134e0c561fb577c50574259b26190b6c2d95ded", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-bitset/0.111.0/download"], + strip_prefix = "cranelift-bitset-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-bitset-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-codegen-0.111.0", + sha256 = "58258667ad10e468bfc13a8d620f50dfcd4bb35d668123e97defa2549b9ad397", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-codegen/0.111.0/download"], + strip_prefix = "cranelift-codegen-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-codegen-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-codegen-meta-0.111.0", + sha256 = "043f0b702e529dcb07ff92bd7d40e7d5317b5493595172c5eb0983343751ee06", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-codegen-meta/0.111.0/download"], + strip_prefix = "cranelift-codegen-meta-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-codegen-meta-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-codegen-shared-0.111.0", + sha256 = "7763578888ab53eca5ce7da141953f828e82c2bfadcffc106d10d1866094ffbb", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-codegen-shared/0.111.0/download"], + strip_prefix = "cranelift-codegen-shared-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-codegen-shared-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-control-0.111.0", + sha256 = "32db15f08c05df570f11e8ab33cb1ec449a64b37c8a3498377b77650bef33d8b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-control/0.111.0/download"], + strip_prefix = "cranelift-control-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-control-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-entity-0.111.0", + sha256 = "5289cdb399381a27e7bbfa1b42185916007c3d49aeef70b1d01cb4caa8010130", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-entity/0.111.0/download"], + strip_prefix = "cranelift-entity-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-entity-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-frontend-0.111.0", + sha256 = "31ba8ab24eb9470477e98ddfa3c799a649ac5a0d9a2042868c4c952133c234e8", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-frontend/0.111.0/download"], + strip_prefix = "cranelift-frontend-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-frontend-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-isle-0.111.0", + sha256 = "2b72a3c5c166a70426dcb209bdd0bb71a787c1ea76023dc0974fbabca770e8f9", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-isle/0.111.0/download"], + strip_prefix = "cranelift-isle-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-isle-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-native-0.111.0", + sha256 = "46a42424c956bbc31fc5c2706073df896156c5420ae8fa2a5d48dbc7b295d71b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-native/0.111.0/download"], + strip_prefix = "cranelift-native-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-native-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__cranelift-wasm-0.111.0", + sha256 = "49778df4289933d735b93c30a345513e030cf83101de0036e19b760f8aa09f68", + type = "tar.gz", + urls = ["https://static.crates.io/crates/cranelift-wasm/0.111.0/download"], + strip_prefix = "cranelift-wasm-0.111.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.cranelift-wasm-0.111.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__crc32fast-1.4.2", + sha256 = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3", + type = "tar.gz", + urls = ["https://static.crates.io/crates/crc32fast/1.4.2/download"], + strip_prefix = "crc32fast-1.4.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.crc32fast-1.4.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__either-1.13.0", + sha256 = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0", + type = "tar.gz", + urls = ["https://static.crates.io/crates/either/1.13.0/download"], + strip_prefix = "either-1.13.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.either-1.13.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__embedded-io-0.4.0", + sha256 = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced", + type = "tar.gz", + urls = ["https://static.crates.io/crates/embedded-io/0.4.0/download"], + strip_prefix = "embedded-io-0.4.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.embedded-io-0.4.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__env_logger-0.10.2", + sha256 = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580", + type = "tar.gz", + urls = ["https://static.crates.io/crates/env_logger/0.10.2/download"], + strip_prefix = "env_logger-0.10.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.env_logger-0.10.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__equivalent-1.0.1", + sha256 = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5", + type = "tar.gz", + urls = ["https://static.crates.io/crates/equivalent/1.0.1/download"], + strip_prefix = "equivalent-1.0.1", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.equivalent-1.0.1.bazel"), + ) + + maybe( + http_archive, + name = "cu__errno-0.3.9", + sha256 = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba", + type = "tar.gz", + urls = ["https://static.crates.io/crates/errno/0.3.9/download"], + strip_prefix = "errno-0.3.9", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.errno-0.3.9.bazel"), + ) + + maybe( + http_archive, + name = "cu__fallible-iterator-0.3.0", + sha256 = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649", + type = "tar.gz", + urls = ["https://static.crates.io/crates/fallible-iterator/0.3.0/download"], + strip_prefix = "fallible-iterator-0.3.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.fallible-iterator-0.3.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__gimli-0.29.0", + sha256 = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd", + type = "tar.gz", + urls = ["https://static.crates.io/crates/gimli/0.29.0/download"], + strip_prefix = "gimli-0.29.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.gimli-0.29.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__hashbrown-0.13.2", + sha256 = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e", + type = "tar.gz", + urls = ["https://static.crates.io/crates/hashbrown/0.13.2/download"], + strip_prefix = "hashbrown-0.13.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.hashbrown-0.13.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__hashbrown-0.14.5", + sha256 = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1", + type = "tar.gz", + urls = ["https://static.crates.io/crates/hashbrown/0.14.5/download"], + strip_prefix = "hashbrown-0.14.5", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.hashbrown-0.14.5.bazel"), + ) + + maybe( + http_archive, + name = "cu__heck-0.4.1", + sha256 = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8", + type = "tar.gz", + urls = ["https://static.crates.io/crates/heck/0.4.1/download"], + strip_prefix = "heck-0.4.1", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.heck-0.4.1.bazel"), + ) + + maybe( + http_archive, + name = "cu__hermit-abi-0.3.9", + sha256 = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024", + type = "tar.gz", + urls = ["https://static.crates.io/crates/hermit-abi/0.3.9/download"], + strip_prefix = "hermit-abi-0.3.9", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.hermit-abi-0.3.9.bazel"), + ) + + maybe( + http_archive, + name = "cu__humantime-2.1.0", + sha256 = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4", + type = "tar.gz", + urls = ["https://static.crates.io/crates/humantime/2.1.0/download"], + strip_prefix = "humantime-2.1.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.humantime-2.1.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__id-arena-2.2.1", + sha256 = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005", + type = "tar.gz", + urls = ["https://static.crates.io/crates/id-arena/2.2.1/download"], + strip_prefix = "id-arena-2.2.1", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.id-arena-2.2.1.bazel"), + ) + + maybe( + http_archive, + name = "cu__indexmap-2.3.0", + sha256 = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0", + type = "tar.gz", + urls = ["https://static.crates.io/crates/indexmap/2.3.0/download"], + strip_prefix = "indexmap-2.3.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.indexmap-2.3.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__is-terminal-0.4.12", + sha256 = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/is-terminal/0.4.12/download"], + strip_prefix = "is-terminal-0.4.12", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.is-terminal-0.4.12.bazel"), + ) + + maybe( + http_archive, + name = "cu__itertools-0.12.1", + sha256 = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569", + type = "tar.gz", + urls = ["https://static.crates.io/crates/itertools/0.12.1/download"], + strip_prefix = "itertools-0.12.1", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.itertools-0.12.1.bazel"), + ) + + maybe( + http_archive, + name = "cu__itoa-1.0.11", + sha256 = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/itoa/1.0.11/download"], + strip_prefix = "itoa-1.0.11", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.itoa-1.0.11.bazel"), + ) + + maybe( + http_archive, + name = "cu__leb128-0.2.5", + sha256 = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67", + type = "tar.gz", + urls = ["https://static.crates.io/crates/leb128/0.2.5/download"], + strip_prefix = "leb128-0.2.5", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.leb128-0.2.5.bazel"), + ) + + maybe( + http_archive, + name = "cu__libc-0.2.155", + sha256 = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c", + type = "tar.gz", + urls = ["https://static.crates.io/crates/libc/0.2.155/download"], + strip_prefix = "libc-0.2.155", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.libc-0.2.155.bazel"), + ) + + maybe( + http_archive, + name = "cu__libm-0.2.8", + sha256 = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058", + type = "tar.gz", + urls = ["https://static.crates.io/crates/libm/0.2.8/download"], + strip_prefix = "libm-0.2.8", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.libm-0.2.8.bazel"), + ) + + maybe( + http_archive, + name = "cu__linux-raw-sys-0.4.14", + sha256 = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89", + type = "tar.gz", + urls = ["https://static.crates.io/crates/linux-raw-sys/0.4.14/download"], + strip_prefix = "linux-raw-sys-0.4.14", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.linux-raw-sys-0.4.14.bazel"), + ) + + maybe( + http_archive, + name = "cu__log-0.4.22", + sha256 = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24", + type = "tar.gz", + urls = ["https://static.crates.io/crates/log/0.4.22/download"], + strip_prefix = "log-0.4.22", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.log-0.4.22.bazel"), + ) + + maybe( + http_archive, + name = "cu__mach2-0.4.2", + sha256 = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709", + type = "tar.gz", + urls = ["https://static.crates.io/crates/mach2/0.4.2/download"], + strip_prefix = "mach2-0.4.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.mach2-0.4.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__memchr-2.7.4", + sha256 = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3", + type = "tar.gz", + urls = ["https://static.crates.io/crates/memchr/2.7.4/download"], + strip_prefix = "memchr-2.7.4", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.memchr-2.7.4.bazel"), + ) + + maybe( + http_archive, + name = "cu__memfd-0.6.4", + sha256 = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64", + type = "tar.gz", + urls = ["https://static.crates.io/crates/memfd/0.6.4/download"], + strip_prefix = "memfd-0.6.4", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.memfd-0.6.4.bazel"), + ) + + maybe( + http_archive, + name = "cu__object-0.36.2", + sha256 = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e", + type = "tar.gz", + urls = ["https://static.crates.io/crates/object/0.36.2/download"], + strip_prefix = "object-0.36.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.object-0.36.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__once_cell-1.19.0", + sha256 = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92", + type = "tar.gz", + urls = ["https://static.crates.io/crates/once_cell/1.19.0/download"], + strip_prefix = "once_cell-1.19.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.once_cell-1.19.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__paste-1.0.15", + sha256 = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a", + type = "tar.gz", + urls = ["https://static.crates.io/crates/paste/1.0.15/download"], + strip_prefix = "paste-1.0.15", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.paste-1.0.15.bazel"), + ) + + maybe( + http_archive, + name = "cu__pin-project-lite-0.2.14", + sha256 = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02", + type = "tar.gz", + urls = ["https://static.crates.io/crates/pin-project-lite/0.2.14/download"], + strip_prefix = "pin-project-lite-0.2.14", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.pin-project-lite-0.2.14.bazel"), + ) + + maybe( + http_archive, + name = "cu__postcard-1.0.8", + sha256 = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8", + type = "tar.gz", + urls = ["https://static.crates.io/crates/postcard/1.0.8/download"], + strip_prefix = "postcard-1.0.8", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.postcard-1.0.8.bazel"), + ) + + maybe( + http_archive, + name = "cu__proc-macro2-1.0.86", + sha256 = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77", + type = "tar.gz", + urls = ["https://static.crates.io/crates/proc-macro2/1.0.86/download"], + strip_prefix = "proc-macro2-1.0.86", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.proc-macro2-1.0.86.bazel"), + ) + + maybe( + http_archive, + name = "cu__psm-0.1.21", + sha256 = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874", + type = "tar.gz", + urls = ["https://static.crates.io/crates/psm/0.1.21/download"], + strip_prefix = "psm-0.1.21", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.psm-0.1.21.bazel"), + ) + + maybe( + http_archive, + name = "cu__quote-1.0.36", + sha256 = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7", + type = "tar.gz", + urls = ["https://static.crates.io/crates/quote/1.0.36/download"], + strip_prefix = "quote-1.0.36", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.quote-1.0.36.bazel"), + ) + + maybe( + http_archive, + name = "cu__regalloc2-0.9.3", + sha256 = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6", + type = "tar.gz", + urls = ["https://static.crates.io/crates/regalloc2/0.9.3/download"], + strip_prefix = "regalloc2-0.9.3", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.regalloc2-0.9.3.bazel"), + ) + + maybe( + http_archive, + name = "cu__regex-1.10.5", + sha256 = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f", + type = "tar.gz", + urls = ["https://static.crates.io/crates/regex/1.10.5/download"], + strip_prefix = "regex-1.10.5", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.regex-1.10.5.bazel"), + ) + + maybe( + http_archive, + name = "cu__regex-automata-0.4.7", + sha256 = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df", + type = "tar.gz", + urls = ["https://static.crates.io/crates/regex-automata/0.4.7/download"], + strip_prefix = "regex-automata-0.4.7", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.regex-automata-0.4.7.bazel"), + ) + + maybe( + http_archive, + name = "cu__regex-syntax-0.8.4", + sha256 = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/regex-syntax/0.8.4/download"], + strip_prefix = "regex-syntax-0.8.4", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.regex-syntax-0.8.4.bazel"), + ) + + maybe( + http_archive, + name = "cu__rustc-hash-1.1.0", + sha256 = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2", + type = "tar.gz", + urls = ["https://static.crates.io/crates/rustc-hash/1.1.0/download"], + strip_prefix = "rustc-hash-1.1.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.rustc-hash-1.1.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__rustix-0.38.34", + sha256 = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f", + type = "tar.gz", + urls = ["https://static.crates.io/crates/rustix/0.38.34/download"], + strip_prefix = "rustix-0.38.34", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.rustix-0.38.34.bazel"), + ) + + maybe( + http_archive, + name = "cu__ryu-1.0.18", + sha256 = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f", + type = "tar.gz", + urls = ["https://static.crates.io/crates/ryu/1.0.18/download"], + strip_prefix = "ryu-1.0.18", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.ryu-1.0.18.bazel"), + ) + + maybe( + http_archive, + name = "cu__semver-1.0.23", + sha256 = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/semver/1.0.23/download"], + strip_prefix = "semver-1.0.23", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.semver-1.0.23.bazel"), + ) + + maybe( + http_archive, + name = "cu__serde-1.0.204", + sha256 = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12", + type = "tar.gz", + urls = ["https://static.crates.io/crates/serde/1.0.204/download"], + strip_prefix = "serde-1.0.204", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.serde-1.0.204.bazel"), + ) + + maybe( + http_archive, + name = "cu__serde_derive-1.0.204", + sha256 = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222", + type = "tar.gz", + urls = ["https://static.crates.io/crates/serde_derive/1.0.204/download"], + strip_prefix = "serde_derive-1.0.204", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.serde_derive-1.0.204.bazel"), + ) + + maybe( + http_archive, + name = "cu__serde_json-1.0.120", + sha256 = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5", + type = "tar.gz", + urls = ["https://static.crates.io/crates/serde_json/1.0.120/download"], + strip_prefix = "serde_json-1.0.120", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.serde_json-1.0.120.bazel"), + ) + + maybe( + http_archive, + name = "cu__slice-group-by-0.3.1", + sha256 = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7", + type = "tar.gz", + urls = ["https://static.crates.io/crates/slice-group-by/0.3.1/download"], + strip_prefix = "slice-group-by-0.3.1", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.slice-group-by-0.3.1.bazel"), + ) + + maybe( + http_archive, + name = "cu__smallvec-1.13.2", + sha256 = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67", + type = "tar.gz", + urls = ["https://static.crates.io/crates/smallvec/1.13.2/download"], + strip_prefix = "smallvec-1.13.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.smallvec-1.13.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__sptr-0.3.2", + sha256 = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a", + type = "tar.gz", + urls = ["https://static.crates.io/crates/sptr/0.3.2/download"], + strip_prefix = "sptr-0.3.2", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.sptr-0.3.2.bazel"), + ) + + maybe( + http_archive, + name = "cu__stable_deref_trait-1.2.0", + sha256 = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3", + type = "tar.gz", + urls = ["https://static.crates.io/crates/stable_deref_trait/1.2.0/download"], + strip_prefix = "stable_deref_trait-1.2.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.stable_deref_trait-1.2.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__syn-2.0.72", + sha256 = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af", + type = "tar.gz", + urls = ["https://static.crates.io/crates/syn/2.0.72/download"], + strip_prefix = "syn-2.0.72", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.syn-2.0.72.bazel"), + ) + + maybe( + http_archive, + name = "cu__target-lexicon-0.12.16", + sha256 = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1", + type = "tar.gz", + urls = ["https://static.crates.io/crates/target-lexicon/0.12.16/download"], + strip_prefix = "target-lexicon-0.12.16", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.target-lexicon-0.12.16.bazel"), + ) + + maybe( + http_archive, + name = "cu__termcolor-1.4.1", + sha256 = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755", + type = "tar.gz", + urls = ["https://static.crates.io/crates/termcolor/1.4.1/download"], + strip_prefix = "termcolor-1.4.1", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.termcolor-1.4.1.bazel"), + ) + + maybe( + http_archive, + name = "cu__thiserror-1.0.63", + sha256 = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724", + type = "tar.gz", + urls = ["https://static.crates.io/crates/thiserror/1.0.63/download"], + strip_prefix = "thiserror-1.0.63", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.thiserror-1.0.63.bazel"), + ) + + maybe( + http_archive, + name = "cu__thiserror-impl-1.0.63", + sha256 = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261", + type = "tar.gz", + urls = ["https://static.crates.io/crates/thiserror-impl/1.0.63/download"], + strip_prefix = "thiserror-impl-1.0.63", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.thiserror-impl-1.0.63.bazel"), + ) + + maybe( + http_archive, + name = "cu__tracing-0.1.40", + sha256 = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef", + type = "tar.gz", + urls = ["https://static.crates.io/crates/tracing/0.1.40/download"], + strip_prefix = "tracing-0.1.40", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.tracing-0.1.40.bazel"), + ) + + maybe( + http_archive, + name = "cu__tracing-attributes-0.1.27", + sha256 = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7", + type = "tar.gz", + urls = ["https://static.crates.io/crates/tracing-attributes/0.1.27/download"], + strip_prefix = "tracing-attributes-0.1.27", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.tracing-attributes-0.1.27.bazel"), + ) + + maybe( + http_archive, + name = "cu__tracing-core-0.1.32", + sha256 = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54", + type = "tar.gz", + urls = ["https://static.crates.io/crates/tracing-core/0.1.32/download"], + strip_prefix = "tracing-core-0.1.32", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.tracing-core-0.1.32.bazel"), + ) + + maybe( + http_archive, + name = "cu__unicode-ident-1.0.12", + sha256 = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/unicode-ident/1.0.12/download"], + strip_prefix = "unicode-ident-1.0.12", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.unicode-ident-1.0.12.bazel"), + ) + + maybe( + http_archive, + name = "cu__unicode-xid-0.2.4", + sha256 = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c", + type = "tar.gz", + urls = ["https://static.crates.io/crates/unicode-xid/0.2.4/download"], + strip_prefix = "unicode-xid-0.2.4", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.unicode-xid-0.2.4.bazel"), + ) + + maybe( + http_archive, + name = "cu__version_check-0.9.5", + sha256 = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a", + type = "tar.gz", + urls = ["https://static.crates.io/crates/version_check/0.9.5/download"], + strip_prefix = "version_check-0.9.5", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.version_check-0.9.5.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasm-encoder-0.215.0", + sha256 = "4fb56df3e06b8e6b77e37d2969a50ba51281029a9aeb3855e76b7f49b6418847", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasm-encoder/0.215.0/download"], + strip_prefix = "wasm-encoder-0.215.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasm-encoder-0.215.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmparser-0.215.0", + sha256 = "53fbde0881f24199b81cf49b6ff8f9c145ac8eb1b7fc439adb5c099734f7d90e", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmparser/0.215.0/download"], + strip_prefix = "wasmparser-0.215.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmparser-0.215.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmprinter-0.215.0", + sha256 = "d8e9a325d85053408209b3d2ce5eaddd0dd6864d1cff7a007147ba073157defc", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmprinter/0.215.0/download"], + strip_prefix = "wasmprinter-0.215.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmprinter-0.215.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-24.0.0", + sha256 = "9a5883d64dfc8423c56e3d8df27cffc44db25336aa468e8e0724fddf30a333d7", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime/24.0.0/download"], + strip_prefix = "wasmtime-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-asm-macros-24.0.0", + sha256 = "1c4dc7e2a379c0dd6be5b55857d14c4b277f43a9c429a9e14403eb61776ae3be", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-asm-macros/24.0.0/download"], + strip_prefix = "wasmtime-asm-macros-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-asm-macros-24.0.0.bazel"), + ) + + maybe( + new_git_repository, + name = "cu__wasmtime-c-api-macros-24.0.0", + commit = "6fc3d274c7994dad20c816ccc0739bf766b39a11", + init_submodules = True, + remote = "https://github.com/bytecodealliance/wasmtime", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-c-api-macros-24.0.0.bazel"), + strip_prefix = "crates/c-api-macros", + ) + + maybe( + http_archive, + name = "cu__wasmtime-component-macro-24.0.0", + sha256 = "4b07773d1c3dab5f014ec61316ee317aa424033e17e70a63abdf7c3a47e58fcf", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-component-macro/24.0.0/download"], + strip_prefix = "wasmtime-component-macro-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-component-macro-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-component-util-24.0.0", + sha256 = "e38d735320f4e83478369ce649ad8fe87c6b893220902e798547a225fc0c5874", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-component-util/24.0.0/download"], + strip_prefix = "wasmtime-component-util-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-component-util-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-cranelift-24.0.0", + sha256 = "e570d831d0785d93d7d8c722b1eb9a34e0d0c1534317666f65892818358a2da9", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-cranelift/24.0.0/download"], + strip_prefix = "wasmtime-cranelift-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-cranelift-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-environ-24.0.0", + sha256 = "c5fe80dfbd81687431a7d4f25929fae1ae96894786d5c96b14ae41164ee97377", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-environ/24.0.0/download"], + strip_prefix = "wasmtime-environ-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-environ-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-jit-icache-coherence-24.0.0", + sha256 = "d15de8429db996f0d17a4163a35eccc3f874cbfb50f29c379951ea1bbb39452e", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-jit-icache-coherence/24.0.0/download"], + strip_prefix = "wasmtime-jit-icache-coherence-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-jit-icache-coherence-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-slab-24.0.0", + sha256 = "1f68d38fa6b30c5e1fc7d608263062997306f79e577ebd197ddcd6b0f55d87d1", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-slab/24.0.0/download"], + strip_prefix = "wasmtime-slab-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-slab-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-types-24.0.0", + sha256 = "6634e7079d9c5cfc81af8610ed59b488cc5b7f9777a2f4c1667a2565c2e45249", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-types/24.0.0/download"], + strip_prefix = "wasmtime-types-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-types-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-versioned-export-macros-24.0.0", + sha256 = "3850e3511d6c7f11a72d571890b0ed5f6204681f7f050b9de2690e7f13123fed", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-versioned-export-macros/24.0.0/download"], + strip_prefix = "wasmtime-versioned-export-macros-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-versioned-export-macros-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__wasmtime-wit-bindgen-24.0.0", + sha256 = "3cb331ac7ed1d5ba49cddcdb6b11973752a857148858bb308777d2fc5584121f", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wasmtime-wit-bindgen/24.0.0/download"], + strip_prefix = "wasmtime-wit-bindgen-24.0.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wasmtime-wit-bindgen-24.0.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__winapi-util-0.1.8", + sha256 = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/winapi-util/0.1.8/download"], + strip_prefix = "winapi-util-0.1.8", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.winapi-util-0.1.8.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows-sys-0.52.0", + sha256 = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows-sys/0.52.0/download"], + strip_prefix = "windows-sys-0.52.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows-sys-0.52.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows-targets-0.52.6", + sha256 = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows-targets/0.52.6/download"], + strip_prefix = "windows-targets-0.52.6", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows-targets-0.52.6.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows_aarch64_gnullvm-0.52.6", + sha256 = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows_aarch64_gnullvm/0.52.6/download"], + strip_prefix = "windows_aarch64_gnullvm-0.52.6", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows_aarch64_gnullvm-0.52.6.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows_aarch64_msvc-0.52.6", + sha256 = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows_aarch64_msvc/0.52.6/download"], + strip_prefix = "windows_aarch64_msvc-0.52.6", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows_aarch64_msvc-0.52.6.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows_i686_gnu-0.52.6", + sha256 = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows_i686_gnu/0.52.6/download"], + strip_prefix = "windows_i686_gnu-0.52.6", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows_i686_gnu-0.52.6.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows_i686_gnullvm-0.52.6", + sha256 = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows_i686_gnullvm/0.52.6/download"], + strip_prefix = "windows_i686_gnullvm-0.52.6", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows_i686_gnullvm-0.52.6.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows_i686_msvc-0.52.6", + sha256 = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows_i686_msvc/0.52.6/download"], + strip_prefix = "windows_i686_msvc-0.52.6", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows_i686_msvc-0.52.6.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows_x86_64_gnu-0.52.6", + sha256 = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows_x86_64_gnu/0.52.6/download"], + strip_prefix = "windows_x86_64_gnu-0.52.6", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows_x86_64_gnu-0.52.6.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows_x86_64_gnullvm-0.52.6", + sha256 = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows_x86_64_gnullvm/0.52.6/download"], + strip_prefix = "windows_x86_64_gnullvm-0.52.6", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows_x86_64_gnullvm-0.52.6.bazel"), + ) + + maybe( + http_archive, + name = "cu__windows_x86_64_msvc-0.52.6", + sha256 = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec", + type = "tar.gz", + urls = ["https://static.crates.io/crates/windows_x86_64_msvc/0.52.6/download"], + strip_prefix = "windows_x86_64_msvc-0.52.6", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.windows_x86_64_msvc-0.52.6.bazel"), + ) + + maybe( + http_archive, + name = "cu__wit-parser-0.215.0", + sha256 = "935a97eaffd57c3b413aa510f8f0b550a4a9fe7d59e79cd8b89a83dcb860321f", + type = "tar.gz", + urls = ["https://static.crates.io/crates/wit-parser/0.215.0/download"], + strip_prefix = "wit-parser-0.215.0", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.wit-parser-0.215.0.bazel"), + ) + + maybe( + http_archive, + name = "cu__zerocopy-0.7.35", + sha256 = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0", + type = "tar.gz", + urls = ["https://static.crates.io/crates/zerocopy/0.7.35/download"], + strip_prefix = "zerocopy-0.7.35", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.zerocopy-0.7.35.bazel"), + ) + + maybe( + http_archive, + name = "cu__zerocopy-derive-0.7.35", + sha256 = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e", + type = "tar.gz", + urls = ["https://static.crates.io/crates/zerocopy-derive/0.7.35/download"], + strip_prefix = "zerocopy-derive-0.7.35", + build_file = Label("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:BUILD.zerocopy-derive-0.7.35.bazel"), + ) + + return [ + struct(repo = "cu__anyhow-1.0.86", is_dev_dep = False), + struct(repo = "cu__env_logger-0.10.2", is_dev_dep = False), + struct(repo = "cu__log-0.4.22", is_dev_dep = False), + struct(repo = "cu__once_cell-1.19.0", is_dev_dep = False), + struct(repo = "cu__tracing-0.1.40", is_dev_dep = False), + struct(repo = "cu__wasmtime-24.0.0", is_dev_dep = False), + struct(repo = "cu__wasmtime-c-api-macros-24.0.0", is_dev_dep = False), + ] diff --git a/bazel/cc_defs.bzl b/bazel/cc_defs.bzl new file mode 100644 index 000000000..5951de438 --- /dev/null +++ b/bazel/cc_defs.bzl @@ -0,0 +1,22 @@ +# Copyright 2025 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("@rules_cc//cc:defs.bzl", _cc_test = "cc_test") +load("@rules_fuzzing//fuzzing:cc_defs.bzl", _cc_fuzz_test = "cc_fuzz_test") + +def cc_test(data = [], **kwargs): + _cc_test(data = data + ["//bazel:tsan_suppressions.txt"], **kwargs) + +def cc_fuzz_test(data = [], **kwargs): + _cc_fuzz_test(data = data + ["//bazel:tsan_suppressions.txt"], **kwargs) diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl index c325facfe..683fb9964 100644 --- a/bazel/dependencies.bzl +++ b/bazel/dependencies.bzl @@ -13,10 +13,91 @@ # limitations under the License. load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") -load("@proxy_wasm_cpp_host//bazel/cargo:crates.bzl", "proxy_wasm_cpp_host_fetch_remote_crates") -load("@rules_rust//rust:repositories.bzl", "rust_repositories") +load("@envoy_toolshed//sysroot:sysroot.bzl", "setup_sysroots") +load("@proxy_wasm_cpp_host//bazel/cargo/wasmsign/remote:crates.bzl", wasmsign_crate_repositories = "crate_repositories") +load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:crates.bzl", wasmtime_crate_repositories = "crate_repositories") +load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") +load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") +load("@rules_rust//rust:repositories.bzl", "rust_repositories", "rust_repository_set") +load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies") +load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain") def proxy_wasm_cpp_host_dependencies(): - protobuf_deps() + # Bazel extensions. + + py_repositories() + python_register_toolchains( + name = "python_3_9", + python_version = "3.9", + ignore_root_user_error = True, # for docker run + ) + rust_repositories() - proxy_wasm_cpp_host_fetch_remote_crates() + rust_repository_set( + name = "rust_linux_x86_64", + exec_triple = "x86_64-unknown-linux-gnu", + extra_target_triples = [ + "aarch64-unknown-linux-gnu", + "wasm32-unknown-unknown", + "wasm32-wasi", # TODO: Change to wasm32-wasip1 once https://github.com/bazelbuild/rules_rust/issues/2782 is fixed + ], + version = "1.77.2", + ) + rust_repository_set( + name = "rust_linux_s390x", + exec_triple = "s390x-unknown-linux-gnu", + extra_target_triples = [ + "wasm32-unknown-unknown", + "wasm32-wasi", + ], + version = "1.77.2", + ) + crate_universe_dependencies(bootstrap = True) + + setup_sysroots() + bazel_toolchain_dependencies() + llvm_toolchain( + name = "llvm_toolchain", + llvm_version = "19.1.0", + sha256 = { + "linux-x86_64": "cee77d641690466a193d9b88c89705de1c02bbad46bde6a3b126793c0a0f2923", + "linux-aarch64": "7bb54afd330fe1a1c2d4c593fa1e2dbe2abd9bf34fb3597994ff41e443cf144b", + "darwin-aarch64": "9da86f64a99f5ce9b679caf54e938736ca269c5e069d0c94ad08b995c5f25c16", + "darwin-x86_64": "264f2f1e8b67f066749349ae8b4943d346cd44e099464164ef21b42a57663540", + }, + strip_prefix = { + "linux-x86_64": "LLVM-19.1.0-Linux-X64", + "linux-aarch64": "clang+llvm-19.1.0-aarch64-linux-gnu", + "darwin-aarch64": "LLVM-19.1.0-macOS-ARM64", + "darwin-x86_64": "LLVM-19.1.0-macOS-X64", + }, + urls = { + "linux-x86_64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-Linux-X64.tar.xz"], + "linux-aarch64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/clang+llvm-19.1.0-aarch64-linux-gnu.tar.xz"], + "darwin-aarch64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-macOS-ARM64.tar.xz"], + "darwin-x86_64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-macOS-X64.tar.xz"], + }, + ) + + llvm_toolchain( + name = "llvm_aarch64", + llvm_version = "19.1.0", + toolchain_roots = { + "": "@llvm_toolchain_llvm//", + }, + sysroot = { + "linux-aarch64": "@sysroot_linux_arm64//:sysroot", + }, + ) + + # NullVM dependencies. + + protobuf_deps() + + # Wasmtime dependencies. + + wasmtime_crate_repositories() + + # Test dependencies. + + wasmsign_crate_repositories() diff --git a/bazel/dependencies_import.bzl b/bazel/dependencies_import.bzl new file mode 100644 index 000000000..e4cf5e879 --- /dev/null +++ b/bazel/dependencies_import.bzl @@ -0,0 +1,28 @@ +# Copyright 2024 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("@fuzzing_py_deps//:requirements.bzl", pip_fuzzing_dependencies = "install_deps") +load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") +load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") +load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies") +load("@v8_python_deps//:requirements.bzl", pip_v8_dependencies = "install_deps") + +def proxy_wasm_cpp_host_dependencies_import(): + llvm_register_toolchains() + + rules_foreign_cc_dependencies() + rules_fuzzing_dependencies() + + pip_fuzzing_dependencies() + pip_v8_dependencies() diff --git a/.github/workflows/cargo.yml b/bazel/dependencies_python.bzl similarity index 54% rename from .github/workflows/cargo.yml rename to bazel/dependencies_python.bzl index f56b3e97d..4207c79cf 100644 --- a/.github/workflows/cargo.yml +++ b/bazel/dependencies_python.bzl @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,32 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Cargo +load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init") +load("@rules_python//python:pip.bzl", "pip_parse") -on: - pull_request: - branches: - - master - paths: - - 'bazel/cargo/**' +def proxy_wasm_cpp_host_dependencies_python(): + # NOTE: this loads @fuzzing_py_deps via pip_parse + rules_fuzzing_init() - push: - branches: - - master - paths: - - 'bazel/cargo/**' - -jobs: - - format: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Format (cargo raze) - working-directory: bazel/cargo - run: | - cargo install cargo-raze --version 0.12.0 - cargo raze - git diff --exit-code + # V8 dependencies. + pip_parse( + name = "v8_python_deps", + extra_pip_args = ["--require-hashes"], + requirements_lock = "@v8//:bazel/requirements.txt", + ) diff --git a/bazel/external/BUILD b/bazel/external/BUILD index e69de29bb..6d6d1266c 100644 --- a/bazel/external/BUILD +++ b/bazel/external/BUILD @@ -0,0 +1,13 @@ +# Copyright 2022 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. diff --git a/bazel/external/Dockerfile.bazel b/bazel/external/Dockerfile.bazel new file mode 100644 index 000000000..9b16abeb3 --- /dev/null +++ b/bazel/external/Dockerfile.bazel @@ -0,0 +1,75 @@ +# syntax=docker/dockerfile:1 +# Copyright 2025 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. + + +# Prep: +# docker run --rm --privileged tonistiigi/binfmt --install all +# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes +# Need to see "F" flag: cat /proc/sys/fs/binfmt_misc/qemu-* +# +# Build: +# docker buildx build --platform linux/s390x -t $IMAGE -f Dockerfile.bazel +# +# Push: +# docker image tag $IMAGE ghcr.io/proxy-wasm/$IMAGE +# docker push ghcr.io/proxy-wasm/$IMAGE +# +# Test: +# docker run --rm --volume $(pwd):/mnt --workdir /mnt \ +# --platform linux/s390x $IMAGE \ +# bazel test --verbose_failures --test_output=errors \ +# --define engine=null --config=clang --test_timeout=1800 \ +# -- //test/... + +# Update base image +ARG UBUNTU_VERSION=22.04 +FROM ubuntu:${UBUNTU_VERSION} as build +RUN apt update && apt upgrade -y +RUN apt autoremove -y + +# Install Bazel deps +RUN apt install -y software-properties-common +RUN add-apt-repository ppa:openjdk-r/ppa +RUN apt install -y \ + build-essential \ + openjdk-11-jdk \ + python3 \ + curl \ + zip \ + unzip + +# Download Bazel source +ARG BAZEL_VERSION=6.5.0 +RUN cd ~ && mkdir bazel && cd bazel +RUN curl -LO https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip +RUN unzip -q bazel-${BAZEL_VERSION}-dist.zip + +# Build Bazel +# NOTE: This step is flaky and frequently hangs for multiarch / buildx. +# If it takes more than 2 hours, restart the Docker build and try again. +ENV EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" +RUN bash ./compile.sh + +# Copy output to /usr/bin +RUN cp /output/bazel /usr/bin/bazel + +# Install ProxyWasm build deps +RUN apt install -y \ + git \ + python3-distutils \ + clang \ + libstdc++6 \ + libssl-dev \ + libz-dev diff --git a/bazel/external/bazel_clang_tidy.patch b/bazel/external/bazel_clang_tidy.patch new file mode 100644 index 000000000..82711d83e --- /dev/null +++ b/bazel/external/bazel_clang_tidy.patch @@ -0,0 +1,16 @@ +# 1. Treat .h files as C++ headers. + +diff --git a/clang_tidy/clang_tidy.bzl b/clang_tidy/clang_tidy.bzl +index 3a5ed07..5db5c6c 100644 +--- a/clang_tidy/clang_tidy.bzl ++++ b/clang_tidy/clang_tidy.bzl +@@ -16,6 +16,9 @@ def _run_tidy(ctx, exe, flags, compilation_context, infile, discriminator): + # add source to check + args.add(infile.path) + ++ # treat .h files as C++ headers ++ args.add("--extra-arg-before=-xc++") ++ + # start args passed to the compiler + args.add("--") + diff --git a/bazel/external/dragonbox.BUILD b/bazel/external/dragonbox.BUILD new file mode 100644 index 000000000..00f3ee074 --- /dev/null +++ b/bazel/external/dragonbox.BUILD @@ -0,0 +1,26 @@ +# Copyright 2025 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("@rules_cc//cc:defs.bzl", "cc_library") + +licenses(["notice"]) # Apache 2 + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "dragonbox", + srcs = [], + hdrs = ["include/dragonbox/dragonbox.h"], + includes = ["include/"], +) diff --git a/bazel/external/fp16.BUILD b/bazel/external/fp16.BUILD new file mode 100644 index 000000000..f82146cff --- /dev/null +++ b/bazel/external/fp16.BUILD @@ -0,0 +1,29 @@ +# Copyright 2025 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("@rules_cc//cc:defs.bzl", "cc_library") + +licenses(["notice"]) # MIT + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "FP16", + hdrs = [ + "include/fp16.h", + "include/fp16/bitcasts.h", + "include/fp16/fp16.h", + ], + includes = ["include/"], +) diff --git a/bazel/external/googletest.patch b/bazel/external/googletest.patch new file mode 100644 index 000000000..502ef58b3 --- /dev/null +++ b/bazel/external/googletest.patch @@ -0,0 +1,13 @@ +diff --git a/BUILD.bazel b/BUILD.bazel +index 8099642a85..3598661079 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -40,7 +40,7 @@ exports_files(["LICENSE"]) + + config_setting( + name = "windows", +- constraint_values = ["@bazel_tools//platforms:windows"], ++ constraint_values = ["@platforms//os:windows"], + ) + + config_setting( diff --git a/bazel/external/intel_ittapi.BUILD b/bazel/external/intel_ittapi.BUILD new file mode 100644 index 000000000..cc867842f --- /dev/null +++ b/bazel/external/intel_ittapi.BUILD @@ -0,0 +1,35 @@ +# Copyright 2025 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("@rules_cc//cc:defs.bzl", "cc_library") + +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "lib_ittapi", + srcs = [ + "include/ittnotify.h", + "include/jitprofiling.h", + "src/ittnotify/ittnotify_config.h", + "src/ittnotify/jitprofiling.c", + ], + hdrs = [ + "include/ittnotify.h", + "src/ittnotify/ittnotify_types.h", + ], + includes = ["include/"], + visibility = ["//visibility:public"], +) diff --git a/bazel/external/llvm.BUILD b/bazel/external/llvm.BUILD index 2842cee45..9dccf5c98 100644 --- a/bazel/external/llvm.BUILD +++ b/bazel/external/llvm.BUILD @@ -1,3 +1,17 @@ +# Copyright 2025 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("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") licenses(["notice"]) # Apache 2 @@ -29,82 +43,83 @@ cmake( "LLVM_INCLUDE_TOOLS": "off", "LLVM_BUILD_UTILS": "off", "LLVM_INCLUDE_UTILS": "off", + "LLVM_ENABLE_IDE": "off", "LLVM_ENABLE_LIBEDIT": "off", "LLVM_ENABLE_LIBXML2": "off", "LLVM_ENABLE_TERMINFO": "off", "LLVM_ENABLE_ZLIB": "off", "LLVM_TARGETS_TO_BUILD": "X86", - # Workaround for the issue with statically linked libstdc++ - # using -l:libstdc++.a. - "CMAKE_CXX_FLAGS": "-lstdc++", - }, - env_vars = { - # Workaround for the -DDEBUG flag added in fastbuild on macOS, - # which conflicts with DEBUG macro used in LLVM. - "CFLAGS": "-UDEBUG", - "CXXFLAGS": "-UDEBUG", - "ASMFLAGS": "-UDEBUG", + "CMAKE_CXX_FLAGS": "-Wno-unused-command-line-argument", }, generate_args = ["-GNinja"], lib_source = ":srcs", out_static_libs = [ - "libLLVMInterpreter.a", "libLLVMWindowsManifest.a", + "libLLVMXRay.a", "libLLVMLibDriver.a", - "libLLVMObjectYAML.a", + "libLLVMDlltoolDriver.a", "libLLVMCoverage.a", "libLLVMLineEditor.a", - "libLLVMDlltoolDriver.a", - "libLLVMOption.a", - "libLLVMTableGen.a", - "libLLVMFuzzMutate.a", + "libLLVMX86Disassembler.a", + "libLLVMX86AsmParser.a", + "libLLVMX86CodeGen.a", + "libLLVMX86Desc.a", + "libLLVMX86Info.a", + "libLLVMOrcJIT.a", + "libLLVMMCJIT.a", + "libLLVMJITLink.a", + "libLLVMOrcTargetProcess.a", + "libLLVMOrcShared.a", + "libLLVMInterpreter.a", + "libLLVMExecutionEngine.a", + "libLLVMRuntimeDyld.a", "libLLVMSymbolize.a", - "libLLVMCoroutines.a", "libLLVMDebugInfoPDB.a", + "libLLVMDebugInfoGSYM.a", + "libLLVMOption.a", + "libLLVMObjectYAML.a", + "libLLVMMCA.a", + "libLLVMMCDisassembler.a", "libLLVMLTO.a", - "libLLVMObjCARCOpts.a", - "libLLVMMIRParser.a", - "libLLVMOrcJIT.a", - "libLLVMOrcError.a", - "libLLVMJITLink.a", "libLLVMPasses.a", + "libLLVMCFGuard.a", + "libLLVMCoroutines.a", + "libLLVMObjCARCOpts.a", + "libLLVMHelloNew.a", "libLLVMipo.a", - "libLLVMInstrumentation.a", "libLLVMVectorize.a", "libLLVMLinker.a", - "libLLVMIRReader.a", - "libLLVMAsmParser.a", - "libLLVMX86Disassembler.a", - "libLLVMX86AsmParser.a", - "libLLVMX86CodeGen.a", - "libLLVMCFGuard.a", + "libLLVMInstrumentation.a", + "libLLVMFrontendOpenMP.a", + "libLLVMFrontendOpenACC.a", + "libLLVMExtensions.a", + "libLLVMDWARFLinker.a", "libLLVMGlobalISel.a", - "libLLVMSelectionDAG.a", + "libLLVMMIRParser.a", "libLLVMAsmPrinter.a", "libLLVMDebugInfoDWARF.a", + "libLLVMSelectionDAG.a", "libLLVMCodeGen.a", + "libLLVMIRReader.a", + "libLLVMAsmParser.a", + "libLLVMInterfaceStub.a", + "libLLVMFileCheck.a", + "libLLVMFuzzMutate.a", + "libLLVMTarget.a", "libLLVMScalarOpts.a", "libLLVMInstCombine.a", "libLLVMAggressiveInstCombine.a", "libLLVMTransformUtils.a", "libLLVMBitWriter.a", - "libLLVMX86Desc.a", - "libLLVMMCDisassembler.a", - "libLLVMX86Utils.a", - "libLLVMX86Info.a", - "libLLVMMCJIT.a", - "libLLVMExecutionEngine.a", - "libLLVMTarget.a", "libLLVMAnalysis.a", "libLLVMProfileData.a", - "libLLVMRuntimeDyld.a", "libLLVMObject.a", "libLLVMTextAPI.a", "libLLVMMCParser.a", - "libLLVMBitReader.a", "libLLVMMC.a", "libLLVMDebugInfoCodeView.a", "libLLVMDebugInfoMSF.a", + "libLLVMBitReader.a", "libLLVMCore.a", "libLLVMRemarks.a", "libLLVMBitstreamReader.a", diff --git a/bazel/external/llvm.patch b/bazel/external/llvm.patch new file mode 100644 index 000000000..710d27427 --- /dev/null +++ b/bazel/external/llvm.patch @@ -0,0 +1,22 @@ +# Workaround for different linkers used in cmake()'s generate and build steps. +# See: https://github.com/bazelbuild/rules_foreign_cc/issues/863 + +diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake +index 5d4d692a70ac..0a2e441b1b94 100644 +--- a/cmake/modules/HandleLLVMOptions.cmake ++++ b/cmake/modules/HandleLLVMOptions.cmake +@@ -843,14 +843,6 @@ if (UNIX AND + append("-fdiagnostics-color" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + endif() + +-# lld doesn't print colored diagnostics when invoked from Ninja +-if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") +- include(CheckLinkerFlag) +- check_linker_flag("-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS) +- append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics" +- CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) +-endif() +- + # Add flags for add_dead_strip(). + # FIXME: With MSVS, consider compiling with /Gy and linking with /OPT:REF? + # But MinSizeRel seems to add that automatically, so maybe disable these diff --git a/bazel/external/rules_rust.patch b/bazel/external/rules_rust.patch new file mode 100644 index 000000000..a9a57c931 --- /dev/null +++ b/bazel/external/rules_rust.patch @@ -0,0 +1,15 @@ +# https://github.com/bazelbuild/rules_rust/pull/1315 + +diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl +index bfd96ed9..d7e38658 100644 +--- a/rust/private/rustc.bzl ++++ b/rust/private/rustc.bzl +@@ -1507,7 +1507,7 @@ def rustc_compile_action( + }) + crate_info = rust_common.create_crate_info(**crate_info_dict) + +- if crate_info.type in ["staticlib", "cdylib"]: ++ if crate_info.type in ["staticlib", "cdylib"] and not out_binary: + # These rules are not supposed to be depended on by other rust targets, and + # as such they shouldn't provide a CrateInfo. However, one may still want to + # write a rust_test for them, so we provide the CrateInfo wrapped in a provider diff --git a/bazel/external/simdutf.BUILD b/bazel/external/simdutf.BUILD new file mode 100644 index 000000000..834467e35 --- /dev/null +++ b/bazel/external/simdutf.BUILD @@ -0,0 +1,25 @@ +# Copyright 2025 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("@rules_cc//cc:defs.bzl", "cc_library") + +licenses(["notice"]) # Apache 2 + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "simdutf", + srcs = ["simdutf.cpp"], + hdrs = ["simdutf.h"], +) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch new file mode 100644 index 000000000..a124cf9a5 --- /dev/null +++ b/bazel/external/v8.patch @@ -0,0 +1,346 @@ +From bc2a85e39fd55879b9baed51429c08b27d5514c8 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 16:55:02 -0400 +Subject: [PATCH 1/7] Disable pointer compression + +Pointer compression limits the maximum number of WasmVMs. + +Signed-off-by: Matt Leon +--- + BUILD.bazel | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/BUILD.bazel b/BUILD.bazel +index 3f5a87d054e..0a693b7ee10 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -292,7 +292,7 @@ v8_int( + # If no explicit value for v8_enable_pointer_compression, we set it to 'none'. + v8_string( + name = "v8_enable_pointer_compression", +- default = "none", ++ default = "False", + ) + + # Default setting for v8_enable_pointer_compression. +-- +2.50.0.727.gbf7dc18ff4-goog + + +From 61898e9a63ac89a37261c081b84714cfc400a4b1 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 16:56:31 -0400 +Subject: [PATCH 2/7] Restore _allowlist_function_transition + +Reverts v8 commit b26554ec368e9553782012c96aa5e99b163eaff2, which removed use of +_allowlist_function_transition from v8 bazel/defs.bzl, since it is still required +by the version of Bazel we currently use (6.5.0). + +Signed-off-by: Matt Leon +--- + bazel/defs.bzl | 3 +++ + bazel/v8-non-pointer-compression.bzl | 11 +++++++++++ + 2 files changed, 14 insertions(+) + +diff --git a/bazel/defs.bzl b/bazel/defs.bzl +index 0539ea176ac..14d7ace5e59 100644 +--- a/bazel/defs.bzl ++++ b/bazel/defs.bzl +@@ -485,6 +485,9 @@ _v8_mksnapshot = rule( + cfg = "exec", + ), + "target_os": attr.string(mandatory = True), ++ "_allowlist_function_transition": attr.label( ++ default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ++ ), + "prefix": attr.string(mandatory = True), + "suffix": attr.string(mandatory = True), + }, +diff --git a/bazel/v8-non-pointer-compression.bzl b/bazel/v8-non-pointer-compression.bzl +index 8c929454840..57336154cf7 100644 +--- a/bazel/v8-non-pointer-compression.bzl ++++ b/bazel/v8-non-pointer-compression.bzl +@@ -47,6 +47,17 @@ v8_binary_non_pointer_compression = rule( + # Note specificaly how it's configured with v8_target_cpu_transition, which + # ensures that setting propagates down the graph. + "binary": attr.label(cfg = v8_disable_pointer_compression), ++ # This is a stock Bazel requirement for any rule that uses Starlark ++ # transitions. It's okay to copy the below verbatim for all such rules. ++ # ++ # The purpose of this requirement is to give the ability to restrict ++ # which packages can invoke these rules, since Starlark transitions ++ # make much larger graphs possible that can have memory and performance ++ # consequences for your build. The whitelist defaults to "everything". ++ # But you can redefine it more strictly if you feel that's prudent. ++ "_allowlist_function_transition": attr.label( ++ default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ++ ), + }, + # Making this executable means it works with "$ bazel run". + executable = True, +-- +2.50.0.727.gbf7dc18ff4-goog + + +From 4a6e7158fd4ca48c75c8e33ea15760c9beea1d2f Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 16:56:52 -0400 +Subject: [PATCH 3/7] Don't expose Wasm C API (only Wasm C++ API). + +Signed-off-by: Matt Leon +--- + src/wasm/c-api.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc +index 05e4029f183..d705be96a16 100644 +--- a/src/wasm/c-api.cc ++++ b/src/wasm/c-api.cc +@@ -2472,6 +2472,8 @@ WASM_EXPORT auto Instance::exports() const -> ownvec { + + } // namespace wasm + ++#if 0 ++ + // BEGIN FILE wasm-c.cc + + extern "C" { +@@ -3518,3 +3520,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) { + #undef WASM_DEFINE_SHARABLE_REF + + } // extern "C" ++ ++#endif +-- +2.50.0.727.gbf7dc18ff4-goog + + +From 7b593eb8086dcfe9012d4fa694d622f21dadb731 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 16:58:02 -0400 +Subject: [PATCH 4/7] Stub out fast_float for bazel-supplied version + +Signed-off-by: Matt Leon +--- + BUILD.bazel | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/BUILD.bazel b/BUILD.bazel +index 0a693b7ee10..eafd9dad20c 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -4438,7 +4438,7 @@ v8_library( + ], + deps = [ + ":lib_dragonbox", +- "//third_party/fast_float/src:fast_float", ++ "@fast_float//:fast_float", + ":lib_fp16", + ":simdutf", + ":v8_libbase", +-- +2.50.0.727.gbf7dc18ff4-goog + + +From b442d34b12dd513946f509d9db86839ce8aa4d7f Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 20:04:05 -0400 +Subject: [PATCH 5/7] Stub out vendored dependencies for bazel-sourced versions + +Signed-off-by: Matt Leon +--- + BUILD.bazel | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/BUILD.bazel b/BUILD.bazel +index eafd9dad20c..ce36666e36e 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -4437,10 +4437,10 @@ v8_library( + ":noicu/generated_torque_definitions", + ], + deps = [ +- ":lib_dragonbox", ++ "@dragonbox//:dragonbox", + "@fast_float//:fast_float", +- ":lib_fp16", +- ":simdutf", ++ "@fp16//:FP16", ++ "@simdutf//:simdutf", + ":v8_libbase", + "@abseil-cpp//absl/container:btree", + "@abseil-cpp//absl/container:flat_hash_map", +-- +2.50.0.727.gbf7dc18ff4-goog + + +From e0b8f32cc057a3c0875437d5d54d012cabcab458 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Wed, 16 Jul 2025 20:29:10 -0400 +Subject: [PATCH 6/7] Add build flags to make V8 compile with GCC + +Signed-off-by: Matt Leon +--- + bazel/defs.bzl | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/bazel/defs.bzl b/bazel/defs.bzl +index 14d7ace5e59..c7a48d4e805 100644 +--- a/bazel/defs.bzl ++++ b/bazel/defs.bzl +@@ -117,6 +117,9 @@ def _default_args(): + "-Wno-implicit-int-float-conversion", + "-Wno-deprecated-copy", + "-Wno-non-virtual-dtor", ++ "-Wno-invalid-offsetof", ++ "-Wno-dangling-pointer", ++ "-Wno-dangling-reference", + "-isystem .", + ], + "//conditions:default": [], +-- +2.50.0.727.gbf7dc18ff4-goog + + +From 7ce2d6bd14b338ab91a8636a8694b9ef180b2f90 Mon Sep 17 00:00:00 2001 +From: Matt Leon +Date: Fri, 18 Jul 2025 17:28:42 -0400 +Subject: [PATCH 7/7] Hack out atomic simd support in V8. + +Atomic simdutf requires __cpp_lib_atomic_ref >= 201806, which is only +supported in clang libc++ 19+. The version of LLVM used in Envoy as of +2025-07-18 is libc++ 18, so this is not supported. + +The simdutf documentation indicates this atomic form is not tested and +is not recommended for use: +https://github.com/simdutf/simdutf/blob/5d1b6248f29a8ed0eb90f79be268be41730e39f8/include/simdutf/implementation.h#L3066-L3068 + +In addition, this is in the implementation of a JS array buffer. Since +proxy-wasm-cpp-host does not make use of JS array buffers or shared +memory between web workers, we're stubbing it out. + +Mostly reverts +https://github.com/v8/v8/commit/6d6c1e680c7b8ea5f62a76e9c3d88d3fb0a88df0. + +Signed-off-by: Matt Leon +--- + bazel/defs.bzl | 2 +- + src/builtins/builtins-typed-array.cc | 8 ++++++++ + src/objects/simd.cc | 10 ++++++++++ + 3 files changed, 19 insertions(+), 1 deletion(-) + +diff --git a/bazel/defs.bzl b/bazel/defs.bzl +index c7a48d4e805..a73b3812882 100644 +--- a/bazel/defs.bzl ++++ b/bazel/defs.bzl +@@ -180,7 +180,7 @@ def _default_args(): + "Advapi32.lib", + ], + "@v8//bazel/config:is_macos": ["-pthread"], +- "//conditions:default": ["-Wl,--no-as-needed -ldl -latomic -pthread"], ++ "//conditions:default": ["-Wl,--no-as-needed -ldl -pthread"], + }) + select({ + ":should_add_rdynamic": ["-rdynamic"], + "//conditions:default": [], +diff --git a/src/builtins/builtins-typed-array.cc b/src/builtins/builtins-typed-array.cc +index 918cb873481..bc933e8dc1d 100644 +--- a/src/builtins/builtins-typed-array.cc ++++ b/src/builtins/builtins-typed-array.cc +@@ -520,17 +520,21 @@ simdutf::result ArrayBufferSetFromBase64( + DirectHandle typed_array, size_t& output_length) { + output_length = array_length; + simdutf::result simd_result; ++#ifdef WANT_ATOMIC_REF + if (typed_array->buffer()->is_shared()) { + simd_result = simdutf::atomic_base64_to_binary_safe( + reinterpret_cast(input_vector), input_length, + reinterpret_cast(typed_array->DataPtr()), output_length, + alphabet, last_chunk_handling, /*decode_up_to_bad_char*/ true); + } else { ++#endif + simd_result = simdutf::base64_to_binary_safe( + reinterpret_cast(input_vector), input_length, + reinterpret_cast(typed_array->DataPtr()), output_length, + alphabet, last_chunk_handling, /*decode_up_to_bad_char*/ true); ++#ifdef WANT_ATOMIC_REF + } ++#endif + + return simd_result; + } +@@ -833,15 +837,19 @@ BUILTIN(Uint8ArrayPrototypeToBase64) { + // 11. Return CodePointsToString(outAscii). + + size_t simd_result_size; ++#ifdef WANT_ATOMIC_REF + if (uint8array->buffer()->is_shared()) { + simd_result_size = simdutf::atomic_binary_to_base64( + std::bit_cast(uint8array->DataPtr()), length, + reinterpret_cast(output->GetChars(no_gc)), alphabet); + } else { ++#endif + simd_result_size = simdutf::binary_to_base64( + std::bit_cast(uint8array->DataPtr()), length, + reinterpret_cast(output->GetChars(no_gc)), alphabet); ++#ifdef WANT_ATOMIC_REF + } ++#endif + DCHECK_EQ(simd_result_size, output_length); + USE(simd_result_size); + } +diff --git a/src/objects/simd.cc b/src/objects/simd.cc +index 0ef570ceb7d..9217fa76072 100644 +--- a/src/objects/simd.cc ++++ b/src/objects/simd.cc +@@ -477,6 +477,7 @@ void Uint8ArrayToHexSlow(const char* bytes, size_t length, + } + } + ++#ifdef WANT_ATOMIC_REF + void AtomicUint8ArrayToHexSlow(const char* bytes, size_t length, + DirectHandle string_output) { + int index = 0; +@@ -492,6 +493,7 @@ void AtomicUint8ArrayToHexSlow(const char* bytes, size_t length, + index += 2; + } + } ++#endif + + inline uint16_t ByteToHex(uint8_t byte) { + const uint16_t correction = (('a' - '0' - 10) << 8) + ('a' - '0' - 10); +@@ -645,11 +647,15 @@ Tagged Uint8ArrayToHex(const char* bytes, size_t length, bool is_shared, + } + #endif + ++#ifdef WANT_ATOMIC_REF + if (is_shared) { + AtomicUint8ArrayToHexSlow(bytes, length, string_output); + } else { ++#endif + Uint8ArrayToHexSlow(bytes, length, string_output); ++#ifdef WANT_ATOMIC_REF + } ++#endif + return *string_output; + } + +@@ -1082,12 +1088,16 @@ bool ArrayBufferFromHex(const base::Vector& input_vector, bool is_shared, + for (uint32_t i = 0; i < output_length * 2; i += 2) { + result = HandleRemainingHexValues(input_vector, i); + if (result.has_value()) { ++#ifdef WANT_ATOMIC_REF + if (is_shared) { + std::atomic_ref(buffer[index++]) + .store(result.value(), std::memory_order_relaxed); + } else { ++#endif + buffer[index++] = result.value(); ++#ifdef WANT_ATOMIC_REF + } ++#endif + } else { + return false; + } +-- +2.50.0.727.gbf7dc18ff4-goog + diff --git a/bazel/external/wamr.BUILD b/bazel/external/wamr.BUILD index 0b0df722f..a3375e2cb 100644 --- a/bazel/external/wamr.BUILD +++ b/bazel/external/wamr.BUILD @@ -1,3 +1,17 @@ +# Copyright 2025 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("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") licenses(["notice"]) # Apache 2 @@ -11,20 +25,53 @@ filegroup( cmake( name = "wamr_lib", - cache_entries = { - "LLVM_DIR": "$EXT_BUILD_DEPS/copy_llvm/llvm/lib/cmake/llvm", - "WAMR_BUILD_INTERP": "1", - "WAMR_BUILD_JIT": "0", - "WAMR_BUILD_AOT": "0", - "WAMR_BUILD_SIMD": "0", - "WAMR_BUILD_MULTI_MODULE": "1", - "WAMR_BUILD_LIBC_WASI": "0", - "WAMR_BUILD_TAIL_CALL": "1", - }, - generate_args = ["-GNinja"], + generate_args = [ + # disable WASI + "-DWAMR_BUILD_LIBC_WASI=0", + "-DWAMR_BUILD_LIBC_BUILTIN=0", + # MVP + "-DWAMR_BUILD_BULK_MEMORY=1", + "-DWAMR_BUILD_REF_TYPES=1", + "-DWAMR_BUILD_TAIL_CALL=1", + # WAMR private features + "-DWAMR_BUILD_MULTI_MODULE=0", + # Some tests have indicated that the following three factors have + # a minimal impact on performance. + # - Get function names from name section + "-DWAMR_BUILD_CUSTOM_NAME_SECTION=1", + "-DWAMR_BUILD_LOAD_CUSTOM_SECTION=1", + # - Show Wasm call stack if met a trap + "-DWAMR_BUILD_DUMP_CALL_STACK=1", + # Cache module files + "-DWAMR_BUILD_WASM_CACHE=0", + "-GNinja", + ] + select({ + "@proxy_wasm_cpp_host//bazel:engine_wamr_jit": [ + "-DLLVM_DIR=$EXT_BUILD_DEPS/copy_llvm-15_0_7/llvm/lib/cmake/llvm", + "-DWAMR_BUILD_AOT=1", + "-DWAMR_BUILD_FAST_INTERP=0", + "-DWAMR_BUILD_INTERP=0", + "-DWAMR_BUILD_JIT=1", + "-DWAMR_BUILD_SIMD=1", + # linux perf. only for jit and aot + # "-DWAMR_BUILD_LINUX_PERF=1", + ], + "//conditions:default": [ + "-DWAMR_BUILD_AOT=0", + "-DWAMR_BUILD_FAST_INTERP=1", + "-DWAMR_BUILD_INTERP=1", + "-DWAMR_BUILD_JIT=0", + "-DWAMR_BUILD_SIMD=0", + ], + }), lib_source = ":srcs", - out_static_libs = ["libvmlib.a"], - deps = [ - "@llvm//:llvm_lib", - ], + linkopts = select({ + "@proxy_wasm_cpp_host//bazel:engine_wamr_jit": ["-ldl"], + "//conditions:default": [], + }), + out_static_libs = ["libiwasm.a"], + deps = select({ + "@proxy_wasm_cpp_host//bazel:engine_wamr_jit": ["@llvm-15_0_7//:llvm_wamr_lib"], + "//conditions:default": [], + }), ) diff --git a/bazel/external/wamr_llvm.BUILD b/bazel/external/wamr_llvm.BUILD new file mode 100644 index 000000000..6fe496145 --- /dev/null +++ b/bazel/external/wamr_llvm.BUILD @@ -0,0 +1,147 @@ +# Copyright 2025 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("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") + +licenses(["notice"]) # Apache 2 + +package(default_visibility = ["//visibility:public"]) + +filegroup( + name = "srcs", + srcs = glob(["**"]), +) + +cmake( + name = "llvm_wamr_lib", + cache_entries = { + # Disable both: BUILD and INCLUDE, since some of the INCLUDE + # targets build code instead of only generating build files. + "LLVM_BUILD_BENCHMARKS": "off", + "LLVM_INCLUDE_BENCHMARKS": "off", + "LLVM_BUILD_DOCS": "off", + "LLVM_INCLUDE_DOCS": "off", + "LLVM_BUILD_EXAMPLES": "off", + "LLVM_INCLUDE_EXAMPLES": "off", + "LLVM_BUILD_TESTS": "off", + "LLVM_INCLUDE_TESTS": "off", + "LLVM_BUILD_TOOLS": "off", + "LLVM_INCLUDE_TOOLS": "off", + "LLVM_ENABLE_IDE": "off", + "LLVM_ENABLE_LIBEDIT": "off", + "LLVM_ENABLE_LIBXML2": "off", + "LLVM_ENABLE_TERMINFO": "off", + "LLVM_ENABLE_ZLIB": "off", + "LLVM_ENABLE_ZSTD": "off", + "LLVM_TARGETS_TO_BUILD": "X86", + "CMAKE_CXX_FLAGS": "-Wno-unused-command-line-argument", + }, + # `lld` doesn't work on MacOS + generate_args = select({ + "@platforms//os:linux": [ + "-GNinja", + "-DLLVM_USE_LINKER=lld", + ], + "//conditions:default": [ + "-GNinja", + ], + }), + lib_source = ":srcs", + out_data_dirs = [ + "bin", + "include", + "lib", + "libexec", + "share", + ], + out_static_libs = [ + # How to get the library list: + # build LLVM with "-DLLVM_INCLUDE_TOOLS=ON" + # cd bin and run "./llvm-config --libnames" + "libLLVMWindowsManifest.a", + "libLLVMXRay.a", + "libLLVMLibDriver.a", + "libLLVMDlltoolDriver.a", + "libLLVMCoverage.a", + "libLLVMLineEditor.a", + "libLLVMX86Disassembler.a", + "libLLVMX86AsmParser.a", + "libLLVMX86CodeGen.a", + "libLLVMX86Desc.a", + "libLLVMX86Info.a", + "libLLVMOrcJIT.a", + "libLLVMMCJIT.a", + "libLLVMJITLink.a", + "libLLVMInterpreter.a", + "libLLVMExecutionEngine.a", + "libLLVMRuntimeDyld.a", + "libLLVMOrcTargetProcess.a", + "libLLVMOrcShared.a", + "libLLVMDWP.a", + "libLLVMSymbolize.a", + "libLLVMDebugInfoPDB.a", + "libLLVMDebugInfoGSYM.a", + "libLLVMOption.a", + "libLLVMObjectYAML.a", + "libLLVMMCA.a", + "libLLVMMCDisassembler.a", + "libLLVMLTO.a", + "libLLVMPasses.a", + "libLLVMCFGuard.a", + "libLLVMCoroutines.a", + "libLLVMObjCARCOpts.a", + "libLLVMipo.a", + "libLLVMVectorize.a", + "libLLVMLinker.a", + "libLLVMInstrumentation.a", + "libLLVMFrontendOpenMP.a", + "libLLVMFrontendOpenACC.a", + "libLLVMExtensions.a", + "libLLVMDWARFLinker.a", + "libLLVMGlobalISel.a", + "libLLVMMIRParser.a", + "libLLVMAsmPrinter.a", + "libLLVMDebugInfoMSF.a", + "libLLVMDebugInfoDWARF.a", + "libLLVMSelectionDAG.a", + "libLLVMCodeGen.a", + "libLLVMIRReader.a", + "libLLVMAsmParser.a", + "libLLVMInterfaceStub.a", + "libLLVMFileCheck.a", + "libLLVMFuzzMutate.a", + "libLLVMTarget.a", + "libLLVMScalarOpts.a", + "libLLVMInstCombine.a", + "libLLVMAggressiveInstCombine.a", + "libLLVMTransformUtils.a", + "libLLVMBitWriter.a", + "libLLVMAnalysis.a", + "libLLVMProfileData.a", + "libLLVMObject.a", + "libLLVMTextAPI.a", + "libLLVMMCParser.a", + "libLLVMMC.a", + "libLLVMDebugInfoCodeView.a", + "libLLVMBitReader.a", + "libLLVMCore.a", + "libLLVMRemarks.a", + "libLLVMBitstreamReader.a", + "libLLVMBinaryFormat.a", + "libLLVMTableGen.a", + "libLLVMSupport.a", + "libLLVMDemangle.a", + ], + working_directory = "llvm", +) diff --git a/bazel/external/wasm-c-api.BUILD b/bazel/external/wasm-c-api.BUILD deleted file mode 100644 index 5d4be94f5..000000000 --- a/bazel/external/wasm-c-api.BUILD +++ /dev/null @@ -1,16 +0,0 @@ -load("@rules_cc//cc:defs.bzl", "cc_library") - -licenses(["notice"]) # Apache 2 - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "wasmtime_lib", - hdrs = [ - "include/wasm.h", - ], - include_prefix = "wasmtime", - deps = [ - "@com_github_bytecodealliance_wasmtime//:rust_c_api", - ], -) diff --git a/bazel/external/wasmedge.BUILD b/bazel/external/wasmedge.BUILD new file mode 100644 index 000000000..e8fba783e --- /dev/null +++ b/bazel/external/wasmedge.BUILD @@ -0,0 +1,41 @@ +# Copyright 2025 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("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") + +licenses(["notice"]) # Apache 2 + +package(default_visibility = ["//visibility:public"]) + +filegroup( + name = "srcs", + srcs = glob(["**"]), +) + +cmake( + name = "wasmedge_lib", + cache_entries = { + "WASMEDGE_BUILD_AOT_RUNTIME": "Off", + "WASMEDGE_BUILD_SHARED_LIB": "Off", + "WASMEDGE_BUILD_STATIC_LIB": "On", + "WASMEDGE_BUILD_TOOLS": "Off", + "WASMEDGE_FORCE_DISABLE_LTO": "On", + }, + env = { + "CXXFLAGS": "-Wno-error=dangling-reference -Wno-error=maybe-uninitialized -Wno-error=array-bounds= -Wno-error=deprecated-declarations -std=c++20", + }, + generate_args = ["-GNinja"], + lib_source = ":srcs", + out_static_libs = ["libwasmedge.a"], +) diff --git a/bazel/external/wasmtime.BUILD b/bazel/external/wasmtime.BUILD index d8afdff3a..f359d9361 100644 --- a/bazel/external/wasmtime.BUILD +++ b/bazel/external/wasmtime.BUILD @@ -1,33 +1,93 @@ +# Copyright 2025 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("@rules_cc//cc:defs.bzl", "cc_library") -load("@rules_rust//rust:rust.bzl", "rust_library") +load("@rules_rust//rust:defs.bzl", "rust_static_library") licenses(["notice"]) # Apache 2 package(default_visibility = ["//visibility:public"]) cc_library( - name = "helpers_lib", + name = "wasmtime_lib", + hdrs = [ + "crates/c-api/include/wasm.h", + ], + deps = [ + ":rust_c_api", + ], +) + +genrule( + name = "prefixed_wasmtime_c_api_headers", + srcs = [ + "crates/c-api/include/wasm.h", + ], + outs = [ + "crates/c-api/include/prefixed_wasm.h", + ], + cmd = """ + sed -e 's/\\ wasm_/\\ wasmtime_wasm_/g' \ + -e 's/\\*wasm_/\\*wasmtime_wasm_/g' \ + -e 's/(wasm_/(wasmtime_wasm_/g' \ + $(<) >$@ + """, +) + +genrule( + name = "prefixed_wasmtime_c_api_lib", + srcs = [ + ":rust_c_api", + ], + outs = [ + "prefixed_wasmtime_c_api.a", + ], + cmd = """ + for symbol in $$(nm -P $(<) 2>/dev/null | grep -E ^_?wasm_ | cut -d" " -f1); do + echo $$symbol | sed -r 's/^(_?)(wasm_[a-z_]+)$$/\\1\\2 \\1wasmtime_\\2/' >>prefixed + done + # This should be OBJCOPY, but bazel-zig-cc doesn't define it. + objcopy --redefine-syms=prefixed $(<) $@ + """, + toolchains = ["@bazel_tools//tools/cpp:current_cc_toolchain"], +) + +cc_library( + name = "prefixed_wasmtime_lib", srcs = [ - "crates/runtime/src/helpers.c", + ":prefixed_wasmtime_c_api_lib", + ], + hdrs = [ + ":prefixed_wasmtime_c_api_headers", ], - visibility = ["//visibility:private"], + linkstatic = 1, ) -rust_library( +rust_static_library( name = "rust_c_api", srcs = glob(["crates/c-api/src/**/*.rs"]), - crate_features = [], + crate_features = ["cranelift"], crate_root = "crates/c-api/src/lib.rs", - crate_type = "staticlib", - edition = "2018", + edition = "2021", proc_macro_deps = [ - "@proxy_wasm_cpp_host//bazel/cargo:wasmtime_c_api_macros", + "@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:wasmtime-c-api-macros", ], deps = [ - ":helpers_lib", - "@proxy_wasm_cpp_host//bazel/cargo:anyhow", - "@proxy_wasm_cpp_host//bazel/cargo:env_logger", - "@proxy_wasm_cpp_host//bazel/cargo:once_cell", - "@proxy_wasm_cpp_host//bazel/cargo:wasmtime", + "@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:anyhow", + "@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:env_logger", + "@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:once_cell", + # buildifier: leave-alone + "@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:wasmtime", ], ) diff --git a/bazel/external/wavm.BUILD b/bazel/external/wavm.BUILD deleted file mode 100644 index a87ece7c1..000000000 --- a/bazel/external/wavm.BUILD +++ /dev/null @@ -1,37 +0,0 @@ -load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") - -licenses(["notice"]) # Apache 2 - -package(default_visibility = ["//visibility:public"]) - -filegroup( - name = "srcs", - srcs = glob(["**"]), -) - -cmake( - name = "wavm_lib", - cache_entries = { - "LLVM_DIR": "$EXT_BUILD_DEPS/copy_llvm/llvm/lib/cmake/llvm", - "WAVM_ENABLE_STATIC_LINKING": "on", - "WAVM_ENABLE_RELEASE_ASSERTS": "on", - "WAVM_ENABLE_UNWIND": "on", - # Workaround for the issue with statically linked libstdc++ - # using -l:libstdc++.a. - "CMAKE_CXX_FLAGS": "-lstdc++ -Wno-unused-command-line-argument", - }, - env_vars = { - # Workaround for the -DDEBUG flag added in fastbuild on macOS, - # which conflicts with DEBUG macro used in LLVM. - "CFLAGS": "-UDEBUG", - "CXXFLAGS": "-UDEBUG", - "ASMFLAGS": "-UDEBUG", - }, - generate_args = ["-GNinja"], - lib_source = ":srcs", - out_static_libs = [ - "libWAVM.a", - "libWAVMUnwind.a", - ], - deps = ["@llvm//:llvm_lib"], -) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 29c0c82cb..09939a706 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -12,43 +12,266 @@ # See the License for the specific language governing permissions and # limitations under the License. +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def proxy_wasm_cpp_host_repositories(): - http_archive( - name = "proxy_wasm_cpp_sdk", - sha256 = "c57de2425b5c61d7f630c5061e319b4557ae1f1c7526e5a51c33dc1299471b08", - strip_prefix = "proxy-wasm-cpp-sdk-fd0be8405db25de0264bdb78fae3a82668c03782", - urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/fd0be8405db25de0264bdb78fae3a82668c03782.tar.gz"], + # Bazel extensions. + + # Update platforms for crate_universe. Can remove when we update Bazel version. + maybe( + http_archive, + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + ], + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", + ) + + maybe( + http_archive, + name = "bazel_skylib", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", + ], + sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d", + ) + + maybe( + http_archive, + name = "rules_cc", + sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", + strip_prefix = "rules_cc-0.0.9", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"], + ) + + maybe( + http_archive, + name = "bazel_clang_tidy", + sha256 = "6ed23cbff9423a30ef10becf57210a26d54fe198a211f4037d931c06f843c023", + strip_prefix = "bazel_clang_tidy-c2fe98cfec0430e78bff4169e9ca0a43123e4c99", + url = "https://github.com/erenon/bazel_clang_tidy/archive/c2fe98cfec0430e78bff4169e9ca0a43123e4c99.tar.gz", + patches = ["@proxy_wasm_cpp_host//bazel/external:bazel_clang_tidy.patch"], + patch_args = ["-p1"], + ) + + maybe( + http_archive, + name = "envoy_toolshed", + sha256 = "e2252e46e64417d5cedd9f1eb34a622bce5e13b43837e5fe051c83066b0a400b", + strip_prefix = "toolshed-bazel-bins-v0.1.13/bazel", + url = "https://github.com/envoyproxy/toolshed/archive/refs/tags/bazel-bins-v0.1.13.tar.gz", + ) + maybe( + http_archive, + name = "toolchains_llvm", + sha256 = "b7cd301ef7b0ece28d20d3e778697a5e3b81828393150bed04838c0c52963a01", + strip_prefix = "toolchains_llvm-0.10.3", + canonical_id = "v0.10.3", + url = "https://github.com/grailbio/bazel-toolchain/releases/download/0.10.3/toolchains_llvm-0.10.3.tar.gz", + ) + + maybe( + http_archive, + name = "rules_foreign_cc", + sha256 = "bcd0c5f46a49b85b384906daae41d277b3dc0ff27c7c752cc51e43048a58ec83", + strip_prefix = "rules_foreign_cc-0.7.1", + url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.7.1.tar.gz", + ) + + maybe( + http_archive, + name = "rules_fuzzing", + sha256 = "3ec0eee05b243552cc4a784b30323d088bf73cb2177ddda02c827e68981933f1", + strip_prefix = "rules_fuzzing-0.5.2", + urls = ["https://github.com/bazelbuild/rules_fuzzing/archive/v0.5.2.tar.gz"], ) - http_archive( + maybe( + http_archive, + name = "rules_python", + sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618", + strip_prefix = "rules_python-0.34.0", + url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz", + ) + + # Keep at 0.42 one because https://github.com/bazelbuild/rules_rust/issues/2665 + # manifests at 0.43 + maybe( + http_archive, + name = "rules_rust", + integrity = "sha256-JLN47ZcAbx9wEr5Jiib4HduZATGLiDgK7oUi/fvotzU=", + # NOTE: Update Rust version in bazel/dependencies.bzl. + url = "https://github.com/bazelbuild/rules_rust/releases/download/0.42.1/rules_rust-v0.42.1.tar.gz", + patches = ["@proxy_wasm_cpp_host//bazel/external:rules_rust.patch"], + patch_args = ["-p1"], + ) + + # Core deps. Keep them updated. + + # Note: we depend on Abseil via rules_fuzzing. Remove this pin when we update that. + # + # This is the latest LTS release, which picks up: + # - Build fix: https://github.com/abseil/abseil-cpp/pull/1187 + # - A bugfix found in local fuzzing: + # https://github.com/abseil/abseil-cpp/commit/e7858c73279d81cbc005d9c76a385ab535520635 + maybe( + http_archive, + name = "com_google_absl", + sha256 = "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc", + strip_prefix = "abseil-cpp-20240116.2", + urls = ["https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz"], + ) + + maybe( + http_archive, name = "boringssl", - sha256 = "bb55b0ed2f0cb548b5dce6a6b8307ce37f7f748eb9f1be6bfe2d266ff2b4d52b", - strip_prefix = "boringssl-2192bbc878822cf6ab5977d4257a1339453d9d39", - urls = ["https://github.com/google/boringssl/archive/2192bbc878822cf6ab5977d4257a1339453d9d39.tar.gz"], + # 2023-08-28 (master-with-bazel) + sha256 = "f1f421738e9ba39dd88daf8cf3096ddba9c53e2b6b41b32fff5a3ff82f4cd162", + strip_prefix = "boringssl-45cf810dbdbd767f09f8cb0b0fcccd342c39041f", + urls = ["https://github.com/google/boringssl/archive/45cf810dbdbd767f09f8cb0b0fcccd342c39041f.tar.gz"], ) - http_archive( + maybe( + http_archive, + name = "proxy_wasm_cpp_sdk", + sha256 = "26c4c0f9f645de7e789dc92f113d7352ee54ac43bb93ae3a8a22945f1ce71590", + strip_prefix = "proxy-wasm-cpp-sdk-7465dee8b2953beebff99f6dc3720ad0c79bab99", + urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/7465dee8b2953beebff99f6dc3720ad0c79bab99.tar.gz"], + ) + + # Compile DB dependencies. + maybe( + http_archive, + name = "bazel_compdb", + sha256 = "acd2a9eaf49272bb1480c67d99b82662f005b596a8c11739046a4220ec73c4da", + strip_prefix = "bazel-compilation-database-40864791135333e1446a04553b63cbe744d358d0", + url = "https://github.com/grailbio/bazel-compilation-database/archive/40864791135333e1446a04553b63cbe744d358d0.tar.gz", + ) + + # Test dependencies. + + maybe( + http_archive, name = "com_google_googletest", - sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", - strip_prefix = "googletest-release-1.10.0", - urls = ["https://github.com/google/googletest/archive/release-1.10.0.tar.gz"], + sha256 = "65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c", + strip_prefix = "googletest-1.17.0", + urls = ["https://github.com/google/googletest/releases/download/v1.17.0/googletest-1.17.0.tar.gz"], ) - http_archive( + # NullVM dependencies. + + maybe( + http_archive, name = "com_google_protobuf", sha256 = "77ad26d3f65222fd96ccc18b055632b0bfedf295cb748b712a98ba1ac0b704b2", strip_prefix = "protobuf-3.17.3", url = "https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz", ) - http_archive( + # V8 with dependencies. + + maybe( + git_repository, + name = "v8", + # 13.8.258.26 + commit = "de9d0f8b56ae61896e4d2ac577fc589efb14f87d", + remote = "https://chromium.googlesource.com/v8/v8", + shallow_since = "1752074621 -0400", + patches = [ + "@proxy_wasm_cpp_host//bazel/external:v8.patch", + ], + patch_args = ["-p1"], + patch_cmds = [ + "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/simdutf/simdutf.h\"!#include \"simdutf.h\"!' {} \\;", + "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/fp16/src/include/fp16.h\"!#include \"fp16.h\"!' {} \\;", + "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/dragonbox/src/include/dragonbox/dragonbox.h\"!#include \"dragonbox/dragonbox.h\"!' {} \\;", + "find ./src ./include -type f -exec sed -i.bak -e 's!#include \"third_party/fast_float/src/include/fast_float/!#include \"fast_float/!' {} \\;", + ], + repo_mapping = { + "@abseil-cpp": "@com_google_absl", + }, + ) + + maybe( + http_archive, + name = "highway", + sha256 = "7e0be78b8318e8bdbf6fa545d2ecb4c90f947df03f7aadc42c1967f019e63343", + urls = [ + "https://github.com/google/highway/archive/refs/tags/1.2.0.tar.gz", + ], + strip_prefix = "highway-1.2.0", + ) + + maybe( + http_archive, + name = "fast_float", + sha256 = "d2a08e722f461fe699ba61392cd29e6b23be013d0f56e50c7786d0954bffcb17", + urls = [ + "https://github.com/fastfloat/fast_float/archive/refs/tags/v7.0.0.tar.gz", + ], + strip_prefix = "fast_float-7.0.0", + ) + + maybe( + http_archive, + name = "dragonbox", + urls = [ + "https://github.com/jk-jeon/dragonbox/archive/6c7c925b571d54486b9ffae8d9d18a822801cbda.zip", + ], + strip_prefix = "dragonbox-6c7c925b571d54486b9ffae8d9d18a822801cbda", + sha256 = "2f10448d665355b41f599e869ac78803f82f13b070ce7ef5ae7b5cceb8a178f3", + build_file = "@proxy_wasm_cpp_host//bazel/external:dragonbox.BUILD", + ) + + maybe( + http_archive, + name = "fp16", + urls = [ + "https://github.com/Maratyszcza/FP16/archive/0a92994d729ff76a58f692d3028ca1b64b145d91.zip", + ], + strip_prefix = "FP16-0a92994d729ff76a58f692d3028ca1b64b145d91", + sha256 = "e66e65515fa09927b348d3d584c68be4215cfe664100d01c9dbc7655a5716d70", + build_file = "@proxy_wasm_cpp_host//bazel/external:fp16.BUILD", + ) + + maybe( + http_archive, + name = "simdutf", + sha256 = "512374f8291d3daf102ccd0ad223b1a8318358f7c1295efd4d9a3abbb8e4b6ff", + urls = [ + "https://github.com/simdutf/simdutf/releases/download/v7.3.0/singleheader.zip", + ], + build_file = "@proxy_wasm_cpp_host//bazel/external:simdutf.BUILD", + ) + + maybe( + http_archive, + name = "intel_ittapi", + strip_prefix = "ittapi-a3911fff01a775023a06af8754f9ec1e5977dd97", + sha256 = "1d0dddfc5abb786f2340565c82c6edd1cff10c917616a18ce62ee0b94dbc2ed4", + urls = ["https://github.com/intel/ittapi/archive/a3911fff01a775023a06af8754f9ec1e5977dd97.tar.gz"], + build_file = "@proxy_wasm_cpp_host//bazel/external:intel_ittapi.BUILD", + ) + + native.bind( + name = "wee8", + actual = "@v8//:wee8", + ) + + # WAMR with dependencies. + + maybe( + http_archive, name = "com_github_bytecodealliance_wasm_micro_runtime", build_file = "@proxy_wasm_cpp_host//bazel/external:wamr.BUILD", - sha256 = "46ad365a1c0668797e69cb868574fd526cd8e26a503213caf782c39061e6d2e1", - strip_prefix = "wasm-micro-runtime-17a216748574499bd3a5130e7e6a20b84fe76798", - url = "https://github.com/bytecodealliance/wasm-micro-runtime/archive/17a216748574499bd3a5130e7e6a20b84fe76798.tar.gz", + # WAMR-2.4.1 + sha256 = "ca18bbf304f47287bf43707564db63b8908dd6d0d6ac40bb39271a7144def4cc", + strip_prefix = "wasm-micro-runtime-WAMR-2.4.1", + url = "https://github.com/bytecodealliance/wasm-micro-runtime/archive/refs/tags/WAMR-2.4.1.zip", ) native.bind( @@ -56,58 +279,48 @@ def proxy_wasm_cpp_host_repositories(): actual = "@com_github_bytecodealliance_wasm_micro_runtime//:wamr_lib", ) - http_archive( - name = "com_github_bytecodealliance_wasmtime", - build_file = "@proxy_wasm_cpp_host//bazel/external:wasmtime.BUILD", - sha256 = "e95d274822ac72bf06355bdfbeddcacae60d7e98fec8ee4b2e21740636fb5c2c", - strip_prefix = "wasmtime-0.26.0", - url = "https://github.com/bytecodealliance/wasmtime/archive/v0.26.0.tar.gz", + maybe( + http_archive, + name = "llvm-15_0_7", + build_file = "@proxy_wasm_cpp_host//bazel/external:wamr_llvm.BUILD", + sha256 = "8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6", + strip_prefix = "llvm-project-15.0.7.src", + url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/llvm-project-15.0.7.src.tar.xz", ) - http_archive( - name = "com_github_webassembly_wasm_c_api", - build_file = "@proxy_wasm_cpp_host//bazel/external:wasm-c-api.BUILD", - sha256 = "c774044f51431429e878bd1b9e2a4e38932f861f9211df72f75e9427eb6b8d32", - strip_prefix = "wasm-c-api-c9d31284651b975f05ac27cee0bab1377560b87e", - url = "https://github.com/WebAssembly/wasm-c-api/archive/c9d31284651b975f05ac27cee0bab1377560b87e.tar.gz", - ) + # WasmEdge with dependencies. - native.bind( - name = "wasmtime", - actual = "@com_github_webassembly_wasm_c_api//:wasmtime_lib", + maybe( + http_archive, + name = "com_github_wasmedge_wasmedge", + build_file = "@proxy_wasm_cpp_host//bazel/external:wasmedge.BUILD", + sha256 = "7ab8a0df37c8d282ecff72d0f0bff8db63fd92df1645d5a014a9dbed4b7f9025", + strip_prefix = "WasmEdge-proxy-wasm-0.13.1", + url = "https://github.com/WasmEdge/WasmEdge/archive/refs/tags/proxy-wasm/0.13.1.tar.gz", ) - http_archive( - name = "rules_rust", - sha256 = "db182e96b5ed62b044142cdae096742fcfd1aa4febfe3af8afa3c0ee438a52a4", - strip_prefix = "rules_rust-96d5118f03411f80182fd45426e259eedf809d7a", - url = "https://github.com/bazelbuild/rules_rust/archive/96d5118f03411f80182fd45426e259eedf809d7a.tar.gz", + native.bind( + name = "wasmedge", + actual = "@com_github_wasmedge_wasmedge//:wasmedge_lib", ) - http_archive( - name = "rules_foreign_cc", - sha256 = "d54742ffbdc6924f222d2179f0e10e911c5c659c4ae74158e9fe827aad862ac6", - strip_prefix = "rules_foreign_cc-0.2.0", - url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.2.0.tar.gz", - ) + # Wasmtime with dependencies. - http_archive( - name = "llvm", - build_file = "@proxy_wasm_cpp_host//bazel/external:llvm.BUILD", - sha256 = "df83a44b3a9a71029049ec101fb0077ecbbdf5fe41e395215025779099a98fdf", - strip_prefix = "llvm-10.0.0.src", - url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/llvm-10.0.0.src.tar.xz", + maybe( + http_archive, + name = "com_github_bytecodealliance_wasmtime", + build_file = "@proxy_wasm_cpp_host//bazel/external:wasmtime.BUILD", + sha256 = "2ccb49bb3bfa4d86907ad4c80d1147aef6156c7b6e3f7f14ed02a39de9761155", + strip_prefix = "wasmtime-24.0.0", + url = "https://github.com/bytecodealliance/wasmtime/archive/v24.0.0.tar.gz", ) - http_archive( - name = "com_github_wavm_wavm", - build_file = "@proxy_wasm_cpp_host//bazel/external:wavm.BUILD", - sha256 = "fa9a8dece0f1a51f8789c07f7f0c1f817ceee54c57d85f22ab958e43cde648d3", - strip_prefix = "WAVM-93c3ad73e2938f19c8bb26d4f456b39d6bc4ca01", - url = "https://github.com/WAVM/WAVM/archive/93c3ad73e2938f19c8bb26d4f456b39d6bc4ca01.tar.gz", + native.bind( + name = "wasmtime", + actual = "@com_github_bytecodealliance_wasmtime//:wasmtime_lib", ) native.bind( - name = "wavm", - actual = "@com_github_wavm_wavm//:wavm_lib", + name = "prefixed_wasmtime", + actual = "@com_github_bytecodealliance_wasmtime//:prefixed_wasmtime_lib", ) diff --git a/bazel/select.bzl b/bazel/select.bzl index 7d4a305a3..cc4da38d1 100644 --- a/bazel/select.bzl +++ b/bazel/select.bzl @@ -12,26 +12,38 @@ # See the License for the specific language governing permissions and # limitations under the License. -def proxy_wasm_select_runtime_v8(xs): +def proxy_wasm_select_engine_null(xs): return select({ - "@proxy_wasm_cpp_host//bazel:runtime_v8": xs, + "@proxy_wasm_cpp_host//bazel:engine_null": xs, + "@proxy_wasm_cpp_host//bazel:multiengine": xs, "//conditions:default": [], }) -def proxy_wasm_select_runtime_wamr(xs): +def proxy_wasm_select_engine_v8(xs): return select({ - "@proxy_wasm_cpp_host//bazel:runtime_wamr": xs, + "@proxy_wasm_cpp_host//bazel:engine_v8": xs, + "@proxy_wasm_cpp_host//bazel:multiengine": xs, "//conditions:default": [], }) -def proxy_wasm_select_runtime_wasmtime(xs): +def proxy_wasm_select_engine_wamr(xs): return select({ - "@proxy_wasm_cpp_host//bazel:runtime_wasmtime": xs, + "@proxy_wasm_cpp_host//bazel:engine_wamr_interp": xs, + "@proxy_wasm_cpp_host//bazel:engine_wamr_jit": xs, + "@proxy_wasm_cpp_host//bazel:multiengine": xs, "//conditions:default": [], }) -def proxy_wasm_select_runtime_wavm(xs): +def proxy_wasm_select_engine_wasmtime(xs, xp): return select({ - "@proxy_wasm_cpp_host//bazel:runtime_wavm": xs, + "@proxy_wasm_cpp_host//bazel:engine_wasmtime": xs, + "@proxy_wasm_cpp_host//bazel:multiengine": xp, + "//conditions:default": [], + }) + +def proxy_wasm_select_engine_wasmedge(xs): + return select({ + "@proxy_wasm_cpp_host//bazel:engine_wasmedge": xs, + "@proxy_wasm_cpp_host//bazel:multiengine": xs, "//conditions:default": [], }) diff --git a/bazel/tsan_suppressions.txt b/bazel/tsan_suppressions.txt new file mode 100644 index 000000000..8754c04f3 --- /dev/null +++ b/bazel/tsan_suppressions.txt @@ -0,0 +1,3 @@ +# False positive in V8 worker shutdown +race:v8::platform::DefaultJobHandle::Join +race:v8::platform::DefaultJobHandle::Cancel diff --git a/bazel/wasm.bzl b/bazel/wasm.bzl index 8bc3351bf..192823047 100644 --- a/bazel/wasm.bzl +++ b/bazel/wasm.bzl @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_rust//rust:rust.bzl", "rust_binary") +load("@rules_rust//rust:defs.bzl", "rust_binary") def _wasm_rust_transition_impl(settings, attr): return { @@ -63,7 +63,7 @@ def _wasm_attrs(transition): return { "binary": attr.label(mandatory = True, cfg = transition), "signing_key": attr.label_list(allow_files = True), - "_wasmsign_tool": attr.label(default = "//bazel/cargo:cargo_bin_wasmsign", executable = True, cfg = "exec"), + "_wasmsign_tool": attr.label(default = "//bazel/cargo/wasmsign/remote:wasmsign__wasmsign", executable = True, cfg = "exec"), "_whitelist_function_transition": attr.label(default = "@bazel_tools//tools/whitelists/function_transition_whitelist"), } diff --git a/include/proxy-wasm/bytecode_util.h b/include/proxy-wasm/bytecode_util.h index 1f4b600b2..f708780e7 100644 --- a/include/proxy-wasm/bytecode_util.h +++ b/include/proxy-wasm/bytecode_util.h @@ -69,7 +69,7 @@ class BytecodeUtil { static bool getStrippedSource(std::string_view bytecode, std::string &ret); private: - static bool parseVarint(const char *&begin, const char *end, uint32_t &ret); + static bool parseVarint(const char *&pos, const char *end, uint32_t &ret); }; } // namespace proxy_wasm diff --git a/include/proxy-wasm/context.h b/include/proxy-wasm/context.h index f88b4aaac..208633acc 100644 --- a/include/proxy-wasm/context.h +++ b/include/proxy-wasm/context.h @@ -23,15 +23,14 @@ #include #include #include +#include #include +#include "include/proxy-wasm/sdk.h" #include "include/proxy-wasm/context_interface.h" namespace proxy_wasm { -#include "proxy_wasm_common.h" -#include "proxy_wasm_enums.h" - class PluginHandleBase; class WasmBase; class WasmVm; @@ -49,18 +48,17 @@ class WasmVm; */ struct PluginBase { PluginBase(std::string_view name, std::string_view root_id, std::string_view vm_id, - std::string_view runtime, std::string_view plugin_configuration, bool fail_open, + std::string_view engine, std::string_view plugin_configuration, bool fail_open, std::string_view key) : name_(std::string(name)), root_id_(std::string(root_id)), vm_id_(std::string(vm_id)), - runtime_(std::string(runtime)), plugin_configuration_(plugin_configuration), - fail_open_(fail_open), - key_(root_id_ + "||" + plugin_configuration_ + "||" + std::string(key)), + engine_(std::string(engine)), plugin_configuration_(plugin_configuration), + fail_open_(fail_open), key_(makePluginKey(root_id, plugin_configuration, key)), log_prefix_(makeLogPrefix()) {} const std::string name_; const std::string root_id_; const std::string vm_id_; - const std::string runtime_; + const std::string engine_; const std::string plugin_configuration_; const bool fail_open_; @@ -69,6 +67,8 @@ struct PluginBase { private: std::string makeLogPrefix() const; + static std::string makePluginKey(std::string_view root_id, std::string_view plugin_configuration, + std::string_view key); const std::string key_; const std::string log_prefix_; @@ -143,21 +143,21 @@ class ContextBase : public RootInterface, public SharedQueueInterface, public GeneralInterface { public: - ContextBase(); // Testing. - ContextBase(WasmBase *wasm); // Vm Context. - ContextBase(WasmBase *wasm, std::shared_ptr plugin); // Root Context. + ContextBase(); // Testing. + ContextBase(WasmBase *wasm); // Vm Context. + ContextBase(WasmBase *wasm, const std::shared_ptr &plugin); // Root Context. ContextBase(WasmBase *wasm, uint32_t parent_context_id, - std::shared_ptr plugin_handle); // Stream context. + const std::shared_ptr &plugin_handle); // Stream context. virtual ~ContextBase(); - WasmBase *wasm() const { return wasm_; } + virtual WasmBase *wasm() const { return wasm_; } uint32_t id() const { return id_; } // The VM Context used for calling "malloc" has an id_ == 0. bool isVmContext() const { return id_ == 0; } // Root Contexts have the VM Context as a parent. bool isRootContext() const { return parent_context_id_ == 0; } - ContextBase *parent_context() const { return parent_context_; } - ContextBase *root_context() const { + virtual ContextBase *parent_context() const { return parent_context_; } + virtual ContextBase *root_context() const { const ContextBase *previous = this; ContextBase *parent = parent_context_; while (parent != previous) { @@ -170,7 +170,7 @@ class ContextBase : public RootInterface, std::string_view log_prefix() const { return isRootContext() ? root_log_prefix_ : plugin_->log_prefix(); } - WasmVm *wasmVm() const; + virtual WasmVm *wasmVm() const; // Called before deleting the context. virtual void destroy(); @@ -196,11 +196,11 @@ class ContextBase : public RootInterface, // HTTP FilterHeadersStatus onRequestHeaders(uint32_t headers, bool end_of_stream) override; - FilterDataStatus onRequestBody(uint32_t body_buffer_length, bool end_of_stream) override; + FilterDataStatus onRequestBody(uint32_t body_length, bool end_of_stream) override; FilterTrailersStatus onRequestTrailers(uint32_t trailers) override; FilterMetadataStatus onRequestMetadata(uint32_t elements) override; FilterHeadersStatus onResponseHeaders(uint32_t headers, bool end_of_stream) override; - FilterDataStatus onResponseBody(uint32_t body_buffer_length, bool end_of_stream) override; + FilterDataStatus onResponseBody(uint32_t body_length, bool end_of_stream) override; FilterTrailersStatus onResponseTrailers(uint32_t trailers) override; FilterMetadataStatus onResponseMetadata(uint32_t elements) override; @@ -237,32 +237,17 @@ class ContextBase : public RootInterface, WasmResult log(uint32_t /* level */, std::string_view /* message */) override { return unimplemented(); } - uint32_t getLogLevel() override { return static_cast(LogLevel::info); } + uint32_t getLogLevel() override { + unimplemented(); + return 0; + } uint64_t getCurrentTimeNanoseconds() override { -#if !defined(_MSC_VER) - struct timespec tpe; - clock_gettime(CLOCK_REALTIME, &tpe); - uint64_t t = tpe.tv_sec; - t *= 1000000000; - t += tpe.tv_nsec; - return t; -#else unimplemented(); return 0; -#endif } uint64_t getMonotonicTimeNanoseconds() override { -#if !defined(_MSC_VER) - struct timespec tpe; - clock_gettime(CLOCK_MONOTONIC, &tpe); - uint64_t t = tpe.tv_sec; - t *= 1000000000; - t += tpe.tv_nsec; - return t; -#else unimplemented(); return 0; -#endif } std::string_view getConfiguration() override { unimplemented(); @@ -353,12 +338,15 @@ class ContextBase : public RootInterface, WasmResult getSharedData(std::string_view key, std::pair *data) override; WasmResult setSharedData(std::string_view key, std::string_view value, uint32_t cas) override; + WasmResult getSharedDataKeys(std::vector *result) override; + WasmResult removeSharedDataKey(std::string_view key, uint32_t cas, + std::pair *result) override; // Shared Queue WasmResult registerSharedQueue(std::string_view queue_name, SharedQueueDequeueToken *token_ptr) override; WasmResult lookupSharedQueue(std::string_view vm_id, std::string_view queue_name, - SharedQueueEnqueueToken *token) override; + SharedQueueEnqueueToken *token_ptr) override; WasmResult dequeueSharedQueue(uint32_t token, std::string *data) override; WasmResult enqueueSharedQueue(uint32_t token, std::string_view value) override; @@ -409,6 +397,13 @@ class ContextBase : public RootInterface, bool destroyed_ = false; bool stream_failed_ = false; // Set true after failStream is called in case of VM failure. + // If true, convertVmCallResultToFilterHeadersStatus() propagates + // FilterHeadersStatus::StopIteration unmodified to callers. If false, it + // translates FilterHeaderStatus::StopIteration to + // FilterHeadersStatus::StopAllIterationAndWatermark, which is the default + // behavior for v0.2.* of the Proxy-Wasm ABI. + bool allow_on_headers_stop_iteration_ = false; + private: // helper functions FilterHeadersStatus convertVmCallResultToFilterHeadersStatus(uint64_t result); diff --git a/include/proxy-wasm/context_interface.h b/include/proxy-wasm/context_interface.h index 841dd0e16..48fce76d9 100644 --- a/include/proxy-wasm/context_interface.h +++ b/include/proxy-wasm/context_interface.h @@ -25,10 +25,9 @@ #include #include -namespace proxy_wasm { +#include "include/proxy-wasm/sdk.h" -#include "proxy_wasm_common.h" -#include "proxy_wasm_enums.h" +namespace proxy_wasm { using Pairs = std::vector>; using PairsWithStringValues = std::vector>; @@ -206,7 +205,7 @@ struct HttpInterface { virtual FilterHeadersStatus onRequestHeaders(uint32_t headers, bool end_of_stream) = 0; // Call on a stream context to indicate that body data has arrived. - virtual FilterDataStatus onRequestBody(uint32_t body_buffer_length, bool end_of_stream) = 0; + virtual FilterDataStatus onRequestBody(uint32_t body_length, bool end_of_stream) = 0; // Call on a stream context to indicate that the request trailers have arrived. virtual FilterTrailersStatus onRequestTrailers(uint32_t trailers) = 0; @@ -218,7 +217,7 @@ struct HttpInterface { virtual FilterHeadersStatus onResponseHeaders(uint32_t trailers, bool end_of_stream) = 0; // Call on a stream context to indicate that body data has arrived. - virtual FilterDataStatus onResponseBody(uint32_t body_buffer_length, bool end_of_stream) = 0; + virtual FilterDataStatus onResponseBody(uint32_t body_length, bool end_of_stream) = 0; // Call on a stream context to indicate that the request trailers have arrived. virtual FilterTrailersStatus onResponseTrailers(uint32_t trailers) = 0; @@ -596,7 +595,7 @@ struct GeneralInterface { }; /** - * SharedDataInterface is for shaing data between VMs. In general the VMs may be on different + * SharedDataInterface is for sharing data between VMs. In general the VMs may be on different * threads. Keys can have any format, but good practice would use reverse DNS and namespacing * prefixes to avoid conflicts. */ @@ -621,6 +620,23 @@ struct SharedDataInterface { * @param data is a location to store the returned value. */ virtual WasmResult setSharedData(std::string_view key, std::string_view value, uint32_t cas) = 0; + + /** + * Return all the keys from the data shraed between VMs + * @param data is a location to store the returned value. + */ + virtual WasmResult getSharedDataKeys(std::vector *result) = 0; + + /** + * Removes the given key from the data shared between VMs. + * @param key is a proxy-wide key mapping to the shared data value. + * @param cas is a compare-and-swap value. If it is zero it is ignored, otherwise it must match + * @param cas is a location to store value, and cas number, associated with the removed key + * the cas associated with the value. + */ + virtual WasmResult + removeSharedDataKey(std::string_view key, uint32_t cas, + std::pair *result) = 0; }; // namespace proxy_wasm struct SharedQueueInterface { diff --git a/include/proxy-wasm/exports.h b/include/proxy-wasm/exports.h index 9c6e17226..91c51150c 100644 --- a/include/proxy-wasm/exports.h +++ b/include/proxy-wasm/exports.h @@ -25,136 +25,135 @@ namespace proxy_wasm { class ContextBase; +// Any currently executing Wasm call context. +::proxy_wasm::ContextBase *contextOrEffectiveContext(); + extern thread_local ContextBase *current_context_; -namespace exports { +/** + * WasmForeignFunction is used for registering host-specific host functions. + * A foreign function can be registered via RegisterForeignFunction and available + * to Wasm modules via proxy_call_foreign_function. + * @param wasm is the WasmBase which the Wasm module is running on. + * @param argument is the view to the argument to the function passed by the module. + * @param alloc_result is used to allocate the result data of this foreign function. + */ +using WasmForeignFunction = std::function alloc_result)>; + +/** + * Used to get the foreign function registered via RegisterForeignFunction for a given name. + * @param function_name is the name used to lookup the foreign function table. + * @return a WasmForeignFunction if registered. + */ +WasmForeignFunction getForeignFunction(std::string_view function_name); + +/** + * RegisterForeignFunction is used to register a foreign function in the lookup table + * used internally in getForeignFunction. + */ +struct RegisterForeignFunction { + /** + * @param function_name is the key for this foreign function. + * @param f is the function instance. + */ + RegisterForeignFunction(const std::string &function_name, WasmForeignFunction f); +}; -template size_t pairsSize(const Pairs &result) { - size_t size = 4; // number of headers - for (auto &p : result) { - size += 8; // size of key, size of value - size += p.first.size() + 1; // null terminated key - size += p.second.size() + 1; // null terminated value - } - return size; -} - -template void marshalPairs(const Pairs &result, char *buffer) { - char *b = buffer; - *reinterpret_cast(b) = result.size(); - b += sizeof(uint32_t); - for (auto &p : result) { - *reinterpret_cast(b) = p.first.size(); - b += sizeof(uint32_t); - *reinterpret_cast(b) = p.second.size(); - b += sizeof(uint32_t); - } - for (auto &p : result) { - memcpy(b, p.first.data(), p.first.size()); - b += p.first.size(); - *b++ = 0; - memcpy(b, p.second.data(), p.second.size()); - b += p.second.size(); - *b++ = 0; - } -} +namespace exports { // ABI functions exported from host to wasm. -Word get_configuration(void *raw_context, Word address, Word size); -Word get_status(void *raw_context, Word status_code, Word address, Word size); -Word log(void *raw_context, Word level, Word address, Word size); -Word get_log_level(void *raw_context, Word result_level_uint32_ptr); -Word get_property(void *raw_context, Word path_ptr, Word path_size, Word value_ptr_ptr, - Word value_size_ptr); -Word set_property(void *raw_context, Word key_ptr, Word key_size, Word value_ptr, Word value_size); -Word continue_request(void *raw_context); -Word continue_response(void *raw_context); -Word continue_stream(void *raw_context, Word stream_type); -Word close_stream(void *raw_context, Word stream_type); -Word send_local_response(void *raw_context, Word response_code, Word response_code_details_ptr, +Word get_configuration(Word value_ptr_ptr, Word value_size_ptr); +Word get_status(Word code_ptr, Word value_ptr_ptr, Word value_size_ptr); +Word log(Word level, Word address, Word size); +Word get_log_level(Word result_level_uint32_ptr); +Word get_property(Word path_ptr, Word path_size, Word value_ptr_ptr, Word value_size_ptr); +Word set_property(Word key_ptr, Word key_size, Word value_ptr, Word value_size); +Word continue_request(); +Word continue_response(); +Word continue_stream(Word stream_type); +Word close_stream(Word stream_type); +Word send_local_response(Word response_code, Word response_code_details_ptr, Word response_code_details_size, Word body_ptr, Word body_size, Word additional_response_header_pairs_ptr, Word additional_response_header_pairs_size, Word grpc_status); -Word clear_route_cache(void *raw_context); -Word get_shared_data(void *raw_context, Word key_ptr, Word key_size, Word value_ptr_ptr, - Word value_size_ptr, Word cas_ptr); -Word set_shared_data(void *raw_context, Word key_ptr, Word key_size, Word value_ptr, - Word value_size, Word cas); -Word register_shared_queue(void *raw_context, Word queue_name_ptr, Word queue_name_size, - Word token_ptr); -Word resolve_shared_queue(void *raw_context, Word vm_id_ptr, Word vm_id_size, Word queue_name_ptr, +Word clear_route_cache(); +Word get_shared_data(Word key_ptr, Word key_size, Word value_ptr_ptr, Word value_size_ptr, + Word cas_ptr); +Word set_shared_data(Word key_ptr, Word key_size, Word value_ptr, Word value_size, Word cas); +Word register_shared_queue(Word queue_name_ptr, Word queue_name_size, Word token_ptr); +Word resolve_shared_queue(Word vm_id_ptr, Word vm_id_size, Word queue_name_ptr, Word queue_name_size, Word token_ptr); -Word dequeue_shared_queue(void *raw_context, Word token, Word data_ptr_ptr, Word data_size_ptr); -Word enqueue_shared_queue(void *raw_context, Word token, Word data_ptr, Word data_size); -Word get_buffer_bytes(void *raw_context, Word type, Word start, Word length, Word ptr_ptr, - Word size_ptr); -Word get_buffer_status(void *raw_context, Word type, Word length_ptr, Word flags_ptr); -Word set_buffer_bytes(void *raw_context, Word type, Word start, Word length, Word data_ptr, - Word data_size); -Word add_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_size, Word value_ptr, - Word value_size); -Word get_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_size, - Word value_ptr_ptr, Word value_size_ptr); -Word replace_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_size, - Word value_ptr, Word value_size); -Word remove_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_size); -Word get_header_map_pairs(void *raw_context, Word type, Word ptr_ptr, Word size_ptr); -Word set_header_map_pairs(void *raw_context, Word type, Word ptr, Word size); -Word get_header_map_size(void *raw_context, Word type, Word result_ptr); -Word getRequestBodyBufferBytes(void *raw_context, Word start, Word length, Word ptr_ptr, - Word size_ptr); -Word get_response_body_buffer_bytes(void *raw_context, Word start, Word length, Word ptr_ptr, - Word size_ptr); -Word http_call(void *raw_context, Word uri_ptr, Word uri_size, Word header_pairs_ptr, - Word header_pairs_size, Word body_ptr, Word body_size, Word trailer_pairs_ptr, - Word trailer_pairs_size, Word timeout_milliseconds, Word token_ptr); -Word define_metric(void *raw_context, Word metric_type, Word name_ptr, Word name_size, - Word result_ptr); -Word increment_metric(void *raw_context, Word metric_id, int64_t offset); -Word record_metric(void *raw_context, Word metric_id, uint64_t value); -Word get_metric(void *raw_context, Word metric_id, Word result_uint64_ptr); -Word grpc_call(void *raw_context, Word service_ptr, Word service_size, Word service_name_ptr, - Word service_name_size, Word method_name_ptr, Word method_name_size, - Word initial_metadata_ptr, Word initial_metadata_size, Word request_ptr, - Word request_size, Word timeout_milliseconds, Word token_ptr); -Word grpc_stream(void *raw_context, Word service_ptr, Word service_size, Word service_name_ptr, - Word service_name_size, Word method_name_ptr, Word method_name_size, - Word initial_metadata_ptr, Word initial_metadata_size, Word token_ptr); -Word grpc_cancel(void *raw_context, Word token); -Word grpc_close(void *raw_context, Word token); -Word grpc_send(void *raw_context, Word token, Word message_ptr, Word message_size, Word end_stream); - -Word set_tick_period_milliseconds(void *raw_context, Word tick_period_milliseconds); -Word get_current_time_nanoseconds(void *raw_context, Word result_uint64_ptr); - -Word set_effective_context(void *raw_context, Word context_id); -Word done(void *raw_context); -Word call_foreign_function(void *raw_context, Word function_name, Word function_name_size, - Word arguments, Word warguments_size, Word results, Word results_size); +Word dequeue_shared_queue(Word token, Word data_ptr_ptr, Word data_size_ptr); +Word enqueue_shared_queue(Word token, Word data_ptr, Word data_size); +Word get_buffer_bytes(Word type, Word start, Word length, Word ptr_ptr, Word size_ptr); +Word get_buffer_status(Word type, Word length_ptr, Word flags_ptr); +Word set_buffer_bytes(Word type, Word start, Word length, Word data_ptr, Word data_size); +Word add_header_map_value(Word type, Word key_ptr, Word key_size, Word value_ptr, Word value_size); +Word get_header_map_value(Word type, Word key_ptr, Word key_size, Word value_ptr_ptr, + Word value_size_ptr); +Word replace_header_map_value(Word type, Word key_ptr, Word key_size, Word value_ptr, + Word value_size); +Word remove_header_map_value(Word type, Word key_ptr, Word key_size); +Word get_header_map_pairs(Word type, Word ptr_ptr, Word size_ptr); +Word set_header_map_pairs(Word type, Word ptr, Word size); +Word get_header_map_size(Word type, Word result_ptr); +Word getRequestBodyBufferBytes(Word start, Word length, Word ptr_ptr, Word size_ptr); +Word get_response_body_buffer_bytes(Word start, Word length, Word ptr_ptr, Word size_ptr); +Word http_call(Word uri_ptr, Word uri_size, Word header_pairs_ptr, Word header_pairs_size, + Word body_ptr, Word body_size, Word trailer_pairs_ptr, Word trailer_pairs_size, + Word timeout_milliseconds, Word token_ptr); +Word define_metric(Word metric_type, Word name_ptr, Word name_size, Word metric_id_ptr); +Word increment_metric(Word metric_id, int64_t offset); +Word record_metric(Word metric_id, uint64_t value); +Word get_metric(Word metric_id, Word result_uint64_ptr); +Word grpc_call(Word service_ptr, Word service_size, Word service_name_ptr, Word service_name_size, + Word method_name_ptr, Word method_name_size, Word initial_metadata_ptr, + Word initial_metadata_size, Word request_ptr, Word request_size, + Word timeout_milliseconds, Word token_ptr); +Word grpc_stream(Word service_ptr, Word service_size, Word service_name_ptr, Word service_name_size, + Word method_name_ptr, Word method_name_size, Word initial_metadata_ptr, + Word initial_metadata_size, Word token_ptr); +Word grpc_cancel(Word token); +Word grpc_close(Word token); +Word grpc_send(Word token, Word message_ptr, Word message_size, Word end_stream); + +Word set_tick_period_milliseconds(Word tick_period_milliseconds); +Word get_current_time_nanoseconds(Word result_uint64_ptr); + +Word set_effective_context(Word context_id); +Word done(); +Word call_foreign_function(Word function_name, Word function_name_size, Word arguments, + Word warguments_size, Word results, Word results_size); // Runtime environment functions exported from envoy to wasm. -Word wasi_unstable_fd_write(void *raw_context, Word fd, Word iovs, Word iovs_len, - Word nwritten_ptr); -Word wasi_unstable_fd_read(void *, Word, Word, Word, Word); -Word wasi_unstable_fd_seek(void *, Word, int64_t, Word, Word); -Word wasi_unstable_fd_close(void *, Word); -Word wasi_unstable_fd_fdstat_get(void *, Word fd, Word statOut); -Word wasi_unstable_environ_get(void *, Word, Word); -Word wasi_unstable_environ_sizes_get(void *raw_context, Word count_ptr, Word buf_size_ptr); -Word wasi_unstable_args_get(void *raw_context, Word argc_ptr, Word argv_buf_size_ptr); -Word wasi_unstable_args_sizes_get(void *raw_context, Word argc_ptr, Word argv_buf_size_ptr); -void wasi_unstable_proc_exit(void *, Word); -Word wasi_unstable_clock_time_get(void *, Word, uint64_t, Word); -Word wasi_unstable_random_get(void *, Word, Word); -Word pthread_equal(void *, Word left, Word right); +Word wasi_unstable_path_open(Word fd, Word dir_flags, Word path, Word path_len, Word oflags, + int64_t fs_rights_base, int64_t fg_rights_inheriting, Word fd_flags, + Word nwritten_ptr); +Word wasi_unstable_fd_prestat_get(Word fd, Word buf_ptr); +Word wasi_unstable_fd_prestat_dir_name(Word fd, Word path_ptr, Word path_len); +Word wasi_unstable_fd_write(Word fd, Word iovs, Word iovs_len, Word nwritten_ptr); +Word wasi_unstable_fd_read(Word, Word, Word, Word); +Word wasi_unstable_fd_seek(Word, int64_t, Word, Word); +Word wasi_unstable_fd_close(Word); +Word wasi_unstable_fd_fdstat_get(Word fd, Word statOut); +Word wasi_unstable_fd_fdstat_set_flags(Word fd, Word flags); +Word wasi_unstable_environ_get(Word, Word); +Word wasi_unstable_environ_sizes_get(Word count_ptr, Word buf_size_ptr); +Word wasi_unstable_args_get(Word argc_ptr, Word argv_buf_size_ptr); +Word wasi_unstable_args_sizes_get(Word argc_ptr, Word argv_buf_size_ptr); +Word wasi_unstable_sched_yield(); +Word wasi_unstable_poll_oneoff(Word in, Word out, Word nsubscriptions, Word nevents); +void wasi_unstable_proc_exit(Word); +Word wasi_unstable_clock_time_get(Word, uint64_t, Word); +Word wasi_unstable_random_get(Word, Word); +Word pthread_equal(Word left, Word right); +void emscripten_notify_memory_growth(Word); // Support for embedders, not exported to Wasm. -// Any currently executing Wasm call context. -::proxy_wasm::ContextBase *ContextOrEffectiveContext(::proxy_wasm::ContextBase *context); - #define FOR_ALL_HOST_FUNCTIONS(_f) \ _f(log) _f(get_status) _f(set_property) _f(get_property) _f(send_local_response) \ _f(get_shared_data) _f(set_shared_data) _f(register_shared_queue) _f(resolve_shared_queue) \ @@ -174,17 +173,17 @@ ::proxy_wasm::ContextBase *ContextOrEffectiveContext(::proxy_wasm::ContextBase * _f(continue_stream) _f(close_stream) _f(get_log_level) #define FOR_ALL_WASI_FUNCTIONS(_f) \ - _f(fd_write) _f(fd_read) _f(fd_seek) _f(fd_close) _f(fd_fdstat_get) _f(environ_get) \ - _f(environ_sizes_get) _f(args_get) _f(args_sizes_get) _f(clock_time_get) _f(random_get) \ - _f(proc_exit) + _f(fd_write) _f(fd_read) _f(fd_seek) _f(fd_close) _f(fd_fdstat_get) _f(fd_fdstat_set_flags) \ + _f(environ_get) _f(environ_sizes_get) _f(args_get) _f(args_sizes_get) _f(clock_time_get) \ + _f(random_get) _f(sched_yield) _f(poll_oneoff) _f(proc_exit) _f(path_open) \ + _f(fd_prestat_get) _f(fd_prestat_dir_name) // Helpers to generate a stub to pass to VM, in place of a restricted proxy-wasm capability. #define _CREATE_PROXY_WASM_STUB(_fn) \ template struct _fn##Stub; \ - template struct _fn##Stub { \ - static Word stub(void *raw_context, Args...) { \ - auto context = exports::ContextOrEffectiveContext( \ - static_cast((void)raw_context, current_context_)); \ + template struct _fn##Stub { \ + static Word stub(Args...) { \ + auto context = contextOrEffectiveContext(); \ context->wasmVm()->integration()->error( \ "Attempted call to restricted proxy-wasm capability: proxy_" #_fn); \ return WasmResult::InternalFailure; \ @@ -197,19 +196,17 @@ FOR_ALL_HOST_FUNCTIONS_ABI_SPECIFIC(_CREATE_PROXY_WASM_STUB) // Helpers to generate a stub to pass to VM, in place of a restricted WASI capability. #define _CREATE_WASI_STUB(_fn) \ template struct _fn##Stub; \ - template struct _fn##Stub { \ - static Word stub(void *raw_context, Args...) { \ - auto context = exports::ContextOrEffectiveContext( \ - static_cast((void)raw_context, current_context_)); \ + template struct _fn##Stub { \ + static Word stub(Args...) { \ + auto context = contextOrEffectiveContext(); \ context->wasmVm()->integration()->error( \ "Attempted call to restricted WASI capability: " #_fn); \ return 76; /* __WASI_ENOTCAPABLE */ \ } \ }; \ - template struct _fn##Stub { \ - static void stub(void *raw_context, Args...) { \ - auto context = exports::ContextOrEffectiveContext( \ - static_cast((void)raw_context, current_context_)); \ + template struct _fn##Stub { \ + static void stub(Args...) { \ + auto context = contextOrEffectiveContext(); \ context->wasmVm()->integration()->error( \ "Attempted call to restricted WASI capability: " #_fn); \ } \ diff --git a/include/proxy-wasm/limits.h b/include/proxy-wasm/limits.h new file mode 100644 index 000000000..9b9ac1cd3 --- /dev/null +++ b/include/proxy-wasm/limits.h @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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. + */ + +#pragma once + +// Wasm memory page is always 64 KiB. +#define PROXY_WASM_HOST_WASM_MEMORY_PAGE_SIZE_BYTES (64 * 1024) + +// Maximum allowed Wasm memory size. +#ifndef PROXY_WASM_HOST_MAX_WASM_MEMORY_SIZE_BYTES +#define PROXY_WASM_HOST_MAX_WASM_MEMORY_SIZE_BYTES (1024 * 1024 * 1024) +#endif + +// Maximum allowed random_get buffer size. This value is consistent with +// the JavaScript Crypto.getRandomValues() maximum buffer size. +// See: https://w3c.github.io/webcrypto/#Crypto-method-getRandomValues +#ifndef PROXY_WASM_HOST_WASI_RANDOM_GET_MAX_SIZE_BYTES +#define PROXY_WASM_HOST_WASI_RANDOM_GET_MAX_SIZE_BYTES (64 * 1024) +#endif + +// Maximum allowed size of Pairs buffer to deserialize. +#ifndef PROXY_WASM_HOST_PAIRS_MAX_BYTES +#define PROXY_WASM_HOST_PAIRS_MAX_BYTES (1024 * 1024) +#endif + +// Maximum allowed number of pairs in a Pairs buffer to deserialize. +#ifndef PROXY_WASM_HOST_PAIRS_MAX_COUNT +#define PROXY_WASM_HOST_PAIRS_MAX_COUNT 1024 +#endif diff --git a/include/proxy-wasm/null_plugin.h b/include/proxy-wasm/null_plugin.h index f059c32be..b33187ce0 100644 --- a/include/proxy-wasm/null_plugin.h +++ b/include/proxy-wasm/null_plugin.h @@ -71,7 +71,7 @@ class NullPlugin : public NullVmPlugin { void onForeignFunction(uint64_t root_context_id, uint64_t foreign_function_id, uint64_t data_size); - void onCreate(uint64_t context_id, uint64_t root_context_id); + void onCreate(uint64_t context_id, uint64_t parent_context_id); uint64_t onNewConnection(uint64_t context_id); uint64_t onDownstreamData(uint64_t context_id, uint64_t data_length, uint64_t end_of_stream); diff --git a/include/proxy-wasm/null_vm.h b/include/proxy-wasm/null_vm.h index 27e371389..703266df3 100644 --- a/include/proxy-wasm/null_vm.h +++ b/include/proxy-wasm/null_vm.h @@ -32,11 +32,11 @@ struct NullVm : public WasmVm { NullVm(const NullVm &other) : plugin_name_(other.plugin_name_) {} // WasmVm - std::string_view runtime() override { return "null"; } + std::string_view getEngineName() override { return "null"; } Cloneable cloneable() override { return Cloneable::InstantiatedModule; }; std::unique_ptr clone() override; - bool load(std::string_view bytecode, std::string_view precompiled, - std::unordered_map function_names) override; + bool load(std::string_view plugin_name, std::string_view precompiled, + const std::unordered_map &function_names) override; bool link(std::string_view debug_name) override; uint64_t getMemorySize() override; std::optional getMemory(uint64_t pointer, uint64_t size) override; @@ -60,6 +60,11 @@ struct NullVm : public WasmVm { FOR_ALL_WASM_VM_IMPORTS(_REGISTER_CALLBACK) #undef _REGISTER_CALLBACK + void terminate() override {} + bool usesWasmByteOrder() override { return false; } + + void warm() override {} + std::string plugin_name_; std::unique_ptr plugin_; }; diff --git a/include/proxy-wasm/pairs_util.h b/include/proxy-wasm/pairs_util.h new file mode 100644 index 000000000..019c970ba --- /dev/null +++ b/include/proxy-wasm/pairs_util.h @@ -0,0 +1,64 @@ +// Copyright 2016-2019 Envoy Project Authors +// 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. + +#pragma once + +#include +#include +#include +#include + +namespace proxy_wasm { + +using Pairs = std::vector>; +using StringPairs = std::vector>; + +class PairsUtil { +public: + /** + * pairsSize returns the buffer size required to serialize Pairs. + * @param pairs Pairs to serialize. + * @return size of the output buffer. + */ + static size_t pairsSize(const Pairs &pairs); + + static size_t pairsSize(const StringPairs &stringpairs) { + Pairs views(stringpairs.begin(), stringpairs.end()); + return pairsSize(views); + } + + /** + * marshalPairs serializes Pairs to output buffer. + * @param pairs Pairs to serialize. + * @param buffer output buffer. + * @param size size of the output buffer. + * @return indicates whether serialization succeeded or not. + */ + static bool marshalPairs(const Pairs &pairs, char *buffer, size_t size); + + static bool marshalPairs(const StringPairs &stringpairs, char *buffer, size_t size) { + Pairs views(stringpairs.begin(), stringpairs.end()); + return marshalPairs(views, buffer, size); + } + + /** + * toPairs deserializes input buffer to Pairs. + * @param buffer serialized input buffer. + * @return deserialized Pairs or an empty instance in case of deserialization failure. + */ + static Pairs toPairs(std::string_view buffer); +}; + +} // namespace proxy_wasm diff --git a/include/proxy-wasm/sdk.h b/include/proxy-wasm/sdk.h new file mode 100644 index 000000000..105854373 --- /dev/null +++ b/include/proxy-wasm/sdk.h @@ -0,0 +1,50 @@ +// Copyright 2016-2019 Envoy Project Authors +// 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. + +#pragma once + +#include +#include + +namespace proxy_wasm { + +namespace internal { + +// isolate those includes to prevent ::proxy_wasm namespace pollution with std +// namespace definitions. +#include "proxy_wasm_common.h" +#include "proxy_wasm_enums.h" + +} // namespace internal + +// proxy_wasm_common.h +using WasmResult = internal::WasmResult; +using WasmHeaderMapType = internal::WasmHeaderMapType; +using WasmBufferType = internal::WasmBufferType; +using WasmBufferFlags = internal::WasmBufferFlags; +using WasmStreamType = internal::WasmStreamType; + +// proxy_wasm_enums.h +using LogLevel = internal::LogLevel; +using FilterStatus = internal::FilterStatus; +using FilterHeadersStatus = internal::FilterHeadersStatus; +using FilterMetadataStatus = internal::FilterMetadataStatus; +using FilterTrailersStatus = internal::FilterTrailersStatus; +using FilterDataStatus = internal::FilterDataStatus; +using GrpcStatus = internal::GrpcStatus; +using MetricType = internal::MetricType; +using CloseType = internal::CloseType; + +} // namespace proxy_wasm diff --git a/include/proxy-wasm/signature_util.h b/include/proxy-wasm/signature_util.h index 68579dcd1..a5c9c39df 100644 --- a/include/proxy-wasm/signature_util.h +++ b/include/proxy-wasm/signature_util.h @@ -14,6 +14,7 @@ #pragma once +#include #include namespace proxy_wasm { diff --git a/include/proxy-wasm/vm_id_handle.h b/include/proxy-wasm/vm_id_handle.h index b290d8f95..16ebb4bf0 100644 --- a/include/proxy-wasm/vm_id_handle.h +++ b/include/proxy-wasm/vm_id_handle.h @@ -15,8 +15,10 @@ #pragma once #include -#include #include +#include +#include +#include #include namespace proxy_wasm { @@ -31,6 +33,6 @@ class VmIdHandle { }; std::shared_ptr getVmIdHandle(std::string_view vm_id); -void registerVmIdHandleCallback(std::function f); +void registerVmIdHandleCallback(const std::function &f); } // namespace proxy_wasm diff --git a/include/proxy-wasm/wasm.h b/include/proxy-wasm/wasm.h index 519a00afb..9b85710bd 100644 --- a/include/proxy-wasm/wasm.h +++ b/include/proxy-wasm/wasm.h @@ -24,6 +24,7 @@ #include #include +#include "include/proxy-wasm/sdk.h" #include "include/proxy-wasm/context.h" #include "include/proxy-wasm/exports.h" #include "include/proxy-wasm/wasm_vm.h" @@ -31,14 +32,9 @@ namespace proxy_wasm { -#include "proxy_wasm_common.h" - class ContextBase; -class WasmBase; class WasmHandleBase; -using WasmForeignFunction = - std::function)>; using WasmVmFactory = std::function()>; using CallOnThreadFunction = std::function)>; @@ -55,21 +51,21 @@ class WasmBase : public std::enable_shared_from_this { std::string_view vm_configuration, std::string_view vm_key, std::unordered_map envs, AllowedCapabilitiesMap allowed_capabilities); - WasmBase(const std::shared_ptr &other, WasmVmFactory factory); + WasmBase(const std::shared_ptr &base_wasm_handle, const WasmVmFactory &factory); virtual ~WasmBase(); - bool load(const std::string &code, bool allow_precompiled = false); - bool initialize(); - void startVm(ContextBase *root_context); - bool configure(ContextBase *root_context, std::shared_ptr plugin); + virtual bool load(const std::string &code, bool allow_precompiled = false); + virtual bool initialize(); + virtual void startVm(ContextBase *root_context); + virtual bool configure(ContextBase *root_context, std::shared_ptr plugin); // Returns the root ContextBase or nullptr if onStart returns false. - ContextBase *start(std::shared_ptr plugin); + virtual ContextBase *start(const std::shared_ptr &plugin); std::string_view vm_id() const { return vm_id_; } std::string_view vm_key() const { return vm_key_; } WasmVm *wasm_vm() const { return wasm_vm_.get(); } - ContextBase *vm_context() const { return vm_context_.get(); } - ContextBase *getRootContext(const std::shared_ptr &plugin, bool allow_closed); + virtual ContextBase *vm_context() const { return vm_context_.get(); } + virtual ContextBase *getRootContext(const std::shared_ptr &plugin, bool allow_closed); ContextBase *getContext(uint32_t id) { auto it = contexts_.find(id); if (it != contexts_.end()) @@ -129,8 +125,6 @@ class WasmBase : public std::enable_shared_from_this { bool copyToPointerSize(std::string_view s, uint64_t ptr_ptr, uint64_t size_ptr); template bool setDatatype(uint64_t ptr, const T &t); - WasmForeignFunction getForeignFunction(std::string_view function_name); - void fail(FailState fail_state, std::string_view message) { error(message); failed_ = fail_state; @@ -176,6 +170,35 @@ class WasmBase : public std::enable_shared_from_this { uint32_t nextGaugeMetricId() { return next_gauge_metric_id_ += kMetricIdIncrement; } uint32_t nextHistogramMetricId() { return next_histogram_metric_id_ += kMetricIdIncrement; } + enum class CalloutType : uint32_t { + HttpCall = 0, + GrpcCall = 1, + GrpcStream = 2, + }; + static const uint32_t kCalloutTypeMask = 0x3; // Enough to cover the 3 types. + static const uint32_t kCalloutIncrement = 0x4; // Enough to cover the 3 types. + bool isHttpCallId(uint32_t callout_id) { + return (callout_id & kCalloutTypeMask) == static_cast(CalloutType::HttpCall); + } + bool isGrpcCallId(uint32_t callout_id) { + return (callout_id & kCalloutTypeMask) == static_cast(CalloutType::GrpcCall); + } + bool isGrpcStreamId(uint32_t callout_id) { + return (callout_id & kCalloutTypeMask) == static_cast(CalloutType::GrpcStream); + } + uint32_t nextHttpCallId() { + // TODO(PiotrSikora): re-add rollover protection (requires at least 1 billion callouts). + return next_http_call_id_ += kCalloutIncrement; + } + uint32_t nextGrpcCallId() { + // TODO(PiotrSikora): re-add rollover protection (requires at least 1 billion callouts). + return next_grpc_call_id_ += kCalloutIncrement; + } + uint32_t nextGrpcStreamId() { + // TODO(PiotrSikora): re-add rollover protection (requires at least 1 billion callouts). + return next_grpc_stream_id_ += kCalloutIncrement; + } + protected: friend class ContextBase; class ShutdownHandle; @@ -279,50 +302,61 @@ class WasmBase : public std::enable_shared_from_this { uint32_t next_gauge_metric_id_ = static_cast(MetricType::Gauge); uint32_t next_histogram_metric_id_ = static_cast(MetricType::Histogram); + // HTTP/gRPC callouts. + uint32_t next_http_call_id_ = static_cast(CalloutType::HttpCall); + uint32_t next_grpc_call_id_ = static_cast(CalloutType::GrpcCall); + uint32_t next_grpc_stream_id_ = static_cast(CalloutType::GrpcStream); + // Actions to be done after the call into the VM returns. std::deque> after_vm_call_actions_; std::shared_ptr vm_id_handle_; }; +using WasmHandleFactory = std::function(std::string_view vm_id)>; +using WasmHandleCloneFactory = + std::function(std::shared_ptr wasm)>; + // Handle which enables shutdown operations to run post deletion (e.g. post listener drain). class WasmHandleBase : public std::enable_shared_from_this { public: explicit WasmHandleBase(std::shared_ptr wasm_base) : wasm_base_(wasm_base) {} - ~WasmHandleBase() { + virtual ~WasmHandleBase() { if (wasm_base_) { wasm_base_->startShutdown(); } } + virtual bool canary(const std::shared_ptr &plugin, + const WasmHandleCloneFactory &clone_factory); + void kill() { wasm_base_ = nullptr; } std::shared_ptr &wasm() { return wasm_base_; } protected: std::shared_ptr wasm_base_; + std::unordered_map plugin_canary_cache_; }; std::string makeVmKey(std::string_view vm_id, std::string_view configuration, std::string_view code); -using WasmHandleFactory = std::function(std::string_view vm_id)>; -using WasmHandleCloneFactory = - std::function(std::shared_ptr wasm)>; - // Returns nullptr on failure (i.e. initialization of the VM fails). -std::shared_ptr -createWasm(std::string vm_key, std::string code, std::shared_ptr plugin, - WasmHandleFactory factory, WasmHandleCloneFactory clone_factory, bool allow_precompiled); -// Get an existing ThreadLocal VM matching 'vm_id' or nullptr if there isn't one. -std::shared_ptr getThreadLocalWasm(std::string_view vm_id); +std::shared_ptr createWasm(const std::string &vm_key, const std::string &code, + const std::shared_ptr &plugin, + const WasmHandleFactory &factory, + const WasmHandleCloneFactory &clone_factory, + bool allow_precompiled); +// Get an existing ThreadLocal VM matching 'vm_key' or nullptr if there isn't one. +std::shared_ptr getThreadLocalWasm(std::string_view vm_key); class PluginHandleBase : public std::enable_shared_from_this { public: explicit PluginHandleBase(std::shared_ptr wasm_handle, std::shared_ptr plugin) : plugin_(plugin), wasm_handle_(wasm_handle) {} - ~PluginHandleBase() { + virtual ~PluginHandleBase() { if (wasm_handle_) { wasm_handle_->wasm()->startShutdown(plugin_->key()); } @@ -339,11 +373,11 @@ class PluginHandleBase : public std::enable_shared_from_this { using PluginHandleFactory = std::function( std::shared_ptr base_wasm, std::shared_ptr plugin)>; -// Get an existing ThreadLocal VM matching 'vm_id' or create one using 'base_wavm' by cloning or by +// Get an existing ThreadLocal VM matching 'vm_id' or create one using 'base_wasm' by cloning or by // using it it as a template. std::shared_ptr getOrCreateThreadLocalPlugin( - std::shared_ptr base_wasm, std::shared_ptr plugin, - WasmHandleCloneFactory clone_factory, PluginHandleFactory plugin_factory); + const std::shared_ptr &base_handle, const std::shared_ptr &plugin, + const WasmHandleCloneFactory &clone_factory, const PluginHandleFactory &plugin_factory); // Clear Base Wasm cache and the thread-local Wasm sandbox cache for the calling thread. void clearWasmCachesForTesting(); @@ -358,7 +392,15 @@ inline void *WasmBase::allocMemory(uint64_t size, uint64_t *address) { if (!malloc_) { return nullptr; } + wasm_vm_->setRestrictedCallback( + true, {// logging (Proxy-Wasm) + "env.proxy_log", + // logging (stdout/stderr) + "wasi_unstable.fd_write", "wasi_snapshot_preview1.fd_write", + // time + "wasi_unstable.clock_time_get", "wasi_snapshot_preview1.clock_time_get"}); Word a = malloc_(vm_context(), size); + wasm_vm_->setRestrictedCallback(false); if (!a.u64_) { return nullptr; } @@ -374,7 +416,7 @@ inline uint64_t WasmBase::copyString(std::string_view s) { if (s.empty()) { return 0; // nullptr } - uint64_t pointer; + uint64_t pointer = 0; uint8_t *m = static_cast(allocMemory((s.size() + 1), &pointer)); memcpy(m, s.data(), s.size()); m[s.size()] = 0; @@ -405,8 +447,4 @@ template inline bool WasmBase::setDatatype(uint64_t ptr, const T &t return wasm_vm_->setMemory(ptr, sizeof(T), &t); } -struct RegisterForeignFunction { - RegisterForeignFunction(std::string name, WasmForeignFunction f); -}; - } // namespace proxy_wasm diff --git a/include/proxy-wasm/wasm_api_impl.h b/include/proxy-wasm/wasm_api_impl.h index 2529bf2db..899af7e41 100644 --- a/include/proxy-wasm/wasm_api_impl.h +++ b/include/proxy-wasm/wasm_api_impl.h @@ -30,15 +30,13 @@ #include #include +#include "include/proxy-wasm/sdk.h" #include "include/proxy-wasm/exports.h" #include "include/proxy-wasm/word.h" namespace proxy_wasm { namespace null_plugin { -#include "proxy_wasm_enums.h" -#include "proxy_wasm_common.h" - #define WS(_x) Word(static_cast(_x)) #define WR(_x) Word(reinterpret_cast(_x)) @@ -48,55 +46,51 @@ inline WasmResult wordToWasmResult(Word w) { return static_cast(w.u6 inline WasmResult proxy_get_configuration(const char **configuration_ptr, size_t *configuration_size) { return wordToWasmResult( - exports::get_configuration(current_context_, WR(configuration_ptr), WR(configuration_size))); + exports::get_configuration(WR(configuration_ptr), WR(configuration_size))); } inline WasmResult proxy_get_status(uint32_t *code_ptr, const char **ptr, size_t *size) { - return wordToWasmResult(exports::get_status(current_context_, WR(code_ptr), WR(ptr), WR(size))); + return wordToWasmResult(exports::get_status(WR(code_ptr), WR(ptr), WR(size))); } // Logging inline WasmResult proxy_log(LogLevel level, const char *logMessage, size_t messageSize) { - return wordToWasmResult( - exports::log(current_context_, WS(level), WR(logMessage), WS(messageSize))); + return wordToWasmResult(exports::log(WS(level), WR(logMessage), WS(messageSize))); } inline WasmResult proxy_get_log_level(LogLevel *level) { - return wordToWasmResult(exports::get_log_level(current_context_, WR(level))); + return wordToWasmResult(exports::get_log_level(WR(level))); } // Timer inline WasmResult proxy_set_tick_period_milliseconds(uint64_t millisecond) { - return wordToWasmResult( - exports::set_tick_period_milliseconds(current_context_, Word(millisecond))); + return wordToWasmResult(exports::set_tick_period_milliseconds(Word(millisecond))); } inline WasmResult proxy_get_current_time_nanoseconds(uint64_t *result) { - return wordToWasmResult(exports::get_current_time_nanoseconds(current_context_, WR(result))); + return wordToWasmResult(exports::get_current_time_nanoseconds(WR(result))); } // State accessors inline WasmResult proxy_get_property(const char *path_ptr, size_t path_size, const char **value_ptr_ptr, size_t *value_size_ptr) { - return wordToWasmResult(exports::get_property(current_context_, WR(path_ptr), WS(path_size), - WR(value_ptr_ptr), WR(value_size_ptr))); + return wordToWasmResult( + exports::get_property(WR(path_ptr), WS(path_size), WR(value_ptr_ptr), WR(value_size_ptr))); } inline WasmResult proxy_set_property(const char *key_ptr, size_t key_size, const char *value_ptr, size_t value_size) { - return wordToWasmResult(exports::set_property(current_context_, WR(key_ptr), WS(key_size), - WR(value_ptr), WS(value_size))); + return wordToWasmResult( + exports::set_property(WR(key_ptr), WS(key_size), WR(value_ptr), WS(value_size))); } // Continue -inline WasmResult proxy_continue_request() { - return wordToWasmResult(exports::continue_request(current_context_)); -} +inline WasmResult proxy_continue_request() { return wordToWasmResult(exports::continue_request()); } inline WasmResult proxy_continue_response() { - return wordToWasmResult(exports::continue_response(current_context_)); + return wordToWasmResult(exports::continue_response()); } inline WasmResult proxy_continue_stream(WasmStreamType stream_type) { - return wordToWasmResult(exports::continue_stream(current_context_, WS(stream_type))); + return wordToWasmResult(exports::continue_stream(WS(stream_type))); } inline WasmResult proxy_close_stream(WasmStreamType stream_type) { - return wordToWasmResult(exports::close_stream(current_context_, WS(stream_type))); + return wordToWasmResult(exports::close_stream(WS(stream_type))); } inline WasmResult proxy_send_local_response(uint32_t response_code, const char *response_code_details_ptr, @@ -104,28 +98,27 @@ proxy_send_local_response(uint32_t response_code, const char *response_code_deta const char *additional_response_header_pairs_ptr, size_t additional_response_header_pairs_size, uint32_t grpc_status) { return wordToWasmResult(exports::send_local_response( - current_context_, WS(response_code), WR(response_code_details_ptr), - WS(response_code_details_size), WR(body_ptr), WS(body_size), - WR(additional_response_header_pairs_ptr), WS(additional_response_header_pairs_size), - WS(grpc_status))); + WS(response_code), WR(response_code_details_ptr), WS(response_code_details_size), + WR(body_ptr), WS(body_size), WR(additional_response_header_pairs_ptr), + WS(additional_response_header_pairs_size), WS(grpc_status))); } inline WasmResult proxy_clear_route_cache() { - return wordToWasmResult(exports::clear_route_cache(current_context_)); + return wordToWasmResult(exports::clear_route_cache()); } // SharedData inline WasmResult proxy_get_shared_data(const char *key_ptr, size_t key_size, const char **value_ptr, size_t *value_size, uint32_t *cas) { - return wordToWasmResult(exports::get_shared_data(current_context_, WR(key_ptr), WS(key_size), - WR(value_ptr), WR(value_size), WR(cas))); + return wordToWasmResult( + exports::get_shared_data(WR(key_ptr), WS(key_size), WR(value_ptr), WR(value_size), WR(cas))); } // If cas != 0 and cas != the current cas for 'key' return false, otherwise set the value and // return true. inline WasmResult proxy_set_shared_data(const char *key_ptr, size_t key_size, const char *value_ptr, size_t value_size, uint64_t cas) { - return wordToWasmResult(exports::set_shared_data(current_context_, WR(key_ptr), WS(key_size), - WR(value_ptr), WS(value_size), WS(cas))); + return wordToWasmResult( + exports::set_shared_data(WR(key_ptr), WS(key_size), WR(value_ptr), WS(value_size), WS(cas))); } // SharedQueue @@ -134,84 +127,77 @@ inline WasmResult proxy_set_shared_data(const char *key_ptr, size_t key_size, co // proxy_dequeue_shared_queue. Returns unique token for the queue. inline WasmResult proxy_register_shared_queue(const char *queue_name_ptr, size_t queue_name_size, uint32_t *token) { - return wordToWasmResult(exports::register_shared_queue(current_context_, WR(queue_name_ptr), - WS(queue_name_size), WR(token))); + return wordToWasmResult( + exports::register_shared_queue(WR(queue_name_ptr), WS(queue_name_size), WR(token))); } // Returns unique token for the queue. inline WasmResult proxy_resolve_shared_queue(const char *vm_id_ptr, size_t vm_id_size, const char *queue_name_ptr, size_t queue_name_size, uint32_t *token) { - return wordToWasmResult(exports::resolve_shared_queue(current_context_, WR(vm_id_ptr), - WS(vm_id_size), WR(queue_name_ptr), - WS(queue_name_size), WR(token))); + return wordToWasmResult(exports::resolve_shared_queue( + WR(vm_id_ptr), WS(vm_id_size), WR(queue_name_ptr), WS(queue_name_size), WR(token))); } // Returns true on end-of-stream (no more data available). inline WasmResult proxy_dequeue_shared_queue(uint32_t token, const char **data_ptr, size_t *data_size) { - return wordToWasmResult( - exports::dequeue_shared_queue(current_context_, WS(token), WR(data_ptr), WR(data_size))); + return wordToWasmResult(exports::dequeue_shared_queue(WS(token), WR(data_ptr), WR(data_size))); } // Returns false if the queue was not found and the data was not enqueued. inline WasmResult proxy_enqueue_shared_queue(uint32_t token, const char *data_ptr, size_t data_size) { - return wordToWasmResult( - exports::enqueue_shared_queue(current_context_, WS(token), WR(data_ptr), WS(data_size))); + return wordToWasmResult(exports::enqueue_shared_queue(WS(token), WR(data_ptr), WS(data_size))); } // Buffer inline WasmResult proxy_get_buffer_bytes(WasmBufferType type, uint64_t start, uint64_t length, const char **ptr, size_t *size) { - return wordToWasmResult(exports::get_buffer_bytes(current_context_, WS(type), WS(start), - WS(length), WR(ptr), WR(size))); + return wordToWasmResult( + exports::get_buffer_bytes(WS(type), WS(start), WS(length), WR(ptr), WR(size))); } inline WasmResult proxy_get_buffer_status(WasmBufferType type, size_t *length_ptr, uint32_t *flags_ptr) { - return wordToWasmResult( - exports::get_buffer_status(current_context_, WS(type), WR(length_ptr), WR(flags_ptr))); + return wordToWasmResult(exports::get_buffer_status(WS(type), WR(length_ptr), WR(flags_ptr))); } inline WasmResult proxy_set_buffer_bytes(WasmBufferType type, uint64_t start, uint64_t length, const char *data, size_t size) { - return wordToWasmResult(exports::set_buffer_bytes(current_context_, WS(type), WS(start), - WS(length), WR(data), WS(size))); + return wordToWasmResult( + exports::set_buffer_bytes(WS(type), WS(start), WS(length), WR(data), WS(size))); } // Headers/Trailers/Metadata Maps inline WasmResult proxy_add_header_map_value(WasmHeaderMapType type, const char *key_ptr, size_t key_size, const char *value_ptr, size_t value_size) { - return wordToWasmResult(exports::add_header_map_value( - current_context_, WS(type), WR(key_ptr), WS(key_size), WR(value_ptr), WS(value_size))); + return wordToWasmResult(exports::add_header_map_value(WS(type), WR(key_ptr), WS(key_size), + WR(value_ptr), WS(value_size))); } inline WasmResult proxy_get_header_map_value(WasmHeaderMapType type, const char *key_ptr, size_t key_size, const char **value_ptr, size_t *value_size) { - return wordToWasmResult(exports::get_header_map_value( - current_context_, WS(type), WR(key_ptr), WS(key_size), WR(value_ptr), WR(value_size))); + return wordToWasmResult(exports::get_header_map_value(WS(type), WR(key_ptr), WS(key_size), + WR(value_ptr), WR(value_size))); } inline WasmResult proxy_get_header_map_pairs(WasmHeaderMapType type, const char **ptr, size_t *size) { - return wordToWasmResult( - exports::get_header_map_pairs(current_context_, WS(type), WR(ptr), WR(size))); + return wordToWasmResult(exports::get_header_map_pairs(WS(type), WR(ptr), WR(size))); } inline WasmResult proxy_set_header_map_pairs(WasmHeaderMapType type, const char *ptr, size_t size) { - return wordToWasmResult( - exports::set_header_map_pairs(current_context_, WS(type), WR(ptr), WS(size))); + return wordToWasmResult(exports::set_header_map_pairs(WS(type), WR(ptr), WS(size))); } inline WasmResult proxy_replace_header_map_value(WasmHeaderMapType type, const char *key_ptr, size_t key_size, const char *value_ptr, size_t value_size) { - return wordToWasmResult(exports::replace_header_map_value( - current_context_, WS(type), WR(key_ptr), WS(key_size), WR(value_ptr), WS(value_size))); + return wordToWasmResult(exports::replace_header_map_value(WS(type), WR(key_ptr), WS(key_size), + WR(value_ptr), WS(value_size))); } inline WasmResult proxy_remove_header_map_value(WasmHeaderMapType type, const char *key_ptr, size_t key_size) { - return wordToWasmResult( - exports::remove_header_map_value(current_context_, WS(type), WR(key_ptr), WS(key_size))); + return wordToWasmResult(exports::remove_header_map_value(WS(type), WR(key_ptr), WS(key_size))); } inline WasmResult proxy_get_header_map_size(WasmHeaderMapType type, size_t *size) { - return wordToWasmResult(exports::get_header_map_size(current_context_, WS(type), WR(size))); + return wordToWasmResult(exports::get_header_map_size(WS(type), WR(size))); } // HTTP @@ -220,10 +206,10 @@ inline WasmResult proxy_http_call(const char *uri_ptr, size_t uri_size, void *he size_t header_pairs_size, const char *body_ptr, size_t body_size, void *trailer_pairs_ptr, size_t trailer_pairs_size, uint64_t timeout_milliseconds, uint32_t *token_ptr) { - return wordToWasmResult( - exports::http_call(current_context_, WR(uri_ptr), WS(uri_size), WR(header_pairs_ptr), - WS(header_pairs_size), WR(body_ptr), WS(body_size), WR(trailer_pairs_ptr), - WS(trailer_pairs_size), WS(timeout_milliseconds), WR(token_ptr))); + return wordToWasmResult(exports::http_call(WR(uri_ptr), WS(uri_size), WR(header_pairs_ptr), + WS(header_pairs_size), WR(body_ptr), WS(body_size), + WR(trailer_pairs_ptr), WS(trailer_pairs_size), + WS(timeout_milliseconds), WR(token_ptr))); } // gRPC // Returns token, used in gRPC callbacks (onGrpc...) @@ -234,7 +220,7 @@ inline WasmResult proxy_grpc_call(const char *service_ptr, size_t service_size, const char *request_ptr, size_t request_size, uint64_t timeout_milliseconds, uint32_t *token_ptr) { return wordToWasmResult( - exports::grpc_call(current_context_, WR(service_ptr), WS(service_size), WR(service_name_ptr), + exports::grpc_call(WR(service_ptr), WS(service_size), WR(service_name_ptr), WS(service_name_size), WR(method_name_ptr), WS(method_name_size), WR(initial_metadata_ptr), WS(initial_metadata_size), WR(request_ptr), WS(request_size), WS(timeout_milliseconds), WR(token_ptr))); @@ -244,52 +230,52 @@ inline WasmResult proxy_grpc_stream(const char *service_ptr, size_t service_size const char *method_name_ptr, size_t method_name_size, void *initial_metadata_ptr, size_t initial_metadata_size, uint32_t *token_ptr) { - return wordToWasmResult(exports::grpc_stream( - current_context_, WR(service_ptr), WS(service_size), WR(service_name_ptr), - WS(service_name_size), WR(method_name_ptr), WS(method_name_size), WR(initial_metadata_ptr), - WS(initial_metadata_size), WR(token_ptr))); + return wordToWasmResult( + exports::grpc_stream(WR(service_ptr), WS(service_size), WR(service_name_ptr), + WS(service_name_size), WR(method_name_ptr), WS(method_name_size), + WR(initial_metadata_ptr), WS(initial_metadata_size), WR(token_ptr))); } inline WasmResult proxy_grpc_cancel(uint64_t token) { - return wordToWasmResult(exports::grpc_cancel(current_context_, WS(token))); + return wordToWasmResult(exports::grpc_cancel(WS(token))); } inline WasmResult proxy_grpc_close(uint64_t token) { - return wordToWasmResult(exports::grpc_close(current_context_, WS(token))); + return wordToWasmResult(exports::grpc_close(WS(token))); } inline WasmResult proxy_grpc_send(uint64_t token, const char *message_ptr, size_t message_size, uint64_t end_stream) { - return wordToWasmResult(exports::grpc_send(current_context_, WS(token), WR(message_ptr), - WS(message_size), WS(end_stream))); + return wordToWasmResult( + exports::grpc_send(WS(token), WR(message_ptr), WS(message_size), WS(end_stream))); } // Metrics // Returns a metric_id which can be used to report a metric. On error returns 0. inline WasmResult proxy_define_metric(MetricType type, const char *name_ptr, size_t name_size, uint32_t *metric_id) { - return wordToWasmResult(exports::define_metric(current_context_, WS(type), WR(name_ptr), - WS(name_size), WR(metric_id))); + return wordToWasmResult( + exports::define_metric(WS(type), WR(name_ptr), WS(name_size), WR(metric_id))); } inline WasmResult proxy_increment_metric(uint32_t metric_id, int64_t offset) { - return wordToWasmResult(exports::increment_metric(current_context_, WS(metric_id), offset)); + return wordToWasmResult(exports::increment_metric(WS(metric_id), offset)); } inline WasmResult proxy_record_metric(uint32_t metric_id, uint64_t value) { - return wordToWasmResult(exports::record_metric(current_context_, WS(metric_id), value)); + return wordToWasmResult(exports::record_metric(WS(metric_id), value)); } inline WasmResult proxy_get_metric(uint32_t metric_id, uint64_t *value) { - return wordToWasmResult(exports::get_metric(current_context_, WS(metric_id), WR(value))); + return wordToWasmResult(exports::get_metric(WS(metric_id), WR(value))); } // System inline WasmResult proxy_set_effective_context(uint64_t context_id) { - return wordToWasmResult(exports::set_effective_context(current_context_, WS(context_id))); + return wordToWasmResult(exports::set_effective_context(WS(context_id))); } -inline WasmResult proxy_done() { return wordToWasmResult(exports::done(current_context_)); } +inline WasmResult proxy_done() { return wordToWasmResult(exports::done()); } inline WasmResult proxy_call_foreign_function(const char *function_name, size_t function_name_size, const char *arguments, size_t arguments_size, char **results, size_t *results_size) { - return wordToWasmResult(exports::call_foreign_function( - current_context_, WR(function_name), WS(function_name_size), WR(arguments), - WS(arguments_size), WR(results), WR(results_size))); + return wordToWasmResult(exports::call_foreign_function(WR(function_name), WS(function_name_size), + WR(arguments), WS(arguments_size), + WR(results), WR(results_size))); } #undef WS diff --git a/include/proxy-wasm/wasm_vm.h b/include/proxy-wasm/wasm_vm.h index 7c484fe61..9a2f0a6a0 100644 --- a/include/proxy-wasm/wasm_vm.h +++ b/include/proxy-wasm/wasm_vm.h @@ -19,47 +19,54 @@ #include #include #include +#include #include +#include +#include +#include "include/proxy-wasm/sdk.h" #include "include/proxy-wasm/word.h" namespace proxy_wasm { -#include "proxy_wasm_enums.h" - class ContextBase; -// These are templates and its helper for constructing signatures of functions calling into and out -// of WASM VMs. -// - WasmFuncTypeHelper is a helper for WasmFuncType and shouldn't be used anywhere else than +// These are templates and its helper for constructing signatures of functions calling into Wasm +// VMs. +// - WasmCallInFuncTypeHelper is a helper for WasmFuncType and shouldn't be used anywhere else than // WasmFuncType definition. -// - WasmFuncType takes 4 template parameter which are number of argument, return type, context type -// and param type respectively, resolve to a function type. +// - WasmCallInFuncType takes 4 template parameter which are number of argument, return type, +// context type and param type respectively, resolve to a function type. // For example `WasmFuncType<3, void, Context*, Word>` resolves to `void(Context*, Word, Word, // Word)` template -struct WasmFuncTypeHelper {}; +struct WasmCallInFuncTypeHelper {}; template -struct WasmFuncTypeHelper { +struct WasmCallInFuncTypeHelper { // NOLINTNEXTLINE(readability-identifier-naming) - using type = typename WasmFuncTypeHelper::type; + using type = typename WasmCallInFuncTypeHelper::type; }; template -struct WasmFuncTypeHelper<0, ReturnType, ContextType, ParamType, ReturnType(ContextType, Args...)> { +struct WasmCallInFuncTypeHelper<0, ReturnType, ContextType, ParamType, + ReturnType(ContextType, Args...)> { using type = ReturnType(ContextType, Args...); // NOLINT(readability-identifier-naming) }; template -using WasmFuncType = typename WasmFuncTypeHelper::type; +using WasmCallInFuncType = + typename WasmCallInFuncTypeHelper::type; // Calls into the WASM VM. // 1st arg is always a pointer to Context (Context*). -template using WasmCallVoid = std::function>; -template using WasmCallWord = std::function>; +template +using WasmCallVoid = std::function>; +template +using WasmCallWord = std::function>; #define FOR_ALL_WASM_VM_EXPORTS(_f) \ _f(proxy_wasm::WasmCallVoid<0>) _f(proxy_wasm::WasmCallVoid<1>) _f(proxy_wasm::WasmCallVoid<2>) \ @@ -67,20 +74,46 @@ template using WasmCallWord = std::function) _f(proxy_wasm::WasmCallWord<2>) \ _f(proxy_wasm::WasmCallWord<3>) +// These are templates and its helper for constructing signatures of functions callbacks from Wasm +// VMs. +// - WasmCallbackFuncTypeHelper is a helper for WasmFuncType and shouldn't be used anywhere else +// than WasmFuncType definition. +// - WasmCallbackFuncType takes 3 template parameter which are number of argument, return type, and +// param type respectively, resolve to a function type. +// For example `WasmFuncType<3, Word>` resolves to `void(Word, Word, Word)` +template +struct WasmCallbackFuncTypeHelper {}; + +template +struct WasmCallbackFuncTypeHelper { + // NOLINTNEXTLINE(readability-identifier-naming) + using type = typename WasmCallbackFuncTypeHelper::type; +}; + +template +struct WasmCallbackFuncTypeHelper<0, ReturnType, ParamType, ReturnType(Args...)> { + using type = ReturnType(Args...); // NOLINT(readability-identifier-naming) +}; + +template +using WasmCallbackFuncType = typename WasmCallbackFuncTypeHelper::type; + // Calls out of the WASM VM. -// 1st arg is always a pointer to raw_context (void*). -template using WasmCallbackVoid = WasmFuncType *; -template using WasmCallbackWord = WasmFuncType *; +template using WasmCallbackVoid = WasmCallbackFuncType *; +template using WasmCallbackWord = WasmCallbackFuncType *; // Using the standard g++/clang mangling algorithm: // https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-builtin // Extended with W = Word // Z = void, j = uint32_t, l = int64_t, m = uint64_t -using WasmCallback_WWl = Word (*)(void *, Word, int64_t); -using WasmCallback_WWlWW = Word (*)(void *, Word, int64_t, Word, Word); -using WasmCallback_WWm = Word (*)(void *, Word, uint64_t); -using WasmCallback_WWmW = Word (*)(void *, Word, uint64_t, Word); -using WasmCallback_dd = double (*)(void *, double); +using WasmCallback_WWl = Word (*)(Word, int64_t); +using WasmCallback_WWlWW = Word (*)(Word, int64_t, Word, Word); +using WasmCallback_WWm = Word (*)(Word, uint64_t); +using WasmCallback_WWmW = Word (*)(Word, uint64_t, Word); +using WasmCallback_WWWWWWllWW = Word (*)(Word, Word, Word, Word, Word, int64_t, int64_t, Word, + Word); +using WasmCallback_dd = double (*)(double); #define FOR_ALL_WASM_VM_IMPORTS(_f) \ _f(proxy_wasm::WasmCallbackVoid<0>) _f(proxy_wasm::WasmCallbackVoid<1>) \ @@ -97,7 +130,8 @@ using WasmCallback_dd = double (*)(void *, double); _f(proxy_wasm::WasmCallback_WWlWW) \ _f(proxy_wasm::WasmCallback_WWm) \ _f(proxy_wasm::WasmCallback_WWmW) \ - _f(proxy_wasm::WasmCallback_dd) + _f(proxy_wasm::WasmCallback_WWWWWWllWW) \ + _f(proxy_wasm::WasmCallback_dd) enum class Cloneable { NotCloneable, // VMs can not be cloned and should be created from scratch. @@ -109,12 +143,25 @@ enum class AbiVersion { ProxyWasm_0_1_0, ProxyWasm_0_2_0, ProxyWasm_0_2_1, Unkno class NullPlugin; +enum class FailState : int { + Ok = 0, + UnableToCreateVm = 1, + UnableToCloneVm = 2, + MissingFunction = 3, + UnableToInitializeCode = 4, + StartFailed = 5, + ConfigureFailed = 6, + RuntimeError = 7, +}; + // Integrator specific WasmVm operations. struct WasmVmIntegration { virtual ~WasmVmIntegration() {} virtual WasmVmIntegration *clone() = 0; virtual proxy_wasm::LogLevel getLogLevel() = 0; virtual void error(std::string_view message) = 0; + // Allow integrations to handle specific FailStates differently. + virtual void error(FailState fail_state, std::string_view message) { error(message); } virtual void trace(std::string_view message) = 0; // Get a NullVm implementation of a function. // @param function_name is the name of the function with the implementation specific prefix. @@ -131,34 +178,22 @@ struct WasmVmIntegration { void *ptr_to_function_return) = 0; }; -enum class FailState : int { - Ok = 0, - UnableToCreateVm = 1, - UnableToCloneVm = 2, - MissingFunction = 3, - UnableToInitializeCode = 4, - StartFailed = 5, - ConfigureFailed = 6, - RuntimeError = 7, -}; - // Wasm VM instance. Provides the low level WASM interface. class WasmVm { public: virtual ~WasmVm() = default; /** - * Return the runtime identifier. - * @return one of WasmRuntimeValues from well_known_names.h (e.g. "v8"). + * Identify the Wasm engine. + * @return the name of the underlying Wasm engine. */ - virtual std::string_view runtime() = 0; + virtual std::string_view getEngineName() = 0; /** * Whether or not the VM implementation supports cloning. Cloning is VM system dependent. * When a VM is configured a single VM is instantiated to check that the .wasm file is valid and - * to do VM system specific initialization. In the case of WAVM this is potentially ahead-of-time - * compilation. Then, if cloning is supported, we clone that VM for each worker, potentially - * copying and sharing the initialized data structures for efficiency. Otherwise we create an new - * VM from scratch for each worker. + * to do VM system specific initialization. Then, if cloning is supported, we clone that VM for + * each worker, potentially copying and sharing the initialized data structures for efficiency. + * Otherwise we create an new VM from scratch for each worker. * @return one of enum Cloneable with the VMs cloneability. */ virtual Cloneable cloneable() = 0; @@ -181,7 +216,7 @@ class WasmVm { * @return whether or not the load was successful. */ virtual bool load(std::string_view bytecode, std::string_view precompiled, - const std::unordered_map function_names) = 0; + const std::unordered_map &function_names) = 0; /** * Link the WASM code to the host-provided functions, e.g. the ABI. Prior to linking, the module @@ -264,16 +299,39 @@ class WasmVm { FOR_ALL_WASM_VM_IMPORTS(_REGISTER_CALLBACK) #undef _REGISTER_CALLBACK + /** + * Terminate execution of this WasmVM. It shouldn't be used after being terminated. + */ + virtual void terminate() = 0; + + /** + * Byte order flag (host or wasm). + * @return 'false' for a null VM and 'true' for a wasm VM. + */ + virtual bool usesWasmByteOrder() = 0; + + virtual void warm() {} + bool isFailed() { return failed_ != FailState::Ok; } void fail(FailState fail_state, std::string_view message) { - integration()->error(message); + integration()->error(fail_state, message); failed_ = fail_state; - if (fail_callback_) { - fail_callback_(fail_state); + for (auto &callback : fail_callbacks_) { + callback(fail_state); } } - void setFailCallback(std::function fail_callback) { - fail_callback_ = fail_callback; + void addFailCallback(std::function fail_callback) { + fail_callbacks_.push_back(fail_callback); + } + + bool isHostFunctionAllowed(const std::string &name) { + return !restricted_callback_ || allowed_hostcalls_.find(name) != allowed_hostcalls_.end(); + } + + void setRestrictedCallback(bool restricted, + std::unordered_set allowed_hostcalls = {}) { + restricted_callback_ = restricted; + allowed_hostcalls_ = std::move(allowed_hostcalls); } // Integrator operations. @@ -283,7 +341,11 @@ class WasmVm { protected: std::unique_ptr integration_; FailState failed_ = FailState::Ok; - std::function fail_callback_; + std::vector> fail_callbacks_; + +private: + bool restricted_callback_{false}; + std::unordered_set allowed_hostcalls_{}; }; // Thread local state set during a call into a WASM VM so that calls coming out of the diff --git a/include/proxy-wasm/wavm.h b/include/proxy-wasm/wasmedge.h similarity index 94% rename from include/proxy-wasm/wavm.h rename to include/proxy-wasm/wasmedge.h index 1ebbe8397..f0b2141ce 100644 --- a/include/proxy-wasm/wavm.h +++ b/include/proxy-wasm/wasmedge.h @@ -21,6 +21,6 @@ namespace proxy_wasm { -std::unique_ptr createWavmVm(); +std::unique_ptr createWasmEdgeVm(); } // namespace proxy_wasm diff --git a/include/proxy-wasm/word.h b/include/proxy-wasm/word.h index e96fdfb94..bc0d23a8c 100644 --- a/include/proxy-wasm/word.h +++ b/include/proxy-wasm/word.h @@ -17,9 +17,19 @@ #include +#include "include/proxy-wasm/sdk.h" + namespace proxy_wasm { -#include "proxy_wasm_common.h" +// Use byteswap functions only when compiling for big-endian platforms. +#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \ + __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define htowasm(x, vm_uses_wasm_byte_order) ((vm_uses_wasm_byte_order) ? __builtin_bswap32(x) : (x)) +#define wasmtoh(x, vm_uses_wasm_byte_order) ((vm_uses_wasm_byte_order) ? __builtin_bswap32(x) : (x)) +#else +#define htowasm(x, vm_uses_wasm_byte_order) (x) +#define wasmtoh(x, vm_uses_wasm_byte_order) (x) +#endif // Represents a Wasm-native word-sized datum. On 32-bit VMs, the high bits are always zero. // The Wasm/VM API treats all bits as significant. diff --git a/src/bytecode_util.cc b/src/bytecode_util.cc index 22866c3a7..70a373e01 100644 --- a/src/bytecode_util.cc +++ b/src/bytecode_util.cc @@ -14,6 +14,10 @@ #include "include/proxy-wasm/bytecode_util.h" +#if !defined(_MSC_VER) +#include +#endif + #include namespace proxy_wasm { @@ -21,7 +25,7 @@ namespace proxy_wasm { bool BytecodeUtil::checkWasmHeader(std::string_view bytecode) { // Wasm file header is 8 bytes (magic number + version). static const uint8_t wasm_magic_number[4] = {0x00, 0x61, 0x73, 0x6d}; - return bytecode.size() < 8 || !::memcmp(bytecode.data(), wasm_magic_number, 4); + return (bytecode.size() < 8 || ::memcmp(bytecode.data(), wasm_magic_number, 4) == 0); } bool BytecodeUtil::getAbiVersion(std::string_view bytecode, proxy_wasm::AbiVersion &ret) { @@ -44,33 +48,38 @@ bool BytecodeUtil::getAbiVersion(std::string_view bytecode, proxy_wasm::AbiVersi return false; } if (section_type == 7 /* export section */) { + const char *section_end = pos + section_len; uint32_t export_vector_size = 0; - if (!parseVarint(pos, end, export_vector_size) || pos + export_vector_size > end) { + if (!parseVarint(pos, section_end, export_vector_size) || + pos + export_vector_size > section_end) { return false; } // Search thourgh exports. for (uint32_t i = 0; i < export_vector_size; i++) { // Parse name of the export. uint32_t export_name_size = 0; - if (!parseVarint(pos, end, export_name_size) || pos + export_name_size > end) { + if (!parseVarint(pos, section_end, export_name_size) || + pos + export_name_size > section_end) { return false; } - const auto name_begin = pos; + const auto *const name_begin = pos; pos += export_name_size; if (pos + 1 > end) { return false; } // Check if it is a function type export - if (*pos++ == 0x00) { + if (*pos++ == 0x00 /* function */) { const std::string export_name = {name_begin, export_name_size}; // Check the name of the function. if (export_name == "proxy_abi_version_0_1_0") { ret = AbiVersion::ProxyWasm_0_1_0; return true; - } else if (export_name == "proxy_abi_version_0_2_0") { + } + if (export_name == "proxy_abi_version_0_2_0") { ret = AbiVersion::ProxyWasm_0_2_0; return true; - } else if (export_name == "proxy_abi_version_0_2_1") { + } + if (export_name == "proxy_abi_version_0_2_1") { ret = AbiVersion::ProxyWasm_0_2_1; return true; } @@ -81,9 +90,8 @@ bool BytecodeUtil::getAbiVersion(std::string_view bytecode, proxy_wasm::AbiVersi } } return true; - } else { - pos += section_len; } + pos += section_len; } return true; } @@ -109,24 +117,25 @@ bool BytecodeUtil::getCustomSection(std::string_view bytecode, std::string_view } if (section_type == 0) { // Custom section. - const auto section_data_start = pos; + const char *section_end = pos + section_len; uint32_t section_name_len = 0; - if (!BytecodeUtil::parseVarint(pos, end, section_name_len) || pos + section_name_len > end) { + if (!BytecodeUtil::parseVarint(pos, section_end, section_name_len) || + pos + section_name_len > section_end) { return false; } if (section_name_len == name.size() && ::memcmp(pos, name.data(), section_name_len) == 0) { pos += section_name_len; - ret = {pos, static_cast(section_data_start + section_len - pos)}; + ret = {pos, static_cast(section_end - pos)}; return true; } - pos = section_data_start + section_len; + pos = section_end; } else { // Skip other sections. pos += section_len; } } return true; -}; +} bool BytecodeUtil::getFunctionNameIndex(std::string_view bytecode, std::unordered_map &ret) { @@ -149,7 +158,7 @@ bool BytecodeUtil::getFunctionNameIndex(std::string_view bytecode, pos += subsection_size; } else { // Enters function name subsection. - const auto start = pos; + const auto *const start = pos; uint32_t namemap_vector_size = 0; if (!parseVarint(pos, end, namemap_vector_size) || pos + namemap_vector_size > end) { return false; @@ -164,7 +173,16 @@ bool BytecodeUtil::getFunctionNameIndex(std::string_view bytecode, if (!parseVarint(pos, end, func_name_size) || pos + func_name_size > end) { return false; } - ret.insert({func_index, std::string(pos, func_name_size)}); + auto func_name = std::string(pos, func_name_size); +#if !defined(_MSC_VER) + int status; + char *data = abi::__cxa_demangle(func_name.c_str(), nullptr, nullptr, &status); + if (data != nullptr) { + func_name = std::string(data); + ::free(data); + } +#endif + ret.insert({func_index, func_name}); pos += func_name_size; } if (start + subsection_size != pos) { @@ -186,7 +204,7 @@ bool BytecodeUtil::getStrippedSource(std::string_view bytecode, std::string &ret const char *pos = bytecode.data() + 8; const char *end = bytecode.data() + bytecode.size(); while (pos < end) { - const auto section_start = pos; + const auto *const section_start = pos; if (pos + 1 > end) { return false; } @@ -196,7 +214,7 @@ bool BytecodeUtil::getStrippedSource(std::string_view bytecode, std::string &ret return false; } if (section_type == 0 /* custom section */) { - const auto section_data_start = pos; + const auto *const section_data_start = pos; uint32_t section_name_len = 0; if (!parseVarint(pos, end, section_name_len) || pos + section_name_len > end) { return false; @@ -228,16 +246,32 @@ bool BytecodeUtil::getStrippedSource(std::string_view bytecode, std::string &ret bool BytecodeUtil::parseVarint(const char *&pos, const char *end, uint32_t &ret) { uint32_t shift = 0; + uint32_t total = 0; + uint32_t v; char b; - do { + while (pos < end) { if (pos + 1 > end) { + // overread return false; } b = *pos++; - ret += (b & 0x7f) << shift; + v = (b & 0x7f); + if (shift == 28 && v > 3) { + // overflow + return false; + } + total += v << shift; + if ((b & 0x80) == 0) { + ret = total; + return true; + } shift += 7; - } while ((b & 0x80) != 0); - return ret != static_cast(-1); + if (shift > 28) { + // overflow + return false; + } + } + return false; } } // namespace proxy_wasm diff --git a/src/common/types.h b/src/common/types.h index 82803c9dc..0ac4c13aa 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -16,8 +16,7 @@ #include -namespace proxy_wasm { -namespace common { +namespace proxy_wasm::common { template class CSmartPtr : public std::unique_ptr { @@ -36,5 +35,4 @@ template class CSma T item; }; -} // namespace common -} // namespace proxy_wasm +} // namespace proxy_wasm::common diff --git a/src/context.cc b/src/context.cc index 8a69aec5f..d8dbc9a2a 100644 --- a/src/context.cc +++ b/src/context.cc @@ -22,6 +22,7 @@ #include "include/proxy-wasm/context.h" #include "include/proxy-wasm/wasm.h" +#include "src/hash.h" #include "src/shared_data.h" #include "src/shared_queue.h" @@ -29,7 +30,8 @@ if (isFailed()) { \ if (plugin_->fail_open_) { \ return _return_open; \ - } else if (!stream_failed_) { \ + } \ + if (!stream_failed_) { \ failStream(_stream_type); \ failStream(_stream_type2); \ stream_failed_ = true; \ @@ -84,13 +86,18 @@ std::string PluginBase::makeLogPrefix() const { return prefix; } +std::string PluginBase::makePluginKey(std::string_view root_id, + std::string_view plugin_configuration, std::string_view key) { + return Sha256String({root_id, "||", plugin_configuration, "||", key}); +} + ContextBase::ContextBase() : parent_context_(this) {} ContextBase::ContextBase(WasmBase *wasm) : wasm_(wasm), parent_context_(this) { wasm_->contexts_[id_] = this; } -ContextBase::ContextBase(WasmBase *wasm, std::shared_ptr plugin) +ContextBase::ContextBase(WasmBase *wasm, const std::shared_ptr &plugin) : wasm_(wasm), id_(wasm->allocContextId()), parent_context_(this), root_id_(plugin->root_id_), root_log_prefix_(makeRootLogPrefix(plugin->vm_id_)), plugin_(plugin) { wasm_->contexts_[id_] = this; @@ -98,10 +105,11 @@ ContextBase::ContextBase(WasmBase *wasm, std::shared_ptr plugin) // NB: wasm can be nullptr if it failed to be created successfully. ContextBase::ContextBase(WasmBase *wasm, uint32_t parent_context_id, - std::shared_ptr plugin_handle) - : wasm_(wasm), id_(wasm ? wasm->allocContextId() : 0), parent_context_id_(parent_context_id), - plugin_(plugin_handle->plugin()), plugin_handle_(plugin_handle) { - if (wasm_) { + const std::shared_ptr &plugin_handle) + : wasm_(wasm), id_(wasm != nullptr ? wasm->allocContextId() : 0), + parent_context_id_(parent_context_id), plugin_(plugin_handle->plugin()), + plugin_handle_(plugin_handle) { + if (wasm_ != nullptr) { wasm_->contexts_[id_] = this; parent_context_ = wasm_->contexts_[parent_context_id_]; } @@ -109,7 +117,7 @@ ContextBase::ContextBase(WasmBase *wasm, uint32_t parent_context_id, WasmVm *ContextBase::wasmVm() const { return wasm_->wasm_vm(); } -bool ContextBase::isFailed() { return !wasm_ || wasm_->isFailed(); } +bool ContextBase::isFailed() { return (wasm_ == nullptr || wasm_->isFailed()); } std::string ContextBase::makeRootLogPrefix(std::string_view vm_id) const { std::string prefix; @@ -175,7 +183,7 @@ bool ContextBase::onConfigure(std::shared_ptr plugin) { void ContextBase::onCreate() { if (!isFailed() && !in_vm_context_created_ && wasm_->on_context_create_) { DeferAfterCallActions actions(this); - wasm_->on_context_create_(this, id_, parent_context_ ? parent_context()->id() : 0); + wasm_->on_context_create_(this, id_, parent_context_ != nullptr ? parent_context()->id() : 0); } // NB: If no on_context_create function is registered the in-VM SDK is responsible for // managing any required in-VM state. @@ -192,23 +200,32 @@ WasmResult ContextBase::setSharedData(std::string_view key, std::string_view val return getGlobalSharedData().set(wasm_->vm_id(), key, value, cas); } +WasmResult ContextBase::getSharedDataKeys(std::vector *result) { + return getGlobalSharedData().keys(wasm_->vm_id(), result); +} + +WasmResult ContextBase::removeSharedDataKey(std::string_view key, uint32_t cas, + std::pair *result) { + return getGlobalSharedData().remove(wasm_->vm_id(), key, cas, result); +} + // Shared Queue WasmResult ContextBase::registerSharedQueue(std::string_view queue_name, - SharedQueueDequeueToken *result) { + SharedQueueDequeueToken *token_ptr) { // Get the id of the root context if this is a stream context because onQueueReady is on the // root. - *result = getGlobalSharedQueue().registerQueue(wasm_->vm_id(), queue_name, - isRootContext() ? id_ : parent_context_id_, - wasm_->callOnThreadFunction(), wasm_->vm_key()); + *token_ptr = getGlobalSharedQueue().registerQueue(wasm_->vm_id(), queue_name, + isRootContext() ? id_ : parent_context_id_, + wasm_->callOnThreadFunction(), wasm_->vm_key()); return WasmResult::Ok; } WasmResult ContextBase::lookupSharedQueue(std::string_view vm_id, std::string_view queue_name, - uint32_t *token_ptr) { - uint32_t token = + SharedQueueDequeueToken *token_ptr) { + SharedQueueDequeueToken token = getGlobalSharedQueue().resolveQueue(vm_id.empty() ? wasm_->vm_id() : vm_id, queue_name); - if (isFailed() || !token) { + if (isFailed() || token == 0U) { return WasmResult::NotFound; } *token_ptr = token; @@ -230,7 +247,7 @@ void ContextBase::destroy() { onDone(); } -void ContextBase::onTick(uint32_t) { +void ContextBase::onTick(uint32_t /*token*/) { if (!isFailed() && wasm_->on_tick_) { DeferAfterCallActions actions(this); wasm_->on_tick_(this, id_); @@ -312,14 +329,14 @@ FilterHeadersStatus ContextBase::onRequestHeaders(uint32_t headers, bool end_of_ return convertVmCallResultToFilterHeadersStatus(result); } -FilterDataStatus ContextBase::onRequestBody(uint32_t data_length, bool end_of_stream) { +FilterDataStatus ContextBase::onRequestBody(uint32_t body_length, bool end_of_stream) { CHECK_FAIL_HTTP(FilterDataStatus::Continue, FilterDataStatus::StopIterationNoBuffer); if (!wasm_->on_request_body_) { return FilterDataStatus::Continue; } DeferAfterCallActions actions(this); const auto result = - wasm_->on_request_body_(this, id_, data_length, static_cast(end_of_stream)); + wasm_->on_request_body_(this, id_, body_length, static_cast(end_of_stream)); CHECK_FAIL_HTTP(FilterDataStatus::Continue, FilterDataStatus::StopIterationNoBuffer); return convertVmCallResultToFilterDataStatus(result); } @@ -476,10 +493,12 @@ FilterHeadersStatus ContextBase::convertVmCallResultToFilterHeadersStatus(uint64 result > static_cast(FilterHeadersStatus::StopAllIterationAndWatermark)) { return FilterHeadersStatus::StopAllIterationAndWatermark; } - if (result == static_cast(FilterHeadersStatus::StopIteration)) { - // Always convert StopIteration (pause processing headers, but continue processing body) - // to StopAllIterationAndWatermark (pause all processing), since the former breaks all - // assumptions about HTTP processing. + if (result == static_cast(FilterHeadersStatus::StopIteration) && + !allow_on_headers_stop_iteration_) { + // Default behavior for Proxy-Wasm 0.2.* ABI is to translate StopIteration + // (pause processing headers, but continue processing body) to + // StopAllIterationAndWatermark (pause all processing), as described in + // https://github.com/proxy-wasm/proxy-wasm-cpp-host/issues/143. return FilterHeadersStatus::StopAllIterationAndWatermark; } return static_cast(result); @@ -510,7 +529,7 @@ FilterMetadataStatus ContextBase::convertVmCallResultToFilterMetadataStatus(uint ContextBase::~ContextBase() { // Do not remove vm context which has the same lifetime as wasm_. - if (id_) { + if (id_ != 0U) { wasm_->contexts_.erase(id_); } } diff --git a/src/exports.cc b/src/exports.cc index 9a2d9a03a..25ca06c9d 100644 --- a/src/exports.cc +++ b/src/exports.cc @@ -13,86 +13,56 @@ // See the License for the specific language governing permissions and // limitations under the License. // +#include "include/proxy-wasm/limits.h" +#include "include/proxy-wasm/pairs_util.h" #include "include/proxy-wasm/wasm.h" #include -#define WASM_CONTEXT(_c) \ - (ContextOrEffectiveContext(static_cast((void)_c, current_context_))) +#include namespace proxy_wasm { -// The id of the context which should be used for calls out of the VM in place -// of current_context_. -extern thread_local uint32_t effective_context_id_; +thread_local ContextBase *current_context_; +thread_local uint32_t effective_context_id_ = 0; -namespace exports { - -ContextBase *ContextOrEffectiveContext(ContextBase *context) { +// Any currently executing Wasm call context. +ContextBase *contextOrEffectiveContext() { if (effective_context_id_ == 0) { - return context; + return current_context_; } - auto effective_context = context->wasm()->getContext(effective_context_id_); - if (effective_context) { + auto *effective_context = current_context_->wasm()->getContext(effective_context_id_); + if (effective_context != nullptr) { return effective_context; } // The effective_context_id_ no longer exists, revert to the true context. - return context; -} + return current_context_; +}; -namespace { +std::unordered_map &foreignFunctions() { + static auto *ptr = new std::unordered_map; + return *ptr; +} -Pairs toPairs(std::string_view buffer) { - Pairs result; - const char *b = buffer.data(); - if (buffer.size() < sizeof(uint32_t)) { - return {}; - } - auto size = *reinterpret_cast(b); - b += sizeof(uint32_t); - if (sizeof(uint32_t) + size * 2 * sizeof(uint32_t) > buffer.size()) { - return {}; - } - result.resize(size); - for (uint32_t i = 0; i < size; i++) { - result[i].first = std::string_view(nullptr, *reinterpret_cast(b)); - b += sizeof(uint32_t); - result[i].second = std::string_view(nullptr, *reinterpret_cast(b)); - b += sizeof(uint32_t); - } - for (auto &p : result) { - p.first = std::string_view(b, p.first.size()); - b += p.first.size() + 1; - p.second = std::string_view(b, p.second.size()); - b += p.second.size() + 1; +WasmForeignFunction getForeignFunction(std::string_view function_name) { + auto foreign_functions = foreignFunctions(); + auto it = foreign_functions.find(std::string(function_name)); + if (it != foreign_functions.end()) { + return it->second; } - return result; + return nullptr; } -template -bool getPairs(ContextBase *context, const Pairs &result, uint64_t ptr_ptr, uint64_t size_ptr) { - if (result.empty()) { - return context->wasm()->copyToPointerSize("", ptr_ptr, size_ptr); - } - uint64_t size = pairsSize(result); - uint64_t ptr; - char *buffer = static_cast(context->wasm()->allocMemory(size, &ptr)); - marshalPairs(result, buffer); - if (!context->wasmVm()->setWord(ptr_ptr, Word(ptr))) { - return false; - } - if (!context->wasmVm()->setWord(size_ptr, Word(size))) { - return false; - } - return true; +RegisterForeignFunction::RegisterForeignFunction(const std::string &name, WasmForeignFunction f) { + foreignFunctions()[name] = std::move(f); } -} // namespace +namespace exports { // General ABI. -Word set_property(void *raw_context, Word key_ptr, Word key_size, Word value_ptr, Word value_size) { - auto context = WASM_CONTEXT(raw_context); +Word set_property(Word key_ptr, Word key_size, Word value_ptr, Word value_size) { + auto *context = contextOrEffectiveContext(); auto key = context->wasmVm()->getMemory(key_ptr, key_size); auto value = context->wasmVm()->getMemory(value_ptr, value_size); if (!key || !value) { @@ -102,9 +72,8 @@ Word set_property(void *raw_context, Word key_ptr, Word key_size, Word value_ptr } // Generic selector -Word get_property(void *raw_context, Word path_ptr, Word path_size, Word value_ptr_ptr, - Word value_size_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word get_property(Word path_ptr, Word path_size, Word value_ptr_ptr, Word value_size_ptr) { + auto *context = contextOrEffectiveContext(); auto path = context->wasmVm()->getMemory(path_ptr, path_size); if (!path.has_value()) { return WasmResult::InvalidMemoryAccess; @@ -120,8 +89,8 @@ Word get_property(void *raw_context, Word path_ptr, Word path_size, Word value_p return WasmResult::Ok; } -Word get_configuration(void *raw_context, Word value_ptr_ptr, Word value_size_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word get_configuration(Word value_ptr_ptr, Word value_size_ptr) { + auto *context = contextOrEffectiveContext(); auto value = context->getConfiguration(); if (!context->wasm()->copyToPointerSize(value, value_ptr_ptr, value_size_ptr)) { return WasmResult::InvalidMemoryAccess; @@ -129,8 +98,8 @@ Word get_configuration(void *raw_context, Word value_ptr_ptr, Word value_size_pt return WasmResult::Ok; } -Word get_status(void *raw_context, Word code_ptr, Word value_ptr_ptr, Word value_size_ptr) { - auto context = WASM_CONTEXT(raw_context)->root_context(); +Word get_status(Word code_ptr, Word value_ptr_ptr, Word value_size_ptr) { + auto *context = contextOrEffectiveContext()->root_context(); auto status = context->getStatus(); if (!context->wasm()->setDatatype(code_ptr, status.first)) { return WasmResult::InvalidMemoryAccess; @@ -144,37 +113,37 @@ Word get_status(void *raw_context, Word code_ptr, Word value_ptr_ptr, Word value // HTTP // Continue/Reply/Route -Word continue_request(void *raw_context) { - auto context = WASM_CONTEXT(raw_context); +Word continue_request() { + auto *context = contextOrEffectiveContext(); return context->continueStream(WasmStreamType::Request); } -Word continue_response(void *raw_context) { - auto context = WASM_CONTEXT(raw_context); +Word continue_response() { + auto *context = contextOrEffectiveContext(); return context->continueStream(WasmStreamType::Response); } -Word continue_stream(void *raw_context, Word type) { - auto context = WASM_CONTEXT(raw_context); +Word continue_stream(Word type) { + auto *context = contextOrEffectiveContext(); if (type > static_cast(WasmStreamType::MAX)) { return WasmResult::BadArgument; } return context->continueStream(static_cast(type.u64_)); } -Word close_stream(void *raw_context, Word type) { - auto context = WASM_CONTEXT(raw_context); +Word close_stream(Word type) { + auto *context = contextOrEffectiveContext(); if (type > static_cast(WasmStreamType::MAX)) { return WasmResult::BadArgument; } return context->closeStream(static_cast(type.u64_)); } -Word send_local_response(void *raw_context, Word response_code, Word response_code_details_ptr, +Word send_local_response(Word response_code, Word response_code_details_ptr, Word response_code_details_size, Word body_ptr, Word body_size, Word additional_response_header_pairs_ptr, - Word additional_response_header_pairs_size, Word grpc_code) { - auto context = WASM_CONTEXT(raw_context); + Word additional_response_header_pairs_size, Word grpc_status) { + auto *context = contextOrEffectiveContext(); auto details = context->wasmVm()->getMemory(response_code_details_ptr, response_code_details_size); auto body = context->wasmVm()->getMemory(body_ptr, body_size); @@ -183,38 +152,38 @@ Word send_local_response(void *raw_context, Word response_code, Word response_co if (!details || !body || !additional_response_header_pairs) { return WasmResult::InvalidMemoryAccess; } - auto additional_headers = toPairs(additional_response_header_pairs.value()); - context->sendLocalResponse(response_code, body.value(), std::move(additional_headers), grpc_code, - details.value()); + auto additional_headers = PairsUtil::toPairs(additional_response_header_pairs.value()); + context->sendLocalResponse(response_code, body.value(), std::move(additional_headers), + grpc_status, details.value()); context->wasm()->stopNextIteration(true); return WasmResult::Ok; } -Word clear_route_cache(void *raw_context) { - auto context = WASM_CONTEXT(raw_context); +Word clear_route_cache() { + auto *context = contextOrEffectiveContext(); context->clearRouteCache(); return WasmResult::Ok; } -Word set_effective_context(void *raw_context, Word context_id) { - auto context = WASM_CONTEXT(raw_context); - uint32_t cid = static_cast(context_id); - auto c = context->wasm()->getContext(cid); - if (!c) { +Word set_effective_context(Word context_id) { + auto *context = contextOrEffectiveContext(); + auto cid = static_cast(context_id); + auto *c = context->wasm()->getContext(cid); + if (c == nullptr) { return WasmResult::BadArgument; } effective_context_id_ = cid; return WasmResult::Ok; } -Word done(void *raw_context) { - auto context = WASM_CONTEXT(raw_context); +Word done() { + auto *context = contextOrEffectiveContext(); return context->wasm()->done(context); } -Word call_foreign_function(void *raw_context, Word function_name, Word function_name_size, - Word arguments, Word arguments_size, Word results, Word results_size) { - auto context = WASM_CONTEXT(raw_context); +Word call_foreign_function(Word function_name, Word function_name_size, Word arguments, + Word arguments_size, Word results, Word results_size) { + auto *context = contextOrEffectiveContext(); auto function = context->wasmVm()->getMemory(function_name, function_name_size); if (!function) { return WasmResult::InvalidMemoryAccess; @@ -223,7 +192,7 @@ Word call_foreign_function(void *raw_context, Word function_name, Word function_ if (!args_opt) { return WasmResult::InvalidMemoryAccess; } - auto f = context->wasm()->getForeignFunction(function.value()); + auto f = getForeignFunction(function.value()); if (!f) { return WasmResult::NotFound; } @@ -233,7 +202,7 @@ Word call_foreign_function(void *raw_context, Word function_name, Word function_ void *result = nullptr; size_t result_size = 0; auto res = f(wasm, args, [&wasm, &address, &result, &result_size, results](size_t s) -> void * { - if (results) { + if (results != 0U) { result = wasm.allocMemory(s, &address); } else { // If the caller does not want the results, allocate a temporary buffer for them. @@ -242,22 +211,22 @@ Word call_foreign_function(void *raw_context, Word function_name, Word function_ result_size = s; return result; }); - if (results && !context->wasmVm()->setWord(results, Word(address))) { + if (results != 0U && !context->wasmVm()->setWord(results, Word(address))) { return WasmResult::InvalidMemoryAccess; } - if (results_size && !context->wasmVm()->setWord(results_size, Word(result_size))) { + if (results_size != 0U && !context->wasmVm()->setWord(results_size, Word(result_size))) { return WasmResult::InvalidMemoryAccess; } - if (!results) { + if (results == 0U) { ::free(result); } return res; } // SharedData -Word get_shared_data(void *raw_context, Word key_ptr, Word key_size, Word value_ptr_ptr, - Word value_size_ptr, Word cas_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word get_shared_data(Word key_ptr, Word key_size, Word value_ptr_ptr, Word value_size_ptr, + Word cas_ptr) { + auto *context = contextOrEffectiveContext(); auto key = context->wasmVm()->getMemory(key_ptr, key_size); if (!key) { return WasmResult::InvalidMemoryAccess; @@ -276,9 +245,8 @@ Word get_shared_data(void *raw_context, Word key_ptr, Word key_size, Word value_ return WasmResult::Ok; } -Word set_shared_data(void *raw_context, Word key_ptr, Word key_size, Word value_ptr, - Word value_size, Word cas) { - auto context = WASM_CONTEXT(raw_context); +Word set_shared_data(Word key_ptr, Word key_size, Word value_ptr, Word value_size, Word cas) { + auto *context = contextOrEffectiveContext(); auto key = context->wasmVm()->getMemory(key_ptr, key_size); auto value = context->wasmVm()->getMemory(value_ptr, value_size); if (!key || !value) { @@ -287,9 +255,8 @@ Word set_shared_data(void *raw_context, Word key_ptr, Word key_size, Word value_ return context->setSharedData(key.value(), value.value(), cas); } -Word register_shared_queue(void *raw_context, Word queue_name_ptr, Word queue_name_size, - Word token_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word register_shared_queue(Word queue_name_ptr, Word queue_name_size, Word token_ptr) { + auto *context = contextOrEffectiveContext(); auto queue_name = context->wasmVm()->getMemory(queue_name_ptr, queue_name_size); if (!queue_name) { return WasmResult::InvalidMemoryAccess; @@ -305,8 +272,8 @@ Word register_shared_queue(void *raw_context, Word queue_name_ptr, Word queue_na return WasmResult::Ok; } -Word dequeue_shared_queue(void *raw_context, Word token, Word data_ptr_ptr, Word data_size_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word dequeue_shared_queue(Word token, Word data_ptr_ptr, Word data_size_ptr) { + auto *context = contextOrEffectiveContext(); std::string data; WasmResult result = context->dequeueSharedQueue(token.u32(), &data); if (result != WasmResult::Ok) { @@ -318,9 +285,9 @@ Word dequeue_shared_queue(void *raw_context, Word token, Word data_ptr_ptr, Word return WasmResult::Ok; } -Word resolve_shared_queue(void *raw_context, Word vm_id_ptr, Word vm_id_size, Word queue_name_ptr, +Word resolve_shared_queue(Word vm_id_ptr, Word vm_id_size, Word queue_name_ptr, Word queue_name_size, Word token_ptr) { - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); auto vm_id = context->wasmVm()->getMemory(vm_id_ptr, vm_id_size); auto queue_name = context->wasmVm()->getMemory(queue_name_ptr, queue_name_size); if (!vm_id || !queue_name) { @@ -337,8 +304,8 @@ Word resolve_shared_queue(void *raw_context, Word vm_id_ptr, Word vm_id_size, Wo return WasmResult::Ok; } -Word enqueue_shared_queue(void *raw_context, Word token, Word data_ptr, Word data_size) { - auto context = WASM_CONTEXT(raw_context); +Word enqueue_shared_queue(Word token, Word data_ptr, Word data_size) { + auto *context = contextOrEffectiveContext(); auto data = context->wasmVm()->getMemory(data_ptr, data_size); if (!data) { return WasmResult::InvalidMemoryAccess; @@ -347,12 +314,11 @@ Word enqueue_shared_queue(void *raw_context, Word token, Word data_ptr, Word dat } // Header/Trailer/Metadata Maps -Word add_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_size, Word value_ptr, - Word value_size) { +Word add_header_map_value(Word type, Word key_ptr, Word key_size, Word value_ptr, Word value_size) { if (type > static_cast(WasmHeaderMapType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); auto key = context->wasmVm()->getMemory(key_ptr, key_size); auto value = context->wasmVm()->getMemory(value_ptr, value_size); if (!key || !value) { @@ -362,12 +328,12 @@ Word add_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_s value.value()); } -Word get_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_size, - Word value_ptr_ptr, Word value_size_ptr) { +Word get_header_map_value(Word type, Word key_ptr, Word key_size, Word value_ptr_ptr, + Word value_size_ptr) { if (type > static_cast(WasmHeaderMapType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); auto key = context->wasmVm()->getMemory(key_ptr, key_size); if (!key) { return WasmResult::InvalidMemoryAccess; @@ -384,12 +350,12 @@ Word get_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_s return WasmResult::Ok; } -Word replace_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_size, - Word value_ptr, Word value_size) { +Word replace_header_map_value(Word type, Word key_ptr, Word key_size, Word value_ptr, + Word value_size) { if (type > static_cast(WasmHeaderMapType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); auto key = context->wasmVm()->getMemory(key_ptr, key_size); auto value = context->wasmVm()->getMemory(value_ptr, value_size); if (!key || !value) { @@ -399,11 +365,11 @@ Word replace_header_map_value(void *raw_context, Word type, Word key_ptr, Word k value.value()); } -Word remove_header_map_value(void *raw_context, Word type, Word key_ptr, Word key_size) { +Word remove_header_map_value(Word type, Word key_ptr, Word key_size) { if (type > static_cast(WasmHeaderMapType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); auto key = context->wasmVm()->getMemory(key_ptr, key_size); if (!key) { return WasmResult::InvalidMemoryAccess; @@ -411,40 +377,58 @@ Word remove_header_map_value(void *raw_context, Word type, Word key_ptr, Word ke return context->removeHeaderMapValue(static_cast(type.u64_), key.value()); } -Word get_header_map_pairs(void *raw_context, Word type, Word ptr_ptr, Word size_ptr) { +Word get_header_map_pairs(Word type, Word ptr_ptr, Word size_ptr) { if (type > static_cast(WasmHeaderMapType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); Pairs pairs; auto result = context->getHeaderMapPairs(static_cast(type.u64_), &pairs); if (result != WasmResult::Ok) { return result; } - if (!getPairs(context, pairs, ptr_ptr, size_ptr)) { + if (pairs.empty()) { + if (!context->wasm()->copyToPointerSize("", ptr_ptr, size_ptr)) { + return WasmResult::InvalidMemoryAccess; + } + return WasmResult::Ok; + } + uint64_t size = PairsUtil::pairsSize(pairs); + uint64_t ptr = 0; + char *buffer = static_cast(context->wasm()->allocMemory(size, &ptr)); + if (buffer == nullptr) { + return WasmResult::InvalidMemoryAccess; + } + if (!PairsUtil::marshalPairs(pairs, buffer, size)) { + return WasmResult::InvalidMemoryAccess; + } + if (!context->wasmVm()->setWord(ptr_ptr, Word(ptr))) { + return WasmResult::InvalidMemoryAccess; + } + if (!context->wasmVm()->setWord(size_ptr, Word(size))) { return WasmResult::InvalidMemoryAccess; } return WasmResult::Ok; } -Word set_header_map_pairs(void *raw_context, Word type, Word ptr, Word size) { +Word set_header_map_pairs(Word type, Word ptr, Word size) { if (type > static_cast(WasmHeaderMapType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); auto data = context->wasmVm()->getMemory(ptr, size); if (!data) { return WasmResult::InvalidMemoryAccess; } return context->setHeaderMapPairs(static_cast(type.u64_), - toPairs(data.value())); + PairsUtil::toPairs(data.value())); } -Word get_header_map_size(void *raw_context, Word type, Word result_ptr) { +Word get_header_map_size(Word type, Word result_ptr) { if (type > static_cast(WasmHeaderMapType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); uint32_t size; auto result = context->getHeaderMapSize(static_cast(type.u64_), &size); if (result != WasmResult::Ok) { @@ -457,14 +441,13 @@ Word get_header_map_size(void *raw_context, Word type, Word result_ptr) { } // Buffer -Word get_buffer_bytes(void *raw_context, Word type, Word start, Word length, Word ptr_ptr, - Word size_ptr) { +Word get_buffer_bytes(Word type, Word start, Word length, Word ptr_ptr, Word size_ptr) { if (type > static_cast(WasmBufferType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); - auto buffer = context->getBuffer(static_cast(type.u64_)); - if (!buffer) { + auto *context = contextOrEffectiveContext(); + auto *buffer = context->getBuffer(static_cast(type.u64_)); + if (buffer == nullptr) { return WasmResult::NotFound; } // Check for overflow. @@ -472,22 +455,30 @@ Word get_buffer_bytes(void *raw_context, Word type, Word start, Word length, Wor return WasmResult::BadArgument; } // Don't overread. - if (start + length > buffer->size()) { + if (start > buffer->size()) { + length = 0; + } else if (start + length > buffer->size()) { length = buffer->size() - start; } - if (length > 0) { - return buffer->copyTo(context->wasm(), start, length, ptr_ptr, size_ptr); + if (length == 0) { + if (!context->wasmVm()->setWord(ptr_ptr, Word(0))) { + return WasmResult::InvalidMemoryAccess; + } + if (!context->wasmVm()->setWord(size_ptr, Word(0))) { + return WasmResult::InvalidMemoryAccess; + } + return WasmResult::Ok; } - return WasmResult::Ok; + return buffer->copyTo(context->wasm(), start, length, ptr_ptr, size_ptr); } -Word get_buffer_status(void *raw_context, Word type, Word length_ptr, Word flags_ptr) { +Word get_buffer_status(Word type, Word length_ptr, Word flags_ptr) { if (type > static_cast(WasmBufferType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); - auto buffer = context->getBuffer(static_cast(type.u64_)); - if (!buffer) { + auto *context = contextOrEffectiveContext(); + auto *buffer = context->getBuffer(static_cast(type.u64_)); + if (buffer == nullptr) { return WasmResult::NotFound; } auto length = buffer->size(); @@ -501,14 +492,13 @@ Word get_buffer_status(void *raw_context, Word type, Word length_ptr, Word flags return WasmResult::Ok; } -Word set_buffer_bytes(void *raw_context, Word type, Word start, Word length, Word data_ptr, - Word data_size) { +Word set_buffer_bytes(Word type, Word start, Word length, Word data_ptr, Word data_size) { if (type > static_cast(WasmBufferType::MAX)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); - auto buffer = context->getBuffer(static_cast(type.u64_)); - if (!buffer) { + auto *context = contextOrEffectiveContext(); + auto *buffer = context->getBuffer(static_cast(type.u64_)); + if (buffer == nullptr) { return WasmResult::NotFound; } auto data = context->wasmVm()->getMemory(data_ptr, data_size); @@ -518,10 +508,10 @@ Word set_buffer_bytes(void *raw_context, Word type, Word start, Word length, Wor return buffer->copyFrom(start, length, data.value()); } -Word http_call(void *raw_context, Word uri_ptr, Word uri_size, Word header_pairs_ptr, - Word header_pairs_size, Word body_ptr, Word body_size, Word trailer_pairs_ptr, - Word trailer_pairs_size, Word timeout_milliseconds, Word token_ptr) { - auto context = WASM_CONTEXT(raw_context)->root_context(); +Word http_call(Word uri_ptr, Word uri_size, Word header_pairs_ptr, Word header_pairs_size, + Word body_ptr, Word body_size, Word trailer_pairs_ptr, Word trailer_pairs_size, + Word timeout_milliseconds, Word token_ptr) { + auto *context = contextOrEffectiveContext()->root_context(); auto uri = context->wasmVm()->getMemory(uri_ptr, uri_size); auto body = context->wasmVm()->getMemory(body_ptr, body_size); auto header_pairs = context->wasmVm()->getMemory(header_pairs_ptr, header_pairs_size); @@ -529,8 +519,8 @@ Word http_call(void *raw_context, Word uri_ptr, Word uri_size, Word header_pairs if (!uri || !body || !header_pairs || !trailer_pairs) { return WasmResult::InvalidMemoryAccess; } - auto headers = toPairs(header_pairs.value()); - auto trailers = toPairs(trailer_pairs.value()); + auto headers = PairsUtil::toPairs(header_pairs.value()); + auto trailers = PairsUtil::toPairs(trailer_pairs.value()); uint32_t token = 0; // NB: try to write the token to verify the memory before starting the async // operation. @@ -543,9 +533,8 @@ Word http_call(void *raw_context, Word uri_ptr, Word uri_size, Word header_pairs return result; } -Word define_metric(void *raw_context, Word metric_type, Word name_ptr, Word name_size, - Word metric_id_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word define_metric(Word metric_type, Word name_ptr, Word name_size, Word metric_id_ptr) { + auto *context = contextOrEffectiveContext(); auto name = context->wasmVm()->getMemory(name_ptr, name_size); if (!name) { return WasmResult::InvalidMemoryAccess; @@ -562,18 +551,18 @@ Word define_metric(void *raw_context, Word metric_type, Word name_ptr, Word name return WasmResult::Ok; } -Word increment_metric(void *raw_context, Word metric_id, int64_t offset) { - auto context = WASM_CONTEXT(raw_context); +Word increment_metric(Word metric_id, int64_t offset) { + auto *context = contextOrEffectiveContext(); return context->incrementMetric(metric_id, offset); } -Word record_metric(void *raw_context, Word metric_id, uint64_t value) { - auto context = WASM_CONTEXT(raw_context); +Word record_metric(Word metric_id, uint64_t value) { + auto *context = contextOrEffectiveContext(); return context->recordMetric(metric_id, value); } -Word get_metric(void *raw_context, Word metric_id, Word result_uint64_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word get_metric(Word metric_id, Word result_uint64_ptr) { + auto *context = contextOrEffectiveContext(); uint64_t value = 0; auto result = context->getMetric(metric_id, &value); if (result != WasmResult::Ok) { @@ -585,11 +574,11 @@ Word get_metric(void *raw_context, Word metric_id, Word result_uint64_ptr) { return WasmResult::Ok; } -Word grpc_call(void *raw_context, Word service_ptr, Word service_size, Word service_name_ptr, - Word service_name_size, Word method_name_ptr, Word method_name_size, - Word initial_metadata_ptr, Word initial_metadata_size, Word request_ptr, - Word request_size, Word timeout_milliseconds, Word token_ptr) { - auto context = WASM_CONTEXT(raw_context)->root_context(); +Word grpc_call(Word service_ptr, Word service_size, Word service_name_ptr, Word service_name_size, + Word method_name_ptr, Word method_name_size, Word initial_metadata_ptr, + Word initial_metadata_size, Word request_ptr, Word request_size, + Word timeout_milliseconds, Word token_ptr) { + auto *context = contextOrEffectiveContext()->root_context(); auto service = context->wasmVm()->getMemory(service_ptr, service_size); auto service_name = context->wasmVm()->getMemory(service_name_ptr, service_name_size); auto method_name = context->wasmVm()->getMemory(method_name_ptr, method_name_size); @@ -600,7 +589,7 @@ Word grpc_call(void *raw_context, Word service_ptr, Word service_size, Word serv return WasmResult::InvalidMemoryAccess; } uint32_t token = 0; - auto initial_metadata = toPairs(initial_metadata_pairs.value()); + auto initial_metadata = PairsUtil::toPairs(initial_metadata_pairs.value()); auto result = context->grpcCall(service.value(), service_name.value(), method_name.value(), initial_metadata, request.value(), std::chrono::milliseconds(timeout_milliseconds), &token); @@ -613,10 +602,10 @@ Word grpc_call(void *raw_context, Word service_ptr, Word service_size, Word serv return WasmResult::Ok; } -Word grpc_stream(void *raw_context, Word service_ptr, Word service_size, Word service_name_ptr, - Word service_name_size, Word method_name_ptr, Word method_name_size, - Word initial_metadata_ptr, Word initial_metadata_size, Word token_ptr) { - auto context = WASM_CONTEXT(raw_context)->root_context(); +Word grpc_stream(Word service_ptr, Word service_size, Word service_name_ptr, Word service_name_size, + Word method_name_ptr, Word method_name_size, Word initial_metadata_ptr, + Word initial_metadata_size, Word token_ptr) { + auto *context = contextOrEffectiveContext()->root_context(); auto service = context->wasmVm()->getMemory(service_ptr, service_size); auto service_name = context->wasmVm()->getMemory(service_name_ptr, service_name_size); auto method_name = context->wasmVm()->getMemory(method_name_ptr, method_name_size); @@ -626,7 +615,7 @@ Word grpc_stream(void *raw_context, Word service_ptr, Word service_size, Word se return WasmResult::InvalidMemoryAccess; } uint32_t token = 0; - auto initial_metadata = toPairs(initial_metadata_pairs.value()); + auto initial_metadata = PairsUtil::toPairs(initial_metadata_pairs.value()); auto result = context->grpcStream(service.value(), service_name.value(), method_name.value(), initial_metadata, &token); if (result != WasmResult::Ok) { @@ -638,30 +627,52 @@ Word grpc_stream(void *raw_context, Word service_ptr, Word service_size, Word se return WasmResult::Ok; } -Word grpc_cancel(void *raw_context, Word token) { - auto context = WASM_CONTEXT(raw_context)->root_context(); +Word grpc_cancel(Word token) { + auto *context = contextOrEffectiveContext()->root_context(); return context->grpcCancel(token); } -Word grpc_close(void *raw_context, Word token) { - auto context = WASM_CONTEXT(raw_context)->root_context(); +Word grpc_close(Word token) { + auto *context = contextOrEffectiveContext()->root_context(); return context->grpcClose(token); } -Word grpc_send(void *raw_context, Word token, Word message_ptr, Word message_size, - Word end_stream) { - auto context = WASM_CONTEXT(raw_context)->root_context(); +Word grpc_send(Word token, Word message_ptr, Word message_size, Word end_stream) { + auto *context = contextOrEffectiveContext()->root_context(); auto message = context->wasmVm()->getMemory(message_ptr, message_size); if (!message) { return WasmResult::InvalidMemoryAccess; } - return context->grpcSend(token, message.value(), end_stream); + return context->grpcSend(token, message.value(), end_stream != 0U); +} + +// WASIp1 typings in comments sourced from +// https://github.com/WebAssembly/wasi-libc/blob/446cb3f1aa21f9b1a1eab372f82d65d19003e924/libc-bottom-half/headers/public/wasi/api.h + +// __wasi_errno_t path_open(__wasi_fd_t fd, __wasi_lookupflags_t dirflags, const char *path, +// size_t path_len, __wasi_oflags_t oflags, __wasi_rights_t fs_rights_base, __wasi_rights_t +// fs_rights_inheriting, __wasi_fdflags_t fdflags, __wasi_fd_t *retptr0) +Word wasi_unstable_path_open(Word /*fd*/, Word /*dir_flags*/, Word /*path*/, Word /*path_len*/, + Word /*oflags*/, int64_t /*fs_rights_base*/, + int64_t /*fg_rights_inheriting*/, Word /*fd_flags*/, + Word /*nwritten_ptr*/) { + return 44; // __WASI_ERRNO_NOENT +} + +// __wasi_errno_t __wasi_fd_prestat_get(__wasi_fd_t fd, __wasi_prestat_t *retptr0) +Word wasi_unstable_fd_prestat_get(Word /*fd*/, Word /*buf_ptr*/) { + return 8; // __WASI_ERRNO_BADF +} + +// __wasi_errno_t __wasi_fd_prestat_dir_name(__wasi_fd_t fd, uint8_t * path, __wasi_size_t path_len) +Word wasi_unstable_fd_prestat_dir_name(Word /*fd*/, Word /*path_ptr*/, Word /*path_len*/) { + return 52; // __WASI_ERRNO_ENOSYS } // Implementation of writev-like() syscall that redirects stdout/stderr to Envoy // logs. -Word writevImpl(void *raw_context, Word fd, Word iovs, Word iovs_len, Word *nwritten_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word writevImpl(Word fd, Word iovs, Word iovs_len, Word *nwritten_ptr) { + auto *context = contextOrEffectiveContext(); // Read syscall args. uint64_t log_level; @@ -683,9 +694,11 @@ Word writevImpl(void *raw_context, Word fd, Word iovs, Word iovs_len, Word *nwri if (!memslice) { return 21; // __WASI_EFAULT } - const uint32_t *iovec = reinterpret_cast(memslice.value().data()); - if (iovec[1] /* buf_len */) { - memslice = context->wasmVm()->getMemory(iovec[0] /* buf */, iovec[1] /* buf_len */); + const auto *iovec = reinterpret_cast(memslice.value().data()); + if (iovec[1] != 0U /* buf_len */) { + const auto buf = wasmtoh(iovec[0], context->wasmVm()->usesWasmByteOrder()); + const auto buf_len = wasmtoh(iovec[1], context->wasmVm()->usesWasmByteOrder()); + memslice = context->wasmVm()->getMemory(buf, buf_len); if (!memslice) { return 21; // __WASI_EFAULT } @@ -694,7 +707,7 @@ Word writevImpl(void *raw_context, Word fd, Word iovs, Word iovs_len, Word *nwri } size_t written = s.size(); - if (written) { + if (written != 0U) { // Remove trailing newline from the logs, if any. if (s[written - 1] == '\n') { s.erase(written - 1); @@ -709,12 +722,11 @@ Word writevImpl(void *raw_context, Word fd, Word iovs, Word iovs_len, Word *nwri // __wasi_errno_t __wasi_fd_write(_wasi_fd_t fd, const _wasi_ciovec_t *iov, // size_t iovs_len, size_t* nwritten); -Word wasi_unstable_fd_write(void *raw_context, Word fd, Word iovs, Word iovs_len, - Word nwritten_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word wasi_unstable_fd_write(Word fd, Word iovs, Word iovs_len, Word nwritten_ptr) { + auto *context = contextOrEffectiveContext(); Word nwritten(0); - auto result = writevImpl(raw_context, fd, iovs, iovs_len, &nwritten); + auto result = writevImpl(fd, iovs, iovs_len, &nwritten); if (result != 0) { // __WASI_ESUCCESS return result; } @@ -726,28 +738,29 @@ Word wasi_unstable_fd_write(void *raw_context, Word fd, Word iovs, Word iovs_len // __wasi_errno_t __wasi_fd_read(_wasi_fd_t fd, const __wasi_iovec_t *iovs, // size_t iovs_len, __wasi_size_t *nread); -Word wasi_unstable_fd_read(void *, Word, Word, Word, Word) { +Word wasi_unstable_fd_read(Word /*fd*/, Word /*iovs_ptr*/, Word /*iovs_len*/, Word /*nread_ptr*/) { // Don't support reading of any files. return 52; // __WASI_ERRNO_ENOSYS } // __wasi_errno_t __wasi_fd_seek(__wasi_fd_t fd, __wasi_filedelta_t offset, // __wasi_whence_t whence,__wasi_filesize_t *newoffset); -Word wasi_unstable_fd_seek(void *raw_context, Word, int64_t, Word, Word) { - auto context = WASM_CONTEXT(raw_context); +Word wasi_unstable_fd_seek(Word /*fd*/, int64_t /*offset*/, Word /*whence*/, + Word /*newoffset_ptr*/) { + auto *context = contextOrEffectiveContext(); context->error("wasi_unstable fd_seek"); return 0; } // __wasi_errno_t __wasi_fd_close(__wasi_fd_t fd); -Word wasi_unstable_fd_close(void *raw_context, Word) { - auto context = WASM_CONTEXT(raw_context); +Word wasi_unstable_fd_close(Word /*fd*/) { + auto *context = contextOrEffectiveContext(); context->error("wasi_unstable fd_close"); return 0; } // __wasi_errno_t __wasi_fd_fdstat_get(__wasi_fd_t fd, __wasi_fdstat_t *stat) -Word wasi_unstable_fd_fdstat_get(void *raw_context, Word fd, Word statOut) { +Word wasi_unstable_fd_fdstat_get(Word fd, Word statOut) { // We will only support this interface on stdout and stderr if (fd != 1 && fd != 2) { return 8; // __WASI_EBADF; @@ -760,18 +773,25 @@ Word wasi_unstable_fd_fdstat_get(void *raw_context, Word fd, Word statOut) { wasi_fdstat[1] = 64; // This sets "fs_rights_base" to __WASI_RIGHTS_FD_WRITE wasi_fdstat[2] = 0; - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); context->wasmVm()->setMemory(statOut, 3 * sizeof(uint64_t), &wasi_fdstat); return 0; // __WASI_ESUCCESS } +// __wasi_errno_t __wasi_fd_fdstat_set_flags(__wasi_fd_t fd, __wasi_fdflags_t flags) +Word wasi_unstable_fd_fdstat_set_flags(Word /*fd*/, Word /*flags*/) { + // Flags that can be specified: append, dsync, nonblock, rsync, and sync. Proxy-wasm only supports + // STDOUT and STDERR, but none of these flags have any effect in Proxy-Wasm. + return 52; // __WASI_ERRNO_ENOSYS +} + // __wasi_errno_t __wasi_environ_get(char **environ, char *environ_buf); -Word wasi_unstable_environ_get(void *raw_context, Word environ_array_ptr, Word environ_buf) { - auto context = WASM_CONTEXT(raw_context); +Word wasi_unstable_environ_get(Word environ_array_ptr, Word environ_buf) { + auto *context = contextOrEffectiveContext(); auto word_size = context->wasmVm()->getWordSize(); - auto &envs = context->wasm()->envs(); - for (auto e : envs) { + const auto &envs = context->wasm()->envs(); + for (const auto &e : envs) { if (!context->wasmVm()->setWord(environ_array_ptr, environ_buf)) { return 21; // __WASI_EFAULT } @@ -794,15 +814,15 @@ Word wasi_unstable_environ_get(void *raw_context, Word environ_array_ptr, Word e // __wasi_errno_t __wasi_environ_sizes_get(size_t *environ_count, size_t // *environ_buf_size); -Word wasi_unstable_environ_sizes_get(void *raw_context, Word count_ptr, Word buf_size_ptr) { - auto context = WASM_CONTEXT(raw_context); - auto &envs = context->wasm()->envs(); +Word wasi_unstable_environ_sizes_get(Word count_ptr, Word buf_size_ptr) { + auto *context = contextOrEffectiveContext(); + const auto &envs = context->wasm()->envs(); if (!context->wasmVm()->setWord(count_ptr, Word(envs.size()))) { return 21; // __WASI_EFAULT } size_t size = 0; - for (auto e : envs) { + for (const auto &e : envs) { // len(key) + len(value) + 1('=') + 1(null terminator) size += e.first.size() + e.second.size() + 2; } @@ -812,14 +832,14 @@ Word wasi_unstable_environ_sizes_get(void *raw_context, Word count_ptr, Word buf return 0; // __WASI_ESUCCESS } -// __wasi_errno_t __wasi_args_get(size_t **argv, size_t *argv_buf); -Word wasi_unstable_args_get(void *, Word, Word) { +// __wasi_errno_t __wasi_args_get(uint8_t **argv, uint8_t *argv_buf); +Word wasi_unstable_args_get(Word /*argv_array_ptr*/, Word /*argv_buf_ptr*/) { return 0; // __WASI_ESUCCESS } // __wasi_errno_t __wasi_args_sizes_get(size_t *argc, size_t *argv_buf_size); -Word wasi_unstable_args_sizes_get(void *raw_context, Word argc_ptr, Word argv_buf_size_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word wasi_unstable_args_sizes_get(Word argc_ptr, Word argv_buf_size_ptr) { + auto *context = contextOrEffectiveContext(); if (!context->wasmVm()->setWord(argc_ptr, Word(0))) { return 21; // __WASI_EFAULT } @@ -830,11 +850,11 @@ Word wasi_unstable_args_sizes_get(void *raw_context, Word argc_ptr, Word argv_bu } // __wasi_errno_t __wasi_clock_time_get(uint32_t id, uint64_t precision, uint64_t* time); -Word wasi_unstable_clock_time_get(void *raw_context, Word clock_id, uint64_t precision, +Word wasi_unstable_clock_time_get(Word clock_id, uint64_t /*precision*/, Word result_time_uint64_ptr) { uint64_t result = 0; - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); switch (clock_id) { case 0 /* realtime */: result = context->getCurrentTimeNanoseconds(); @@ -853,8 +873,14 @@ Word wasi_unstable_clock_time_get(void *raw_context, Word clock_id, uint64_t pre } // __wasi_errno_t __wasi_random_get(uint8_t *buf, size_t buf_len); -Word wasi_unstable_random_get(void *raw_context, Word result_buf_ptr, Word buf_len) { - auto context = WASM_CONTEXT(raw_context); +Word wasi_unstable_random_get(Word result_buf_ptr, Word buf_len) { + if (buf_len > PROXY_WASM_HOST_WASI_RANDOM_GET_MAX_SIZE_BYTES) { + return 28; // __WASI_EINVAL + } + if (buf_len == 0) { + return 0; // __WASI_ESUCCESS + } + auto *context = contextOrEffectiveContext(); std::vector random(buf_len); RAND_bytes(random.data(), random.size()); if (!context->wasmVm()->setMemory(result_buf_ptr, random.size(), random.data())) { @@ -863,22 +889,39 @@ Word wasi_unstable_random_get(void *raw_context, Word result_buf_ptr, Word buf_l return 0; // __WASI_ESUCCESS } +// __wasi_errno_t __wasi_sched_yield() +Word wasi_unstable_sched_yield() { + // Per POSIX man pages, it is valid to return success if the calling thread is the only thread in + // the highest priority list. This is vacuously true for wasm without threads. There are no valid + // error cases defined. + return 0; // __WASI_ESUCCESS +} + +// __wasi_errno_t __wasi_poll_oneoff(const __wasi_subscription_t *in, __wasi_event_t *out, +// __wasi_size_t nsubscriptions, __wasi_size_t *nevents) +Word wasi_unstable_poll_oneoff(Word /*in*/, Word /*out*/, Word /*nsubscriptions*/, + Word /*nevents_ptr*/) { + return 52; // __WASI_ERRNO_ENOSYS +} + // void __wasi_proc_exit(__wasi_exitcode_t rval); -void wasi_unstable_proc_exit(void *raw_context, Word) { - auto context = WASM_CONTEXT(raw_context); +void wasi_unstable_proc_exit(Word /*exit_code*/) { + auto *context = contextOrEffectiveContext(); context->error("wasi_unstable proc_exit"); } -Word pthread_equal(void *, Word left, Word right) { return left == right; } +Word pthread_equal(Word left, Word right) { return static_cast(left == right); } + +void emscripten_notify_memory_growth(Word /*memory_index*/) {} -Word set_tick_period_milliseconds(void *raw_context, Word period_milliseconds) { +Word set_tick_period_milliseconds(Word period_milliseconds) { TimerToken token = 0; - return WASM_CONTEXT(raw_context) - ->setTimerPeriod(std::chrono::milliseconds(period_milliseconds), &token); + return contextOrEffectiveContext()->setTimerPeriod(std::chrono::milliseconds(period_milliseconds), + &token); } -Word get_current_time_nanoseconds(void *raw_context, Word result_uint64_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word get_current_time_nanoseconds(Word result_uint64_ptr) { + auto *context = contextOrEffectiveContext(); uint64_t result = context->getCurrentTimeNanoseconds(); if (!context->wasm()->setDatatype(result_uint64_ptr, result)) { return WasmResult::InvalidMemoryAccess; @@ -886,11 +929,11 @@ Word get_current_time_nanoseconds(void *raw_context, Word result_uint64_ptr) { return WasmResult::Ok; } -Word log(void *raw_context, Word level, Word address, Word size) { +Word log(Word level, Word address, Word size) { if (level > static_cast(LogLevel::Max)) { return WasmResult::BadArgument; } - auto context = WASM_CONTEXT(raw_context); + auto *context = contextOrEffectiveContext(); auto message = context->wasmVm()->getMemory(address, size); if (!message) { return WasmResult::InvalidMemoryAccess; @@ -898,8 +941,8 @@ Word log(void *raw_context, Word level, Word address, Word size) { return context->log(level, message.value()); } -Word get_log_level(void *raw_context, Word result_level_uint32_ptr) { - auto context = WASM_CONTEXT(raw_context); +Word get_log_level(Word result_level_uint32_ptr) { + auto *context = contextOrEffectiveContext(); uint32_t level = context->getLogLevel(); if (!context->wasm()->setDatatype(result_level_uint32_ptr, level)) { return WasmResult::InvalidMemoryAccess; diff --git a/src/hash.cc b/src/hash.cc new file mode 100644 index 000000000..f2d1ded13 --- /dev/null +++ b/src/hash.cc @@ -0,0 +1,54 @@ +// Copyright 2023 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. + +#include "src/hash.h" + +#include +#include + +#include + +namespace proxy_wasm { + +namespace { + +std::string BytesToHex(const std::vector &bytes) { + static const char *const hex = "0123456789ABCDEF"; + std::string result; + result.reserve(bytes.size() * 2); + for (auto byte : bytes) { + result.push_back(hex[byte >> 4]); + result.push_back(hex[byte & 0xf]); + } + return result; +} + +} // namespace + +std::vector Sha256(const std::vector &parts) { + uint8_t sha256[SHA256_DIGEST_LENGTH]; + SHA256_CTX sha_ctx; + SHA256_Init(&sha_ctx); + for (auto part : parts) { + SHA256_Update(&sha_ctx, part.data(), part.size()); + } + SHA256_Final(sha256, &sha_ctx); + return std::vector(std::begin(sha256), std::end(sha256)); +} + +std::string Sha256String(const std::vector &parts) { + return BytesToHex(Sha256(parts)); +} + +} // namespace proxy_wasm \ No newline at end of file diff --git a/test/context_test.cc b/src/hash.h similarity index 57% rename from test/context_test.cc rename to src/hash.h index bd4b3283b..40d03e9d4 100644 --- a/test/context_test.cc +++ b/src/hash.h @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,24 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "include/proxy-wasm/context.h" +#pragma once -#include "gtest/gtest.h" +#include +#include -namespace proxy_wasm { -namespace { - -class Context : public ContextBase { -public: - Context(std::function error_function) - : error_function_(error_function) {} - void error(std::string_view message) { error_function_(message); } +#include -private: - std::function error_function_; -}; +namespace proxy_wasm { -TEST(Context, IncludeParses) {} +std::vector Sha256(const std::vector &parts); +std::string Sha256String(const std::vector &parts); -} // namespace } // namespace proxy_wasm diff --git a/src/null/null_plugin.cc b/src/null/null_plugin.cc index 25f575e19..689225687 100644 --- a/src/null/null_plugin.cc +++ b/src/null/null_plugin.cc @@ -15,9 +15,9 @@ #include "include/proxy-wasm/null_plugin.h" +#include +#include #include -#include -#include #include #include @@ -26,7 +26,6 @@ #include #include -#include "include/proxy-wasm/null_plugin.h" #include "include/proxy-wasm/null_vm.h" #include "include/proxy-wasm/wasm.h" @@ -44,7 +43,7 @@ void NullPlugin::getFunction(std::string_view function_name, WasmCallVoid<0> *f) } void NullPlugin::getFunction(std::string_view function_name, WasmCallVoid<1> *f) { - auto plugin = this; + auto *plugin = this; if (function_name == "proxy_on_tick") { *f = [plugin](ContextBase *context, Word context_id) { SaveRestoreContext saved_context(context); @@ -67,7 +66,7 @@ void NullPlugin::getFunction(std::string_view function_name, WasmCallVoid<1> *f) } void NullPlugin::getFunction(std::string_view function_name, WasmCallVoid<2> *f) { - auto plugin = this; + auto *plugin = this; if (function_name == "proxy_on_context_create") { *f = [plugin](ContextBase *context, Word context_id, Word parent_context_id) { SaveRestoreContext saved_context(context); @@ -95,7 +94,7 @@ void NullPlugin::getFunction(std::string_view function_name, WasmCallVoid<2> *f) } void NullPlugin::getFunction(std::string_view function_name, WasmCallVoid<3> *f) { - auto plugin = this; + auto *plugin = this; if (function_name == "proxy_on_grpc_close") { *f = [plugin](ContextBase *context, Word context_id, Word token, Word status_code) { SaveRestoreContext saved_context(context); @@ -128,7 +127,7 @@ void NullPlugin::getFunction(std::string_view function_name, WasmCallVoid<3> *f) } void NullPlugin::getFunction(std::string_view function_name, WasmCallVoid<5> *f) { - auto plugin = this; + auto *plugin = this; if (function_name == "proxy_on_http_call_response") { *f = [plugin](ContextBase *context, Word context_id, Word token, Word headers, Word body_size, Word trailers) { @@ -142,9 +141,9 @@ void NullPlugin::getFunction(std::string_view function_name, WasmCallVoid<5> *f) } void NullPlugin::getFunction(std::string_view function_name, WasmCallWord<1> *f) { - auto plugin = this; + auto *plugin = this; if (function_name == "malloc") { - *f = [](ContextBase *, Word size) -> Word { + *f = [](ContextBase * /*context*/, Word size) -> Word { return Word(reinterpret_cast(::malloc(size))); }; } else if (function_name == "proxy_on_new_connection") { @@ -164,23 +163,24 @@ void NullPlugin::getFunction(std::string_view function_name, WasmCallWord<1> *f) } void NullPlugin::getFunction(std::string_view function_name, WasmCallWord<2> *f) { - auto plugin = this; + auto *plugin = this; if (function_name == "main") { *f = nullptr; } else if (function_name == "proxy_on_vm_start") { *f = [plugin](ContextBase *context, Word context_id, Word configuration_size) { SaveRestoreContext saved_context(context); - return Word(plugin->onStart(context_id, configuration_size)); + return Word(static_cast(plugin->onStart(context_id, configuration_size))); }; } else if (function_name == "proxy_on_configure") { *f = [plugin](ContextBase *context, Word context_id, Word configuration_size) { SaveRestoreContext saved_context(context); - return Word(plugin->onConfigure(context_id, configuration_size)); + return Word(static_cast(plugin->onConfigure(context_id, configuration_size))); }; } else if (function_name == "proxy_validate_configuration") { *f = [plugin](ContextBase *context, Word context_id, Word configuration_size) { SaveRestoreContext saved_context(context); - return Word(plugin->validateConfiguration(context_id, configuration_size)); + return Word( + static_cast(plugin->validateConfiguration(context_id, configuration_size))); }; } else if (function_name == "proxy_on_request_trailers") { *f = [plugin](ContextBase *context, Word context_id, Word trailers) -> Word { @@ -209,7 +209,7 @@ void NullPlugin::getFunction(std::string_view function_name, WasmCallWord<2> *f) } void NullPlugin::getFunction(std::string_view function_name, WasmCallWord<3> *f) { - auto plugin = this; + auto *plugin = this; if (function_name == "proxy_on_downstream_data") { *f = [plugin](ContextBase *context, Word context_id, Word body_buffer_length, Word end_of_stream) -> Word { @@ -253,9 +253,9 @@ void NullPlugin::getFunction(std::string_view function_name, WasmCallWord<3> *f) null_plugin::Context *NullPlugin::ensureContext(uint64_t context_id, uint64_t root_context_id) { auto e = context_map_.insert(std::make_pair(context_id, nullptr)); if (e.second) { - auto root_base = context_map_[root_context_id].get(); - null_plugin::RootContext *root = root_base ? root_base->asRoot() : nullptr; - std::string root_id = root ? std::string(root->root_id()) : ""; + auto *root_base = context_map_[root_context_id].get(); + null_plugin::RootContext *root = (root_base != nullptr) ? root_base->asRoot() : nullptr; + std::string root_id = (root != nullptr) ? std::string(root->root_id()) : ""; auto factory = registry_->context_factories[root_id]; if (!factory) { error("no context factory for root_id: " + root_id); @@ -297,7 +297,8 @@ null_plugin::RootContext *NullPlugin::ensureRootContext(uint64_t context_id) { null_plugin::ContextBase *NullPlugin::getContextBase(uint64_t context_id) { auto it = context_map_.find(context_id); - if (it == context_map_.end() || !(it->second->asContext() || it->second->asRoot())) { + if (it == context_map_.end() || + !(it->second->asContext() != nullptr || it->second->asRoot() != nullptr)) { error("no base context context_id: " + std::to_string(context_id)); return nullptr; } @@ -306,7 +307,7 @@ null_plugin::ContextBase *NullPlugin::getContextBase(uint64_t context_id) { null_plugin::Context *NullPlugin::getContext(uint64_t context_id) { auto it = context_map_.find(context_id); - if (it == context_map_.end() || !it->second->asContext()) { + if (it == context_map_.end() || (it->second->asContext() == nullptr)) { error("no context context_id: " + std::to_string(context_id)); return nullptr; } @@ -315,7 +316,7 @@ null_plugin::Context *NullPlugin::getContext(uint64_t context_id) { null_plugin::RootContext *NullPlugin::getRootContext(uint64_t context_id) { auto it = context_map_.find(context_id); - if (it == context_map_.end() || !it->second->asRoot()) { + if (it == context_map_.end() || (it->second->asRoot() == nullptr)) { error("no root context_id: " + std::to_string(context_id)); return nullptr; } @@ -335,32 +336,32 @@ bool NullPlugin::validateConfiguration(uint64_t root_context_id, uint64_t config } bool NullPlugin::onStart(uint64_t root_context_id, uint64_t vm_configuration_size) { - if (registry_->proxy_on_vm_start_) { - return registry_->proxy_on_vm_start_(root_context_id, vm_configuration_size); + if (registry_->proxy_on_vm_start_ != nullptr) { + return registry_->proxy_on_vm_start_(root_context_id, vm_configuration_size) != 0U; } - return getRootContext(root_context_id)->onStart(vm_configuration_size) != 0; + return getRootContext(root_context_id)->onStart(vm_configuration_size); } bool NullPlugin::onConfigure(uint64_t root_context_id, uint64_t plugin_configuration_size) { - if (registry_->proxy_on_configure_) { - return registry_->proxy_on_configure_(root_context_id, plugin_configuration_size); + if (registry_->proxy_on_configure_ != nullptr) { + return registry_->proxy_on_configure_(root_context_id, plugin_configuration_size) != 0U; } return getRootContext(root_context_id)->onConfigure(plugin_configuration_size); } void NullPlugin::onTick(uint64_t root_context_id) { - if (registry_->proxy_on_tick_) { + if (registry_->proxy_on_tick_ != nullptr) { return registry_->proxy_on_tick_(root_context_id); } getRootContext(root_context_id)->onTick(); } void NullPlugin::onCreate(uint64_t context_id, uint64_t parent_context_id) { - if (registry_->proxy_on_context_create_) { + if (registry_->proxy_on_context_create_ != nullptr) { registry_->proxy_on_context_create_(context_id, parent_context_id); return; } - if (parent_context_id) { + if (parent_context_id != 0U) { ensureContext(context_id, parent_context_id)->onCreate(); } else { ensureRootContext(context_id)->onCreate(); @@ -463,14 +464,14 @@ void NullPlugin::onQueueReady(uint64_t context_id, uint64_t token) { void NullPlugin::onForeignFunction(uint64_t context_id, uint64_t foreign_function_id, uint64_t data_size) { - if (registry_->proxy_on_foreign_function_) { + if (registry_->proxy_on_foreign_function_ != nullptr) { return registry_->proxy_on_foreign_function_(context_id, foreign_function_id, data_size); } getContextBase(context_id)->onForeignFunction(foreign_function_id, data_size); } void NullPlugin::onLog(uint64_t context_id) { - if (registry_->proxy_on_log_) { + if (registry_->proxy_on_log_ != nullptr) { registry_->proxy_on_log_(context_id); return; } @@ -478,14 +479,14 @@ void NullPlugin::onLog(uint64_t context_id) { } uint64_t NullPlugin::onDone(uint64_t context_id) { - if (registry_->proxy_on_done_) { + if (registry_->proxy_on_done_ != nullptr) { return registry_->proxy_on_done_(context_id); } return getContextBase(context_id)->onDoneBase() ? 1 : 0; } void NullPlugin::onDelete(uint64_t context_id) { - if (registry_->proxy_on_delete_) { + if (registry_->proxy_on_delete_ != nullptr) { registry_->proxy_on_delete_(context_id); return; } @@ -496,13 +497,13 @@ void NullPlugin::onDelete(uint64_t context_id) { namespace null_plugin { RootContext *nullVmGetRoot(std::string_view root_id) { - auto null_vm = static_cast(current_context_->wasmVm()); - return static_cast(null_vm->plugin_.get())->getRoot(root_id); + auto *null_vm = dynamic_cast(current_context_->wasmVm()); + return dynamic_cast(null_vm->plugin_.get())->getRoot(root_id); } Context *nullVmGetContext(uint32_t context_id) { - auto null_vm = static_cast(current_context_->wasmVm()); - return static_cast(null_vm->plugin_.get())->getContext(context_id); + auto *null_vm = dynamic_cast(current_context_->wasmVm()); + return dynamic_cast(null_vm->plugin_.get())->getContext(context_id); } RootContext *getRoot(std::string_view root_id) { return nullVmGetRoot(root_id); } diff --git a/src/null/null_vm.cc b/src/null/null_vm.cc index aab2e3231..9772b58ef 100644 --- a/src/null/null_vm.cc +++ b/src/null/null_vm.cc @@ -15,7 +15,7 @@ #include "include/proxy-wasm/null_vm.h" -#include +#include #include #include @@ -31,29 +31,33 @@ std::unordered_map *null_vm_plugin_factories_ RegisterNullVmPluginFactory::RegisterNullVmPluginFactory(std::string_view name, NullVmPluginFactory factory) { - if (!null_vm_plugin_factories_) + if (null_vm_plugin_factories_ == nullptr) { null_vm_plugin_factories_ = new std::remove_reference::type; - (*null_vm_plugin_factories_)[std::string(name)] = factory; + } + (*null_vm_plugin_factories_)[std::string(name)] = std::move(factory); } std::unique_ptr NullVm::clone() { auto cloned_null_vm = std::make_unique(*this); - if (integration()) + if (integration()) { cloned_null_vm->integration().reset(integration()->clone()); + } cloned_null_vm->load(plugin_name_, {} /* unused */, {} /* unused */); return cloned_null_vm; } // "Load" the plugin by obtaining a pointer to it from the factory. -bool NullVm::load(std::string_view name, std::string_view, - const std::unordered_map) { - if (!null_vm_plugin_factories_) +bool NullVm::load(std::string_view plugin_name, std::string_view /*precompiled*/, + const std::unordered_map & /*function_names*/) { + if (null_vm_plugin_factories_ == nullptr) { return false; - auto factory = (*null_vm_plugin_factories_)[std::string(name)]; - if (!factory) + } + auto factory = (*null_vm_plugin_factories_)[std::string(plugin_name)]; + if (!factory) { return false; - plugin_name_ = name; + } + plugin_name_ = plugin_name; plugin_ = factory(); plugin_->wasm_vm_ = this; return true; @@ -72,14 +76,13 @@ std::optional NullVm::getMemory(uint64_t pointer, uint64_t siz } bool NullVm::setMemory(uint64_t pointer, uint64_t size, const void *data) { - if ((pointer == 0 || data == nullptr)) { + if (pointer == 0 || data == nullptr) { if (size != 0) { return false; - } else { - return true; } + return true; } - auto p = reinterpret_cast(pointer); + auto *p = reinterpret_cast(pointer); memcpy(p, data, size); return true; } @@ -88,7 +91,7 @@ bool NullVm::setWord(uint64_t pointer, Word data) { if (pointer == 0) { return false; } - auto p = reinterpret_cast(pointer); + auto *p = reinterpret_cast(pointer); memcpy(p, &data.u64_, sizeof(data.u64_)); return true; } @@ -97,7 +100,7 @@ bool NullVm::getWord(uint64_t pointer, Word *data) { if (pointer == 0) { return false; } - auto p = reinterpret_cast(pointer); + auto *p = reinterpret_cast(pointer); memcpy(&data->u64_, p, sizeof(data->u64_)); return true; } diff --git a/src/pairs_util.cc b/src/pairs_util.cc new file mode 100644 index 000000000..b8121882f --- /dev/null +++ b/src/pairs_util.cc @@ -0,0 +1,205 @@ +// Copyright 2016-2019 Envoy Project Authors +// 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. + +#include "include/proxy-wasm/pairs_util.h" + +#include +#include +#include +#include + +#include "include/proxy-wasm/exports.h" +#include "include/proxy-wasm/limits.h" +#include "include/proxy-wasm/word.h" + +namespace proxy_wasm { + +namespace { + +// Read trivially copyable type from char buffer and return value. Does not +// check if char buffer is large enough to contain instance of `T`. +template inline T unalignedLoad(const char *buffer) { + // Checking for undefined behaviour wrt std::memcpy. + static_assert(std::is_trivially_copyable_v, + "type must be trivially copyable to use std::memcpy"); + T result; + // Use std::memcpy to get around strict type aliasing rules. + std::memcpy(&result, buffer, sizeof(T)); + + return result; +} + +} // namespace + +using Sizes = std::vector>; + +size_t PairsUtil::pairsSize(const Pairs &pairs) { + size_t size = sizeof(uint32_t); // number of headers + for (const auto &p : pairs) { + size += 2 * sizeof(uint32_t); // size of name, size of value + size += p.first.size() + 1; // NULL-terminated name + size += p.second.size() + 1; // NULL-terminated value + } + return size; +} + +bool PairsUtil::marshalPairs(const Pairs &pairs, char *buffer, size_t size) { + if (buffer == nullptr) { + return false; + } + + char *pos = buffer; + const char *end = buffer + size; + + // Write number of pairs. + uint32_t num_pairs = + htowasm(pairs.size(), contextOrEffectiveContext() != nullptr + ? contextOrEffectiveContext()->wasmVm()->usesWasmByteOrder() + : false); + if (pos + sizeof(uint32_t) > end) { + return false; + } + ::memcpy(pos, &num_pairs, sizeof(uint32_t)); + pos += sizeof(uint32_t); + + for (const auto &p : pairs) { + // Write name length. + uint32_t name_len = + htowasm(p.first.size(), contextOrEffectiveContext() != nullptr + ? contextOrEffectiveContext()->wasmVm()->usesWasmByteOrder() + : false); + if (pos + sizeof(uint32_t) > end) { + return false; + } + ::memcpy(pos, &name_len, sizeof(uint32_t)); + pos += sizeof(uint32_t); + + // Write value length. + uint32_t value_len = + htowasm(p.second.size(), contextOrEffectiveContext() != nullptr + ? contextOrEffectiveContext()->wasmVm()->usesWasmByteOrder() + : false); + if (pos + sizeof(uint32_t) > end) { + return false; + } + ::memcpy(pos, &value_len, sizeof(uint32_t)); + pos += sizeof(uint32_t); + } + + for (const auto &p : pairs) { + // Write name. + if (pos + p.first.size() + 1 > end) { + return false; + } + ::memcpy(pos, p.first.data(), p.first.size()); + pos += p.first.size(); + *pos++ = '\0'; // NULL-terminated string. + + // Write value. + if (pos + p.second.size() + 1 > end) { + return false; + } + ::memcpy(pos, p.second.data(), p.second.size()); + pos += p.second.size(); + *pos++ = '\0'; // NULL-terminated string. + } + + return pos == end; +} + +Pairs PairsUtil::toPairs(std::string_view buffer) { + if (buffer.data() == nullptr || buffer.size() > PROXY_WASM_HOST_PAIRS_MAX_BYTES) { + return {}; + } + + const char *pos = buffer.data(); + const char *end = buffer.data() + buffer.size(); + + // Read number of pairs. + if (pos + sizeof(uint32_t) > end) { + return {}; + } + + // clang complains that this is unused when the wasmtoh macro drops its + // second argument on non-big-endian platforms. + [[maybe_unused]] const bool uses_wasm_byte_order = + contextOrEffectiveContext() != nullptr && + contextOrEffectiveContext()->wasmVm()->usesWasmByteOrder(); + uint32_t num_pairs = wasmtoh(unalignedLoad(pos), uses_wasm_byte_order); + pos += sizeof(uint32_t); + + // Check if we're not going to exceed the limit. + if (num_pairs > PROXY_WASM_HOST_PAIRS_MAX_COUNT) { + return {}; + } + if (pos + num_pairs * 2 * sizeof(uint32_t) > end) { + return {}; + } + + Sizes sizes; + sizes.resize(num_pairs); + + for (auto &s : sizes) { + // Read name length. + if (pos + sizeof(uint32_t) > end) { + return {}; + } + s.first = wasmtoh(unalignedLoad(pos), uses_wasm_byte_order); + pos += sizeof(uint32_t); + + // Read value length. + if (pos + sizeof(uint32_t) > end) { + return {}; + } + s.second = wasmtoh(unalignedLoad(pos), uses_wasm_byte_order); + pos += sizeof(uint32_t); + } + + Pairs pairs; + pairs.resize(num_pairs); + + for (uint32_t i = 0; i < num_pairs; i++) { + auto &s = sizes[i]; + auto &p = pairs[i]; + + // Don't overread. + if (pos + s.first + 1 > end) { + return {}; + } + p.first = std::string_view(pos, s.first); + pos += s.first; + if (*pos++ != '\0') { // NULL-terminated string. + return {}; + } + + // Don't overread. + if (pos + s.second + 1 > end) { + return {}; + } + p.second = std::string_view(pos, s.second); + pos += s.second; + if (*pos++ != '\0') { // NULL-terminated string. + return {}; + } + } + + if (pos != end) { + return {}; + } + + return pairs; +} + +} // namespace proxy_wasm diff --git a/src/shared_data.cc b/src/shared_data.cc index 73cbb1feb..0a91da58c 100644 --- a/src/shared_data.cc +++ b/src/shared_data.cc @@ -56,6 +56,22 @@ WasmResult SharedData::get(std::string_view vm_id, const std::string_view key, return WasmResult::NotFound; } +WasmResult SharedData::keys(std::string_view vm_id, std::vector *result) { + result->clear(); + + std::lock_guard lock(mutex_); + auto map = data_.find(std::string(vm_id)); + if (map == data_.end()) { + return WasmResult::Ok; + } + + for (const auto &kv : map->second) { + result->push_back(kv.first); + } + + return WasmResult::Ok; +} + WasmResult SharedData::set(std::string_view vm_id, std::string_view key, std::string_view value, uint32_t cas) { std::lock_guard lock(mutex_); @@ -68,7 +84,7 @@ WasmResult SharedData::set(std::string_view vm_id, std::string_view key, std::st } auto it = map->find(std::string(key)); if (it != map->end()) { - if (cas && cas != it->second.second) { + if (cas != 0U && cas != it->second.second) { return WasmResult::CasMismatch; } it->second = std::make_pair(std::string(value), nextCas()); @@ -78,4 +94,27 @@ WasmResult SharedData::set(std::string_view vm_id, std::string_view key, std::st return WasmResult::Ok; } +WasmResult SharedData::remove(std::string_view vm_id, std::string_view key, uint32_t cas, + std::pair *result) { + std::lock_guard lock(mutex_); + std::unordered_map> *map; + auto map_it = data_.find(std::string(vm_id)); + if (map_it == data_.end()) { + return WasmResult::NotFound; + } + map = &map_it->second; + auto it = map->find(std::string(key)); + if (it != map->end()) { + if (cas != 0U && cas != it->second.second) { + return WasmResult::CasMismatch; + } + if (result != nullptr) { + *result = it->second; + } + map->erase(it); + return WasmResult::Ok; + } + return WasmResult::NotFound; +} + } // namespace proxy_wasm diff --git a/src/shared_data.h b/src/shared_data.h index fec37aac8..0067afb46 100644 --- a/src/shared_data.h +++ b/src/shared_data.h @@ -23,17 +23,20 @@ namespace proxy_wasm { class SharedData { public: SharedData(bool register_vm_id_callback = true); - WasmResult get(std::string_view vm_id, const std::string_view key, + WasmResult get(std::string_view vm_id, std::string_view key, std::pair *result); + WasmResult keys(std::string_view vm_id, std::vector *result); WasmResult set(std::string_view vm_id, std::string_view key, std::string_view value, uint32_t cas); + WasmResult remove(std::string_view vm_id, std::string_view key, uint32_t cas, + std::pair *result); void deleteByVmId(std::string_view vm_id); private: uint32_t nextCas() { auto result = cas_; cas_++; - if (!cas_) { // 0 is not a valid CAS value. + if (cas_ == 0U) { // 0 is not a valid CAS value. cas_++; } return result; diff --git a/src/shared_queue.cc b/src/shared_queue.cc index 5b0a904f3..bfb3a7023 100644 --- a/src/shared_queue.cc +++ b/src/shared_queue.cc @@ -40,7 +40,7 @@ void SharedQueue::deleteByVmId(std::string_view vm_id) { std::lock_guard lock(mutex_); auto queue_keys = vm_queue_keys_.find(std::string(vm_id)); if (queue_keys != vm_queue_keys_.end()) { - for (auto queue_key : queue_keys->second) { + for (const auto &queue_key : queue_keys->second) { auto token = queue_tokens_.find(queue_key); if (token != queue_tokens_.end()) { queues_.erase(token->second); @@ -134,7 +134,7 @@ WasmResult SharedQueue::enqueue(uint32_t token, std::string_view value) { vm_key = target_queue->vm_key; context_id = target_queue->context_id; call_on_thread = target_queue->call_on_thread; - target_queue->queue.push_back(std::string(value)); + target_queue->queue.emplace_back(value); } call_on_thread([vm_key, context_id, token] { @@ -142,8 +142,8 @@ WasmResult SharedQueue::enqueue(uint32_t token, std::string_view value) { // Make sure that the lock is no longer held here. auto wasm = getThreadLocalWasm(vm_key); if (wasm) { - auto context = wasm->wasm()->getContext(context_id); - if (context) { + auto *context = wasm->wasm()->getContext(context_id); + if (context != nullptr) { context->onQueueReady(token); } } diff --git a/src/signature_util.cc b/src/signature_util.cc index 71b1341ce..46b9d3333 100644 --- a/src/signature_util.cc +++ b/src/signature_util.cc @@ -17,8 +17,10 @@ #include #include -#include +#ifdef PROXY_WASM_VERIFY_WITH_ED25519_PUBKEY +#include #include +#endif #include "include/proxy-wasm/bytecode_util.h" @@ -26,20 +28,21 @@ namespace { #ifdef PROXY_WASM_VERIFY_WITH_ED25519_PUBKEY -static uint8_t hex2dec(const unsigned char c) { +uint8_t hex2dec(const unsigned char c) { if (c >= '0' && c <= '9') { return c - '0'; - } else if (c >= 'a' && c <= 'f') { + } + if (c >= 'a' && c <= 'f') { return c - 'a' + 10; - } else if (c >= 'A' && c <= 'F') { + } + if (c >= 'A' && c <= 'F') { return c - 'A' + 10; - } else { - throw std::logic_error{"invalid hex character"}; } + throw std::logic_error{"invalid hex character"}; } template constexpr std::array hex2pubkey(const char (&hex)[2 * N + 1]) { - std::array pubkey; + std::array pubkey{}; for (size_t i = 0; i < pubkey.size(); i++) { pubkey[i] = hex2dec(hex[2 * i]) << 4 | hex2dec(hex[2 * i + 1]); } @@ -83,6 +86,7 @@ bool SignatureUtil::verifySignature(std::string_view bytecode, std::string &mess uint32_t alg_id; std::memcpy(&alg_id, payload.data(), sizeof(uint32_t)); + alg_id = wasmtoh(alg_id, true); if (alg_id != 2) { message = "Signature has a wrong alg_id (want: 2, is: " + std::to_string(alg_id) + ")"; @@ -103,7 +107,28 @@ bool SignatureUtil::verifySignature(std::string_view bytecode, std::string &mess static const auto ed25519_pubkey = hex2pubkey<32>(PROXY_WASM_VERIFY_WITH_ED25519_PUBKEY); - if (!ED25519_verify(hash, sizeof(hash), signature, ed25519_pubkey.data())) { + EVP_PKEY *pubkey = EVP_PKEY_new_raw_public_key(EVP_PKEY_ED25519, nullptr, ed25519_pubkey.data(), + 32 /* ED25519_PUBLIC_KEY_LEN */); + if (pubkey == nullptr) { + message = "Failed to load the public key"; + return false; + } + + EVP_MD_CTX *mdctx = EVP_MD_CTX_new(); + if (mdctx == nullptr) { + message = "Failed to allocate memory for EVP_MD_CTX"; + EVP_PKEY_free(pubkey); + return false; + } + + bool ok = + (EVP_DigestVerifyInit(mdctx, nullptr, nullptr, nullptr, pubkey) != 0) && + (EVP_DigestVerify(mdctx, signature, 64 /* ED25519_SIGNATURE_LEN */, hash, sizeof(hash)) != 0); + + EVP_MD_CTX_free(mdctx); + EVP_PKEY_free(pubkey); + + if (!ok) { message = "Signature mismatch"; return false; } diff --git a/src/v8/v8.cc b/src/v8/v8.cc index dee841702..f5a73b130 100644 --- a/src/v8/v8.cc +++ b/src/v8/v8.cc @@ -21,23 +21,35 @@ #include #include #include +#include #include #include #include -#include "v8.h" -#include "v8-version.h" +#include "include/proxy-wasm/limits.h" + +#include "absl/strings/str_format.h" +#include "include/v8-initialization.h" +#include "include/v8-version.h" +#include "include/v8.h" +#include "src/wasm/c-api.h" #include "wasm-api/wasm.hh" namespace proxy_wasm { -namespace { +namespace v8 { wasm::Engine *engine() { static std::once_flag init; static wasm::own engine; std::call_once(init, []() { - v8::V8::EnableWebAssemblyTrapHandler(true); + // Disable the Liftoff compiler to force optimized JIT up-front. + std::string args = absl::StrFormat("--wasm_max_mem_pages=%u --no-liftoff", + PROXY_WASM_HOST_MAX_WASM_MEMORY_SIZE_BYTES / + PROXY_WASM_HOST_WASM_MEMORY_PAGE_SIZE_BYTES); + ::v8::V8::SetFlagsFromString(args.c_str(), args.size()); + ::v8::V8::EnableWebAssemblyTrapHandler(true); + engine = wasm::Engine::make(); }); @@ -49,21 +61,21 @@ struct FuncData { std::string name_; wasm::own callback_; - void *raw_func_; - WasmVm *vm_; + void *raw_func_{}; + WasmVm *vm_{}; }; using FuncDataPtr = std::unique_ptr; class V8 : public WasmVm { public: - V8() {} + V8() = default; // WasmVm - std::string_view runtime() override { return "v8"; } + std::string_view getEngineName() override { return "v8"; } bool load(std::string_view bytecode, std::string_view precompiled, - const std::unordered_map function_names) override; + const std::unordered_map &function_names) override; std::string_view getPrecompiledSectionName() override; bool link(std::string_view debug_name) override; @@ -92,16 +104,23 @@ class V8 : public WasmVm { FOR_ALL_WASM_VM_EXPORTS(_GET_MODULE_FUNCTION) #undef _GET_MODULE_FUNCTION + void terminate() override; + bool usesWasmByteOrder() override { return true; } + + void warm() override; + private: + wasm::own trap(std::string message); + std::string getFailMessage(std::string_view function_name, wasm::own trap); template void registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - void (*function)(void *, Args...)); + void (*function)(Args...)); template void registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - R (*function)(void *, Args...)); + R (*function)(Args...)); template void getModuleFunctionImpl(std::string_view function_name, @@ -111,6 +130,9 @@ class V8 : public WasmVm { void getModuleFunctionImpl(std::string_view function_name, std::function *function); + // Initialize the V8 engine and store if necessary. + void initStore(); + wasm::own store_; wasm::own module_; wasm::own> shared_module_; @@ -127,27 +149,27 @@ class V8 : public WasmVm { static std::string printValue(const wasm::Val &value) { switch (value.kind()) { - case wasm::I32: + case wasm::ValKind::I32: return std::to_string(value.get()); - case wasm::I64: + case wasm::ValKind::I64: return std::to_string(value.get()); - case wasm::F32: + case wasm::ValKind::F32: return std::to_string(value.get()); - case wasm::F64: + case wasm::ValKind::F64: return std::to_string(value.get()); default: return "unknown"; } } -static std::string printValues(const wasm::Val values[], size_t size) { +static std::string printValues(const wasm::vec &values, size_t size) { if (size == 0) { return ""; } std::string s; for (size_t i = 0; i < size; i++) { - if (i) { + if (i != 0U) { s.append(", "); } s.append(printValue(values[i])); @@ -157,17 +179,17 @@ static std::string printValues(const wasm::Val values[], size_t size) { static const char *printValKind(wasm::ValKind kind) { switch (kind) { - case wasm::I32: + case wasm::ValKind::I32: return "i32"; - case wasm::I64: + case wasm::ValKind::I64: return "i64"; - case wasm::F32: + case wasm::ValKind::F32: return "f32"; - case wasm::F64: + case wasm::ValKind::F64: return "f64"; - case wasm::ANYREF: - return "anyref"; - case wasm::FUNCREF: + case wasm::ValKind::EXTERNREF: + return "externref"; + case wasm::ValKind::FUNCREF: return "funcref"; default: return "unknown"; @@ -182,7 +204,7 @@ static std::string printValTypes(const wasm::ownvec &types) { std::string s; s.reserve(types.size() * 8 /* max size + " " */ - 1); for (size_t i = 0; i < types.size(); i++) { - if (i) { + if (i != 0U) { s.append(" "); } s.append(printValKind(types[i]->kind())); @@ -216,14 +238,14 @@ template wasm::Val makeVal(T t) { return wasm::Val::make(t); } template <> wasm::Val makeVal(Word t) { return wasm::Val::make(static_cast(t.u64_)); } template constexpr auto convertArgToValKind(); -template <> constexpr auto convertArgToValKind() { return wasm::I32; }; -template <> constexpr auto convertArgToValKind() { return wasm::I32; }; -template <> constexpr auto convertArgToValKind() { return wasm::I64; }; -template <> constexpr auto convertArgToValKind() { return wasm::I64; }; -template <> constexpr auto convertArgToValKind() { return wasm::F64; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::I32; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::I32; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::I64; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::I64; }; +template <> constexpr auto convertArgToValKind() { return wasm::ValKind::F64; }; template -constexpr auto convertArgsTupleToValTypesImpl(std::index_sequence) { +constexpr auto convertArgsTupleToValTypesImpl(std::index_sequence /*comptime*/) { return wasm::ownvec::make( wasm::ValType::make(convertArgToValKind::type>())...); } @@ -233,7 +255,7 @@ template constexpr auto convertArgsTupleToValTypes() { } template -constexpr T convertValTypesToArgsTupleImpl(const U &arr, std::index_sequence) { +constexpr T convertValTypesToArgsTupleImpl(const U &arr, std::index_sequence /*comptime*/) { return std::make_tuple( (arr[I] .template get< @@ -247,28 +269,42 @@ template constexpr T convertValTypesToArgsTuple(const U // V8 implementation. -bool V8::load(std::string_view bytecode, std::string_view precompiled, - const std::unordered_map function_names) { +void V8::initStore() { + if (store_ != nullptr) { + return; + } store_ = wasm::Store::make(engine()); +} + +bool V8::load(std::string_view bytecode, std::string_view precompiled, + const std::unordered_map &function_names) { + initStore(); + if (store_ == nullptr) { + return false; + } if (!precompiled.empty()) { auto vec = wasm::vec::make_uninitialized(precompiled.size()); ::memcpy(vec.get(), precompiled.data(), precompiled.size()); module_ = wasm::Module::deserialize(store_.get(), vec); + if (module_ == nullptr) { + return false; + } } else { auto vec = wasm::vec::make_uninitialized(bytecode.size()); ::memcpy(vec.get(), bytecode.data(), bytecode.size()); module_ = wasm::Module::make(store_.get(), vec); + if (module_ == nullptr) { + return false; + } } - if (!module_) { + shared_module_ = module_->share(); + if (shared_module_ == nullptr) { return false; } - shared_module_ = module_->share(); - assert(shared_module_ != nullptr); - function_names_index_ = function_names; return true; @@ -278,10 +314,26 @@ std::unique_ptr V8::clone() { assert(shared_module_ != nullptr); auto clone = std::make_unique(); - clone->integration().reset(integration()->clone()); + if (clone == nullptr) { + return nullptr; + } + clone->store_ = wasm::Store::make(engine()); + if (clone->store_ == nullptr) { + return nullptr; + } clone->module_ = wasm::Module::obtain(clone->store_.get(), shared_module_.get()); + if (clone->module_ == nullptr) { + return nullptr; + } + + auto *integration_clone = integration()->clone(); + if (integration_clone == nullptr) { + return nullptr; + } + clone->integration().reset(integration_clone); + clone->function_names_index_ = function_names_index_; return clone; @@ -303,28 +355,29 @@ std::string_view V8::getPrecompiledSectionName() { return name; } -bool V8::link(std::string_view debug_name) { +bool V8::link(std::string_view /*debug_name*/) { assert(module_ != nullptr); const auto import_types = module_.get()->imports(); - std::vector imports; + wasm::vec imports = + wasm::vec::make_uninitialized(import_types.size()); for (size_t i = 0; i < import_types.size(); i++) { std::string_view module(import_types[i]->module().get(), import_types[i]->module().size()); std::string_view name(import_types[i]->name().get(), import_types[i]->name().size()); - auto import_type = import_types[i]->type(); + const auto *import_type = import_types[i]->type(); switch (import_type->kind()) { - case wasm::EXTERN_FUNC: { + case wasm::ExternKind::FUNC: { auto it = host_functions_.find(std::string(module) + "." + std::string(name)); if (it == host_functions_.end()) { fail(FailState::UnableToInitializeCode, std::string("Failed to load Wasm module due to a missing import: ") + std::string(module) + "." + std::string(name)); - break; + return false; } - auto func = it->second.get()->callback_.get(); + auto *func = it->second->callback_.get(); if (!equalValTypes(import_type->func()->params(), func->type()->params()) || !equalValTypes(import_type->func()->results(), func->type()->results())) { fail(FailState::UnableToInitializeCode, @@ -334,82 +387,102 @@ bool V8::link(std::string_view debug_name) { printValTypes(import_type->func()->results()) + ", but host exports: " + printValTypes(func->type()->params()) + " -> " + printValTypes(func->type()->results())); - break; + return false; } - imports.push_back(func); + imports[i] = func; } break; - case wasm::EXTERN_GLOBAL: { + case wasm::ExternKind::GLOBAL: { // TODO(PiotrSikora): add support when/if needed. fail(FailState::UnableToInitializeCode, "Failed to load Wasm module due to a missing import: " + std::string(module) + "." + std::string(name)); + return false; } break; - case wasm::EXTERN_MEMORY: { + case wasm::ExternKind::MEMORY: { assert(memory_ == nullptr); auto type = wasm::MemoryType::make(import_type->memory()->limits()); + if (type == nullptr) { + return false; + } memory_ = wasm::Memory::make(store_.get(), type.get()); - imports.push_back(memory_.get()); + if (memory_ == nullptr) { + return false; + } + imports[i] = memory_.get(); } break; - case wasm::EXTERN_TABLE: { + case wasm::ExternKind::TABLE: { assert(table_ == nullptr); auto type = wasm::TableType::make(wasm::ValType::make(import_type->table()->element()->kind()), import_type->table()->limits()); + if (type == nullptr) { + return false; + } table_ = wasm::Table::make(store_.get(), type.get()); - imports.push_back(table_.get()); + if (table_ == nullptr) { + return false; + } + imports[i] = table_.get(); } break; } } - if (import_types.size() != imports.size()) { + instance_ = wasm::Instance::make(store_.get(), module_.get(), imports); + if (instance_ == nullptr) { + fail(FailState::UnableToInitializeCode, "Failed to create new Wasm instance"); return false; } - instance_ = wasm::Instance::make(store_.get(), module_.get(), imports.data()); - const auto export_types = module_.get()->exports(); const auto exports = instance_.get()->exports(); assert(export_types.size() == exports.size()); for (size_t i = 0; i < export_types.size(); i++) { std::string_view name(export_types[i]->name().get(), export_types[i]->name().size()); - auto export_type = export_types[i]->type(); - auto export_item = exports[i].get(); + const auto *export_type = export_types[i]->type(); + auto *export_item = exports[i].get(); assert(export_type->kind() == export_item->kind()); switch (export_type->kind()) { - case wasm::EXTERN_FUNC: { + case wasm::ExternKind::FUNC: { assert(export_item->func() != nullptr); module_functions_.insert_or_assign(std::string(name), export_item->func()->copy()); } break; - case wasm::EXTERN_GLOBAL: { + case wasm::ExternKind::GLOBAL: { // TODO(PiotrSikora): add support when/if needed. } break; - case wasm::EXTERN_MEMORY: { + case wasm::ExternKind::MEMORY: { assert(export_item->memory() != nullptr); assert(memory_ == nullptr); memory_ = exports[i]->memory()->copy(); + if (memory_ == nullptr) { + return false; + } } break; - case wasm::EXTERN_TABLE: { + case wasm::ExternKind::TABLE: { // TODO(PiotrSikora): add support when/if needed. } break; } } - return !isFailed(); + return true; } uint64_t V8::getMemorySize() { return memory_->data_size(); } std::optional V8::getMemory(uint64_t pointer, uint64_t size) { assert(memory_ != nullptr); + // Make sure we're operating in a wasm32 memory space. + if (pointer > UINT32_MAX || size > UINT32_MAX || pointer + size > UINT32_MAX) { + return std::nullopt; + } if (pointer + size > memory_->data_size()) { return std::nullopt; } @@ -418,6 +491,10 @@ std::optional V8::getMemory(uint64_t pointer, uint64_t size) { bool V8::setMemory(uint64_t pointer, uint64_t size, const void *data) { assert(memory_ != nullptr); + // Make sure we're operating in a wasm32 memory space. + if (pointer > UINT32_MAX || size > UINT32_MAX || pointer + size > UINT32_MAX) { + return false; + } if (pointer + size > memory_->data_size()) { return false; } @@ -427,44 +504,59 @@ bool V8::setMemory(uint64_t pointer, uint64_t size, const void *data) { bool V8::getWord(uint64_t pointer, Word *word) { constexpr auto size = sizeof(uint32_t); + // Make sure we're operating in a wasm32 memory space. + if (pointer > UINT32_MAX || pointer + size > UINT32_MAX) { + return false; + } if (pointer + size > memory_->data_size()) { return false; } uint32_t word32; ::memcpy(&word32, memory_->data() + pointer, size); - word->u64_ = word32; + word->u64_ = wasmtoh(word32, true); return true; } bool V8::setWord(uint64_t pointer, Word word) { constexpr auto size = sizeof(uint32_t); + // Make sure we're operating in a wasm32 memory space. + if (pointer > UINT32_MAX || pointer + size > UINT32_MAX) { + return false; + } if (pointer + size > memory_->data_size()) { return false; } - uint32_t word32 = word.u32(); + uint32_t word32 = htowasm(word.u32(), true); ::memcpy(memory_->data() + pointer, &word32, size); return true; } +wasm::own V8::trap(std::string message) { + return wasm::Trap::make(store_.get(), wasm::Message::make(std::move(message))); +} + template void V8::registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - void (*function)(void *, Args...)) { + void (*function)(Args...)) { auto data = std::make_unique(std::string(module_name) + "." + std::string(function_name)); auto type = wasm::FuncType::make(convertArgsTupleToValTypes>(), convertArgsTupleToValTypes>()); auto func = wasm::Func::make( store_.get(), type.get(), - [](void *data, const wasm::Val params[], wasm::Val[]) -> wasm::own { - auto func_data = reinterpret_cast(data); + [](void *data, const wasm::vec ¶ms, + wasm::vec & /*results*/) -> wasm::own { + auto *func_data = reinterpret_cast(data); const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); if (log) { func_data->vm_->integration()->trace("[vm->host] " + func_data->name_ + "(" + printValues(params, sizeof...(Args)) + ")"); } - auto args_tuple = convertValTypesToArgsTuple>(params); - auto args = std::tuple_cat(std::make_tuple(current_context_), args_tuple); - auto function = reinterpret_cast(func_data->raw_func_); + if (!func_data->vm_->isHostFunctionAllowed(func_data->name_)) { + return dynamic_cast(func_data->vm_)->trap("restricted_callback"); + } + auto args = convertValTypesToArgsTuple>(params); + auto function = reinterpret_cast(func_data->raw_func_); std::apply(function, args); if (log) { func_data->vm_->integration()->trace("[vm<-host] " + func_data->name_ + " return: void"); @@ -482,23 +574,26 @@ void V8::registerHostFunctionImpl(std::string_view module_name, std::string_view template void V8::registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - R (*function)(void *, Args...)) { + R (*function)(Args...)) { auto data = std::make_unique(std::string(module_name) + "." + std::string(function_name)); auto type = wasm::FuncType::make(convertArgsTupleToValTypes>(), convertArgsTupleToValTypes>()); auto func = wasm::Func::make( store_.get(), type.get(), - [](void *data, const wasm::Val params[], wasm::Val results[]) -> wasm::own { - auto func_data = reinterpret_cast(data); + [](void *data, const wasm::vec ¶ms, + wasm::vec &results) -> wasm::own { + auto *func_data = reinterpret_cast(data); const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); if (log) { func_data->vm_->integration()->trace("[vm->host] " + func_data->name_ + "(" + printValues(params, sizeof...(Args)) + ")"); } - auto args_tuple = convertValTypesToArgsTuple>(params); - auto args = std::tuple_cat(std::make_tuple(current_context_), args_tuple); - auto function = reinterpret_cast(func_data->raw_func_); + if (!func_data->vm_->isHostFunctionAllowed(func_data->name_)) { + return dynamic_cast(func_data->vm_)->trap("restricted_callback"); + } + auto args = convertValTypesToArgsTuple>(params); + auto function = reinterpret_cast(func_data->raw_func_); R rvalue = std::apply(function, args); results[0] = makeVal(rvalue); if (log) { @@ -541,19 +636,23 @@ void V8::getModuleFunctionImpl(std::string_view function_name, const bool log = cmpLogLevel(LogLevel::trace); SaveRestoreContext saved_context(context); wasm::own trap = nullptr; + wasm::vec results = wasm::vec::make_uninitialized(); + + // Workaround for MSVC++ not supporting zero-sized arrays. if constexpr (sizeof...(args) > 0) { - wasm::Val params[] = {makeVal(args)...}; + wasm::vec params = wasm::vec::make(makeVal(args)...); if (log) { integration()->trace("[host->vm] " + std::string(function_name) + "(" + printValues(params, sizeof...(Args)) + ")"); } - trap = func->call(params, nullptr); + trap = func->call(params, results); } else { if (log) { integration()->trace("[host->vm] " + std::string(function_name) + "()"); } - trap = func->call(nullptr, nullptr); + trap = func->call(wasm::vec::make_uninitialized(), results); } + if (trap) { fail(FailState::RuntimeError, getFailMessage(std::string(function_name), std::move(trap))); return; @@ -588,10 +687,12 @@ void V8::getModuleFunctionImpl(std::string_view function_name, *function = [func, function_name, this](ContextBase *context, Args... args) -> R { const bool log = cmpLogLevel(LogLevel::trace); SaveRestoreContext saved_context(context); - wasm::Val results[1]; + wasm::vec results = wasm::vec::make_uninitialized(1); wasm::own trap = nullptr; + + // Workaround for MSVC++ not supporting zero-sized arrays. if constexpr (sizeof...(args) > 0) { - wasm::Val params[] = {makeVal(args)...}; + wasm::vec params = wasm::vec::make(makeVal(args)...); if (log) { integration()->trace("[host->vm] " + std::string(function_name) + "(" + printValues(params, sizeof...(Args)) + ")"); @@ -601,8 +702,9 @@ void V8::getModuleFunctionImpl(std::string_view function_name, if (log) { integration()->trace("[host->vm] " + std::string(function_name) + "()"); } - trap = func->call(nullptr, results); + trap = func->call(wasm::vec::make_uninitialized(), results); } + if (trap) { fail(FailState::RuntimeError, getFailMessage(std::string(function_name), std::move(trap))); return R{}; @@ -616,6 +718,14 @@ void V8::getModuleFunctionImpl(std::string_view function_name, }; } +void V8::terminate() { + auto *store_impl = reinterpret_cast(store_.get()); + auto *isolate = store_impl->isolate(); + isolate->TerminateExecution(); +} + +void V8::warm() { initStore(); } + std::string V8::getFailMessage(std::string_view function_name, wasm::own trap) { auto message = "Function: " + std::string(function_name) + " failed: "; message += std::string(trap->message().get(), trap->message().size()); @@ -627,7 +737,7 @@ std::string V8::getFailMessage(std::string_view function_name, wasm::owntrace(); message += "\nProxy-Wasm plugin in-VM backtrace:"; for (size_t i = 0; i < trace.size(); ++i) { - auto frame = trace[i].get(); + auto *frame = trace[i].get(); std::ostringstream oss; oss << std::setw(3) << std::setfill(' ') << std::to_string(i); message += "\n" + oss.str() + ": "; @@ -647,8 +757,8 @@ std::string V8::getFailMessage(std::string_view function_name, wasm::own createV8Vm() { return std::make_unique(); } +std::unique_ptr createV8Vm() { return std::make_unique(); } } // namespace proxy_wasm diff --git a/src/vm_id_handle.cc b/src/vm_id_handle.cc index 25429d276..d4eeef8d7 100644 --- a/src/vm_id_handle.cc +++ b/src/vm_id_handle.cc @@ -16,8 +16,8 @@ #include #include -#include #include +#include #include #include @@ -57,14 +57,14 @@ std::shared_ptr getVmIdHandle(std::string_view vm_id) { return handle; }; -void registerVmIdHandleCallback(std::function f) { +void registerVmIdHandleCallback(const std::function &f) { std::lock_guard lock(getGlobalIdHandleMutex()); getVmIdHandlesCallbacks().push_back(f); } VmIdHandle::~VmIdHandle() { std::lock_guard lock(getGlobalIdHandleMutex()); - for (auto f : getVmIdHandlesCallbacks()) { + for (const auto &f : getVmIdHandlesCallbacks()) { f(vm_id_); } getVmIdHandles().erase(vm_id_); diff --git a/src/wamr/types.h b/src/wamr/types.h index 4ea9c4fb4..7252c5c3d 100644 --- a/src/wamr/types.h +++ b/src/wamr/types.h @@ -15,13 +15,13 @@ #include "src/common/types.h" #include "wasm_c_api.h" -namespace proxy_wasm { -namespace wamr { +namespace proxy_wasm::wamr { using WasmEnginePtr = common::CSmartPtr; using WasmFuncPtr = common::CSmartPtr; using WasmStorePtr = common::CSmartPtr; using WasmModulePtr = common::CSmartPtr; +using WasmSharedModulePtr = common::CSmartPtr; using WasmMemoryPtr = common::CSmartPtr; using WasmTablePtr = common::CSmartPtr; using WasmInstancePtr = common::CSmartPtr; @@ -40,6 +40,4 @@ using WasmExternVec = using WasmValtypeVec = common::CSmartType; -} // namespace wamr - -} // namespace proxy_wasm +} // namespace proxy_wasm::wamr diff --git a/src/wamr/wamr.cc b/src/wamr/wamr.cc index 06f9ce465..8eef73590 100644 --- a/src/wamr/wamr.cc +++ b/src/wamr/wamr.cc @@ -40,8 +40,8 @@ struct HostFuncData { std::string name_; WasmFuncPtr callback_; - void *raw_func_; - WasmVm *vm_; + void *raw_func_{}; + WasmVm *vm_{}; }; using HostFuncDataPtr = std::unique_ptr; @@ -53,16 +53,17 @@ wasm_engine_t *engine() { class Wamr : public WasmVm { public: - Wamr() {} + Wamr() = default; - std::string_view runtime() override { return "wamr"; } - std::string_view getPrecompiledSectionName() override { return ""; } + std::string_view getEngineName() override { return "wamr"; } + // must use the exact name given by test-tools/append-aot-to-wasm/append_aot_to_wasm.py + std::string_view getPrecompiledSectionName() override { return "wamr-aot"; } - Cloneable cloneable() override { return Cloneable::NotCloneable; } - std::unique_ptr clone() override { return nullptr; } + Cloneable cloneable() override { return Cloneable::CompiledBytecode; } + std::unique_ptr clone() override; bool load(std::string_view bytecode, std::string_view precompiled, - const std::unordered_map function_names) override; + const std::unordered_map &function_names) override; bool link(std::string_view debug_name) override; uint64_t getMemorySize() override; std::optional getMemory(uint64_t pointer, uint64_t size) override; @@ -85,14 +86,20 @@ class Wamr : public WasmVm { }; FOR_ALL_WASM_VM_EXPORTS(_GET_MODULE_FUNCTION) #undef _GET_MODULE_FUNCTION + + void terminate() override {} + bool usesWasmByteOrder() override { return true; } + + void warm() override; + private: template void registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - void (*function)(void *, Args...)); + void (*function)(Args...)); template void registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - R (*function)(void *, Args...)); + R (*function)(Args...)); template void getModuleFunctionImpl(std::string_view function_name, @@ -102,8 +109,12 @@ class Wamr : public WasmVm { void getModuleFunctionImpl(std::string_view function_name, std::function *function); + // Initialize the Wamr store if necessary. + void initStore(); + WasmStorePtr store_; WasmModulePtr module_; + WasmSharedModulePtr shared_module_; WasmInstancePtr instance_; WasmMemoryPtr memory_; @@ -113,15 +124,77 @@ class Wamr : public WasmVm { std::unordered_map module_functions_; }; -bool Wamr::load(std::string_view bytecode, std::string_view, - const std::unordered_map) { +void Wamr::initStore() { + if (store_ != nullptr) { + return; + } store_ = wasm_store_new(engine()); +} + +bool Wamr::load(std::string_view bytecode, std::string_view precompiled, + const std::unordered_map & /*function_names*/) { + initStore(); + if (store_ == nullptr) { + return false; + } - WasmByteVec vec; - wasm_byte_vec_new(vec.get(), bytecode.size(), bytecode.data()); - module_ = wasm_module_new(store_.get(), vec.get()); + wasm_byte_vec_t binary = {0}; + if (precompiled.empty()) { + binary.size = bytecode.size(); + binary.data = const_cast(bytecode.data()); + binary.num_elems = bytecode.size(); + binary.size_of_elem = sizeof(byte_t); + binary.lock = nullptr; + } else { + // skip leading paddings + auto padding_count = static_cast(precompiled[0]); + precompiled.remove_prefix(padding_count + 1); + + binary.size = precompiled.size(); + binary.data = const_cast(precompiled.data()); + binary.num_elems = precompiled.size(); + binary.size_of_elem = sizeof(byte_t); + binary.lock = nullptr; + } - return module_ != nullptr; + module_ = wasm_module_new(store_.get(), &binary); + if (module_ == nullptr) { + return false; + } + + shared_module_ = wasm_module_share(module_.get()); + if (shared_module_ == nullptr) { + return false; + } + + return true; +} + +std::unique_ptr Wamr::clone() { + assert(module_ != nullptr); + + auto vm = std::make_unique(); + if (vm == nullptr) { + return nullptr; + } + + vm->store_ = wasm_store_new(engine()); + if (vm->store_ == nullptr) { + return nullptr; + } + + vm->module_ = wasm_module_obtain(vm->store_.get(), shared_module_.get()); + if (vm->module_ == nullptr) { + return nullptr; + } + + auto *integration_clone = integration()->clone(); + if (integration_clone == nullptr) { + return nullptr; + } + vm->integration().reset(integration_clone); + + return vm; } static bool equalValTypes(const wasm_valtype_vec_t *left, const wasm_valtype_vec_t *right) { @@ -153,17 +226,17 @@ static std::string printValue(const wasm_val_t &value) { } } -static std::string printValues(const wasm_val_t values[], size_t size) { - if (size == 0) { +static std::string printValues(const wasm_val_vec_t *values) { + if (values->size == 0) { return ""; } std::string s; - for (size_t i = 0; i < size; i++) { - if (i) { + for (size_t i = 0; i < values->size; i++) { + if (i != 0U) { s.append(", "); } - s.append(printValue(values[i])); + s.append(printValue(values->data[i])); } return s; } @@ -178,8 +251,8 @@ static const char *printValKind(wasm_valkind_t kind) { return "f32"; case WASM_F64: return "f64"; - case WASM_ANYREF: - return "anyref"; + case WASM_EXTERNREF: + return "externref"; case WASM_FUNCREF: return "funcref"; default: @@ -195,7 +268,7 @@ static std::string printValTypes(const wasm_valtype_vec_t *types) { std::string s; s.reserve(types->size * 8 /* max size + " " */ - 1); for (size_t i = 0; i < types->size; i++) { - if (i) { + if (i != 0U) { s.append(" "); } s.append(printValKind(wasm_valtype_kind(types->data[i]))); @@ -203,21 +276,27 @@ static std::string printValTypes(const wasm_valtype_vec_t *types) { return s; } -bool Wamr::link(std::string_view debug_name) { +bool Wamr::link(std::string_view /*debug_name*/) { assert(module_ != nullptr); WasmImporttypeVec import_types; wasm_module_imports(module_.get(), import_types.get()); - std::vector imports; + std::vector imports; for (size_t i = 0; i < import_types.get()->size; i++) { const wasm_name_t *module_name_ptr = wasm_importtype_module(import_types.get()->data[i]); const wasm_name_t *name_ptr = wasm_importtype_name(import_types.get()->data[i]); const wasm_externtype_t *extern_type = wasm_importtype_type(import_types.get()->data[i]); - std::string_view module_name(module_name_ptr->data, module_name_ptr->size); - std::string_view name(name_ptr->data, name_ptr->size); - assert(name_ptr->size > 0); + if (std::strlen(name_ptr->data) == 0) { + fail(FailState::UnableToInitializeCode, std::string("The name field of import_types[") + + std::to_string(i) + std::string("] is empty")); + return false; + } + + std::string_view module_name(module_name_ptr->data); + std::string_view name(name_ptr->data); + switch (wasm_externtype_kind(extern_type)) { case WASM_EXTERN_FUNC: { auto it = host_functions_.find(std::string(module_name) + "." + std::string(name)); @@ -225,10 +304,10 @@ bool Wamr::link(std::string_view debug_name) { fail(FailState::UnableToInitializeCode, std::string("Failed to load Wasm module due to a missing import: ") + std::string(module_name) + "." + std::string(name)); - break; + return false; } - auto func = it->second->callback_.get(); + auto *func = it->second->callback_.get(); const wasm_functype_t *exp_type = wasm_externtype_as_functype_const(extern_type); WasmFunctypePtr actual_type = wasm_func_type(it->second->callback_.get()); if (!equalValTypes(wasm_functype_params(exp_type), wasm_functype_params(actual_type.get())) || @@ -242,7 +321,7 @@ bool Wamr::link(std::string_view debug_name) { printValTypes(wasm_functype_results(exp_type)) + ", but host exports: " + printValTypes(wasm_functype_params(actual_type.get())) + " -> " + printValTypes(wasm_functype_results(actual_type.get()))); - break; + return false; } imports.push_back(wasm_func_as_extern(func)); } break; @@ -251,19 +330,32 @@ bool Wamr::link(std::string_view debug_name) { fail(FailState::UnableToInitializeCode, "Failed to load Wasm module due to a missing import: " + std::string(module_name) + "." + std::string(name)); + return false; } break; case WASM_EXTERN_MEMORY: { assert(memory_ == nullptr); const wasm_memorytype_t *memory_type = wasm_externtype_as_memorytype_const(extern_type); // owned by `extern_type` + if (memory_type == nullptr) { + return false; + } memory_ = wasm_memory_new(store_.get(), memory_type); + if (memory_ == nullptr) { + return false; + } imports.push_back(wasm_memory_as_extern(memory_.get())); } break; case WASM_EXTERN_TABLE: { assert(table_ == nullptr); const wasm_tabletype_t *table_type = wasm_externtype_as_tabletype_const(extern_type); // owned by `extern_type` + if (table_type == nullptr) { + return false; + } table_ = wasm_table_new(store_.get(), table_type, nullptr); + if (table_ == nullptr) { + return false; + } imports.push_back(wasm_table_as_extern(table_.get())); } break; } @@ -273,8 +365,12 @@ bool Wamr::link(std::string_view debug_name) { return false; } - instance_ = wasm_instance_new(store_.get(), module_.get(), imports.data(), nullptr); - assert(instance_ != nullptr); + wasm_extern_vec_t imports_vec = {imports.size(), imports.data(), imports.size()}; + instance_ = wasm_instance_new(store_.get(), module_.get(), &imports_vec, nullptr); + if (instance_ == nullptr) { + fail(FailState::UnableToInitializeCode, "Failed to create new Wasm instance"); + return false; + } WasmExportTypeVec export_types; wasm_module_exports(module_.get(), export_types.get()); @@ -283,17 +379,15 @@ bool Wamr::link(std::string_view debug_name) { wasm_instance_exports(instance_.get(), exports.get()); for (size_t i = 0; i < export_types.get()->size; i++) { - const wasm_externtype_t *exp_extern_type = wasm_exporttype_type(export_types.get()->data[i]); wasm_extern_t *actual_extern = exports.get()->data[i]; wasm_externkind_t kind = wasm_extern_kind(actual_extern); - assert(kind == wasm_externtype_kind(exp_extern_type)); + assert(kind == wasm_externtype_kind(wasm_exporttype_type(export_types.get()->data[i]))); switch (kind) { case WASM_EXTERN_FUNC: { WasmFuncPtr func = wasm_func_copy(wasm_extern_as_func(actual_extern)); const wasm_name_t *name_ptr = wasm_exporttype_name(export_types.get()->data[i]); - module_functions_.insert_or_assign(std::string(name_ptr->data, name_ptr->size), - std::move(func)); + module_functions_.insert_or_assign(std::string(name_ptr->data), std::move(func)); } break; case WASM_EXTERN_GLOBAL: { // TODO(mathetake): add support when/if needed. @@ -301,7 +395,9 @@ bool Wamr::link(std::string_view debug_name) { case WASM_EXTERN_MEMORY: { assert(memory_ == nullptr); memory_ = wasm_memory_copy(wasm_extern_as_memory(actual_extern)); - assert(memory_ != nullptr); + if (memory_ == nullptr) { + return false; + } } break; case WASM_EXTERN_TABLE: { // TODO(mathetake): add support when/if needed. @@ -339,7 +435,7 @@ bool Wamr::getWord(uint64_t pointer, Word *word) { uint32_t word32; ::memcpy(&word32, wasm_memory_data(memory_.get()) + pointer, size); - word->u64_ = word32; + word->u64_ = wasmtoh(word32, true); return true; } @@ -348,7 +444,7 @@ bool Wamr::setWord(uint64_t pointer, Word word) { if (pointer + size > wasm_memory_data_size(memory_.get())) { return false; } - uint32_t word32 = word.u32(); + uint32_t word32 = htowasm(word.u32(), true); ::memcpy(wasm_memory_data(memory_.get()) + pointer, &word32, size); return true; } @@ -403,18 +499,15 @@ template <> uint64_t convertValueTypeToArg(wasm_val_t val) { template <> double convertValueTypeToArg(wasm_val_t val) { return val.of.f64; } template -constexpr T convertValTypesToArgsTupleImpl(const U &arr, std::index_sequence) { +constexpr T convertValTypesToArgsTuple(const U &vec, std::index_sequence /*comptime*/) { return std::make_tuple( - convertValueTypeToArg>::type>(arr[I])...); -} - -template ::value>> -constexpr T convertValTypesToArgsTuple(const U &arr) { - return convertValTypesToArgsTupleImpl(arr, Is()); + convertValueTypeToArg>::type>( + vec->data[I])...); } template -void convertArgsTupleToValTypesImpl(wasm_valtype_vec_t *types, std::index_sequence) { +void convertArgsTupleToValTypesImpl(wasm_valtype_vec_t *types, + std::index_sequence /*comptime*/) { auto size = std::tuple_size::value; auto ps = std::array::value>{ convertArgToValTypePtr::type>()...}; @@ -427,14 +520,16 @@ void convertArgsTupleToValTypes(wasm_valtype_vec_t *types) { } template WasmFunctypePtr newWasmNewFuncType() { - wasm_valtype_vec_t params, results; + wasm_valtype_vec_t params; + wasm_valtype_vec_t results; convertArgsTupleToValTypes(¶ms); convertArgsTupleToValTypes>(&results); return wasm_functype_new(¶ms, &results); } template WasmFunctypePtr newWasmNewFuncType() { - wasm_valtype_vec_t params, results; + wasm_valtype_vec_t params; + wasm_valtype_vec_t results; convertArgsTupleToValTypes(¶ms); convertArgsTupleToValTypes>(&results); return wasm_functype_new(¶ms, &results); @@ -442,23 +537,23 @@ template WasmFunctypePtr newWasmNewFuncType() { template void Wamr::registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - void (*function)(void *, Args...)) { + void (*function)(Args...)) { auto data = std::make_unique(std::string(module_name) + "." + std::string(function_name)); WasmFunctypePtr type = newWasmNewFuncType>(); WasmFuncPtr func = wasm_func_new_with_env( store_.get(), type.get(), - [](void *data, const wasm_val_t params[], wasm_val_t results[]) -> wasm_trap_t * { - auto func_data = reinterpret_cast(data); + [](void *data, const wasm_val_vec_t *params, wasm_val_vec_t * /*results*/) -> wasm_trap_t * { + auto *func_data = reinterpret_cast(data); const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); if (log) { func_data->vm_->integration()->trace("[vm->host] " + func_data->name_ + "(" + - printValues(params, sizeof...(Args)) + ")"); + printValues(params) + ")"); } - auto args_tuple = convertValTypesToArgsTuple>(params); - auto args = std::tuple_cat(std::make_tuple(current_context_), args_tuple); - auto fn = reinterpret_cast(func_data->raw_func_); + auto args = convertValTypesToArgsTuple>( + params, std::make_index_sequence{}); + auto fn = reinterpret_cast(func_data->raw_func_); std::apply(fn, args); if (log) { func_data->vm_->integration()->trace("[vm<-host] " + func_data->name_ + " return: void"); @@ -476,24 +571,24 @@ void Wamr::registerHostFunctionImpl(std::string_view module_name, std::string_vi template void Wamr::registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - R (*function)(void *, Args...)) { + R (*function)(Args...)) { auto data = std::make_unique(std::string(module_name) + "." + std::string(function_name)); WasmFunctypePtr type = newWasmNewFuncType>(); WasmFuncPtr func = wasm_func_new_with_env( store_.get(), type.get(), - [](void *data, const wasm_val_t params[], wasm_val_t results[]) -> wasm_trap_t * { - auto func_data = reinterpret_cast(data); + [](void *data, const wasm_val_vec_t *params, wasm_val_vec_t *results) -> wasm_trap_t * { + auto *func_data = reinterpret_cast(data); const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); if (log) { func_data->vm_->integration()->trace("[vm->host] " + func_data->name_ + "(" + - printValues(params, sizeof...(Args)) + ")"); + printValues(params) + ")"); } - auto args_tuple = convertValTypesToArgsTuple>(params); - auto args = std::tuple_cat(std::make_tuple(current_context_), args_tuple); - auto fn = reinterpret_cast(func_data->raw_func_); + auto args = convertValTypesToArgsTuple>( + params, std::make_index_sequence{}); + auto fn = reinterpret_cast(func_data->raw_func_); R res = std::apply(fn, args); - assignVal(res, results[0]); + assignVal(res, results->data[0]); if (log) { func_data->vm_->integration()->trace("[vm<-host] " + func_data->name_ + " return: " + std::to_string(res)); @@ -519,7 +614,8 @@ void Wamr::getModuleFunctionImpl(std::string_view function_name, return; } - WasmValtypeVec exp_args, exp_returns; + WasmValtypeVec exp_args; + WasmValtypeVec exp_returns; convertArgsTupleToValTypes>(exp_args.get()); convertArgsTupleToValTypes>(exp_returns.get()); wasm_func_t *func = it->second.get(); @@ -536,20 +632,22 @@ void Wamr::getModuleFunctionImpl(std::string_view function_name, } *function = [func, function_name, this](ContextBase *context, Args... args) -> void { - wasm_val_t params[] = {makeVal(args)...}; + wasm_val_t params_arr[] = {makeVal(args)...}; + const wasm_val_vec_t params = WASM_ARRAY_VEC(params_arr); + wasm_val_vec_t results = WASM_EMPTY_VEC; const bool log = cmpLogLevel(LogLevel::trace); if (log) { - integration()->trace("[host->vm] " + std::string(function_name) + "(" + - printValues(params, sizeof...(Args)) + ")"); + integration()->trace("[host->vm] " + std::string(function_name) + "(" + printValues(¶ms) + + ")"); } SaveRestoreContext saved_context(context); - WasmTrapPtr trap{wasm_func_call(func, params, nullptr)}; + WasmTrapPtr trap{wasm_func_call(func, ¶ms, &results)}; if (trap) { WasmByteVec error_message; wasm_trap_message(trap.get(), error_message.get()); + std::string message(error_message.get()->data); // NULL-terminated fail(FailState::RuntimeError, - "Function: " + std::string(function_name) + " failed:\n" + - std::string(error_message.get()->data, error_message.get()->size)); + "Function: " + std::string(function_name) + " failed: " + message); return; } if (log) { @@ -566,7 +664,8 @@ void Wamr::getModuleFunctionImpl(std::string_view function_name, *function = nullptr; return; } - WasmValtypeVec exp_args, exp_returns; + WasmValtypeVec exp_args; + WasmValtypeVec exp_returns; convertArgsTupleToValTypes>(exp_args.get()); convertArgsTupleToValTypes>(exp_returns.get()); wasm_func_t *func = it->second.get(); @@ -582,24 +681,26 @@ void Wamr::getModuleFunctionImpl(std::string_view function_name, } *function = [func, function_name, this](ContextBase *context, Args... args) -> R { - wasm_val_t params[] = {makeVal(args)...}; - wasm_val_t results[1]; + wasm_val_t params_arr[] = {makeVal(args)...}; + const wasm_val_vec_t params = WASM_ARRAY_VEC(params_arr); + wasm_val_t results_arr[1]; + wasm_val_vec_t results = WASM_ARRAY_VEC(results_arr); const bool log = cmpLogLevel(LogLevel::trace); if (log) { - integration()->trace("[host->vm] " + std::string(function_name) + "(" + - printValues(params, sizeof...(Args)) + ")"); + integration()->trace("[host->vm] " + std::string(function_name) + "(" + printValues(¶ms) + + ")"); } SaveRestoreContext saved_context(context); - WasmTrapPtr trap{wasm_func_call(func, params, results)}; + WasmTrapPtr trap{wasm_func_call(func, ¶ms, &results)}; if (trap) { WasmByteVec error_message; wasm_trap_message(trap.get(), error_message.get()); + std::string message(error_message.get()->data); // NULL-terminated fail(FailState::RuntimeError, - "Function: " + std::string(function_name) + " failed:\n" + - std::string(error_message.get()->data, error_message.get()->size)); + "Function: " + std::string(function_name) + " failed: " + message); return R{}; } - R ret = convertValueTypeToArg(results[0]); + R ret = convertValueTypeToArg(results.data[0]); if (log) { integration()->trace("[host<-vm] " + std::string(function_name) + " return: " + std::to_string(ret)); @@ -608,6 +709,8 @@ void Wamr::getModuleFunctionImpl(std::string_view function_name, }; }; +void Wamr::warm() { initStore(); } + } // namespace wamr std::unique_ptr createWamrVm() { return std::make_unique(); } diff --git a/src/wasm.cc b/src/wasm.cc index ff3772bd0..a1b4c1836 100644 --- a/src/wasm.cc +++ b/src/wasm.cc @@ -16,84 +16,93 @@ #include "include/proxy-wasm/wasm.h" #include -#include +#include #include #include #include #include #include +#include #include #include - -#include +#include #include "include/proxy-wasm/bytecode_util.h" #include "include/proxy-wasm/signature_util.h" #include "include/proxy-wasm/vm_id_handle.h" +#include "src/hash.h" namespace proxy_wasm { -thread_local ContextBase *current_context_; -thread_local uint32_t effective_context_id_ = 0; - namespace { -// Map from Wasm Key to the local Wasm instance. +// Map from Wasm key to the thread-local Wasm instance. thread_local std::unordered_map> local_wasms; +// Wasm key queue to track stale entries in `local_wasms`. +thread_local std::queue local_wasms_keys; + +// Map from plugin key to the thread-local plugin instance. thread_local std::unordered_map> local_plugins; +// Plugin key queue to track stale entries in `local_plugins`. +thread_local std::queue local_plugins_keys; + +// Check no more than `MAX_LOCAL_CACHE_GC_CHUNK_SIZE` cache entries at a time during stale entries +// cleanup. +const size_t MAX_LOCAL_CACHE_GC_CHUNK_SIZE = 64; + // Map from Wasm Key to the base Wasm instance, using a pointer to avoid the initialization fiasco. std::mutex base_wasms_mutex; std::unordered_map> *base_wasms = nullptr; -std::unordered_map *foreign_functions = nullptr; -const std::string INLINE_STRING = ""; +void cacheLocalWasm(const std::string &key, const std::shared_ptr &wasm_handle) { + local_wasms[key] = wasm_handle; + local_wasms_keys.emplace(key); +} -std::vector Sha256(const std::vector parts) { - uint8_t sha256[SHA256_DIGEST_LENGTH]; - SHA256_CTX sha_ctx; - SHA256_Init(&sha_ctx); - for (auto part : parts) { - SHA256_Update(&sha_ctx, part.data(), part.size()); - } - SHA256_Final(sha256, &sha_ctx); - return std::vector(std::begin(sha256), std::end(sha256)); +void cacheLocalPlugin(const std::string &key, + const std::shared_ptr &plugin_handle) { + local_plugins[key] = plugin_handle; + local_plugins_keys.emplace(key); } -std::string BytesToHex(std::vector bytes) { - static const char *const hex = "0123456789ABCDEF"; - std::string result; - result.reserve(bytes.size() * 2); - for (auto byte : bytes) { - result.push_back(hex[byte >> 4]); - result.push_back(hex[byte & 0xf]); +template +void removeStaleLocalCacheEntries(std::unordered_map> &cache, + std::queue &keys) { + auto num_keys_to_check = std::min(MAX_LOCAL_CACHE_GC_CHUNK_SIZE, keys.size()); + for (size_t i = 0; i < num_keys_to_check; i++) { + std::string key(keys.front()); + keys.pop(); + + const auto it = cache.find(key); + if (it == cache.end()) { + continue; + } + + if (it->second.expired()) { + cache.erase(it); + } else { + keys.push(std::move(key)); + } } - return result; } } // namespace std::string makeVmKey(std::string_view vm_id, std::string_view vm_configuration, std::string_view code) { - return BytesToHex(Sha256({vm_id, vm_configuration, code})); + return Sha256String({vm_id, "||", vm_configuration, "||", code}); } class WasmBase::ShutdownHandle { public: ~ShutdownHandle() { wasm_->finishShutdown(); } - ShutdownHandle(std::shared_ptr wasm) : wasm_(wasm) {} + ShutdownHandle(std::shared_ptr wasm) : wasm_(std::move(wasm)) {} private: std::shared_ptr wasm_; }; -RegisterForeignFunction::RegisterForeignFunction(std::string name, WasmForeignFunction f) { - if (!foreign_functions) { - foreign_functions = new std::remove_reference::type; - } - (*foreign_functions)[name] = f; -} - void WasmBase::registerCallbacks() { #define _REGISTER(_fn) \ wasm_vm_->registerCallback( \ @@ -101,6 +110,7 @@ void WasmBase::registerCallbacks() { &ConvertFunctionWordToUint32::convertFunctionWordToUint32) _REGISTER(pthread_equal); + _REGISTER(emscripten_notify_memory_growth); #undef _REGISTER // Register the capability with the VM if it has been allowed, otherwise register a stub. @@ -195,7 +205,8 @@ void WasmBase::getFunctions() { #undef _GET_PROXY } -WasmBase::WasmBase(const std::shared_ptr &base_wasm_handle, WasmVmFactory factory) +WasmBase::WasmBase(const std::shared_ptr &base_wasm_handle, + const WasmVmFactory &factory) : std::enable_shared_from_this(*base_wasm_handle->wasm()), vm_id_(base_wasm_handle->wasm()->vm_id_), vm_key_(base_wasm_handle->wasm()->vm_key_), started_from_(base_wasm_handle->wasm()->wasm_vm()->cloneable()), @@ -210,7 +221,7 @@ WasmBase::WasmBase(const std::shared_ptr &base_wasm_handle, Wasm if (!wasm_vm_) { failed_ = FailState::UnableToCreateVm; } else { - wasm_vm_->setFailCallback([this](FailState fail_state) { failed_ = fail_state; }); + wasm_vm_->addFailCallback([this](FailState fail_state) { failed_ = fail_state; }); } } @@ -219,12 +230,12 @@ WasmBase::WasmBase(std::unique_ptr wasm_vm, std::string_view vm_id, std::unordered_map envs, AllowedCapabilitiesMap allowed_capabilities) : vm_id_(std::string(vm_id)), vm_key_(std::string(vm_key)), wasm_vm_(std::move(wasm_vm)), - envs_(envs), allowed_capabilities_(std::move(allowed_capabilities)), + envs_(std::move(envs)), allowed_capabilities_(std::move(allowed_capabilities)), vm_configuration_(std::string(vm_configuration)), vm_id_handle_(getVmIdHandle(vm_id)) { if (!wasm_vm_) { failed_ = FailState::UnableToCreateVm; } else { - wasm_vm_->setFailCallback([this](FailState fail_state) { failed_ = fail_state; }); + wasm_vm_->addFailCallback([this](FailState fail_state) { failed_ = fail_state; }); } } @@ -241,7 +252,7 @@ bool WasmBase::load(const std::string &code, bool allow_precompiled) { return false; } - if (wasm_vm_->runtime() == "null") { + if (wasm_vm_->getEngineName() == "null") { auto ok = wasm_vm_->load(code, {}, {}); if (!ok) { fail(FailState::UnableToInitializeCode, "Failed to load NullVM plugin"); @@ -256,7 +267,8 @@ bool WasmBase::load(const std::string &code, bool allow_precompiled) { if (!SignatureUtil::verifySignature(code, message)) { fail(FailState::UnableToInitializeCode, message); return false; - } else { + } + if (!message.empty()) { wasm_vm_->integration()->trace(message); } @@ -302,7 +314,7 @@ bool WasmBase::load(const std::string &code, bool allow_precompiled) { return false; } - // Store for future use in non-cloneable runtimes. + // Store for future use in non-cloneable Wasm engines. if (wasm_vm_->cloneable() == Cloneable::NotCloneable) { module_bytecode_ = stripped; module_precompiled_ = precompiled; @@ -364,6 +376,30 @@ ContextBase *WasmBase::getRootContext(const std::shared_ptr &plugin, } void WasmBase::startVm(ContextBase *root_context) { + // wasi_snapshot_preview1.clock_time_get + wasm_vm_->setRestrictedCallback( + true, {// emscripten + "env.emscripten_notify_memory_growth", + // logging (Proxy-Wasm) + "env.proxy_log", + // logging (stdout/stderr) + "wasi_unstable.fd_write", "wasi_snapshot_preview1.fd_write", + // args + "wasi_unstable.args_sizes_get", "wasi_snapshot_preview1.args_sizes_get", + "wasi_unstable.args_get", "wasi_snapshot_preview1.args_get", + // environment variables + "wasi_unstable.environ_sizes_get", "wasi_snapshot_preview1.environ_sizes_get", + "wasi_unstable.environ_get", "wasi_snapshot_preview1.environ_get", + // preopened files/directories + "wasi_unstable.fd_prestat_get", "wasi_snapshot_preview1.fd_prestat_get", + "wasi_unstable.fd_prestat_dir_name", "wasi_snapshot_preview1.fd_prestat_dir_name", + // time + "wasi_unstable.clock_time_get", "wasi_snapshot_preview1.clock_time_get", + // random + "wasi_unstable.random_get", "wasi_snapshot_preview1.random_get", + // Go runtime initialization + "wasi_unstable.fd_fdstat_get", "wasi_snapshot_preview1.fd_fdstat_get", + "wasi_unstable.fd_fdstat_set_flags", "wasi_snapshot_preview1.fd_fdstat_set_flags"}); if (_initialize_) { // WASI reactor. _initialize_(root_context); @@ -379,20 +415,21 @@ void WasmBase::startVm(ContextBase *root_context) { // WASI command. _start_(root_context); } + wasm_vm_->setRestrictedCallback(false); } bool WasmBase::configure(ContextBase *root_context, std::shared_ptr plugin) { - return root_context->onConfigure(plugin); + return root_context->onConfigure(std::move(plugin)); } -ContextBase *WasmBase::start(std::shared_ptr plugin) { +ContextBase *WasmBase::start(const std::shared_ptr &plugin) { auto it = root_contexts_.find(plugin->key()); if (it != root_contexts_.end()) { it->second->onStart(plugin); return it->second.get(); } auto context = std::unique_ptr(createRootContext(plugin)); - auto context_ptr = context.get(); + auto *context_ptr = context.get(); root_contexts_[plugin->key()] = std::move(context); if (!context_ptr->onStart(plugin)) { return nullptr; @@ -456,23 +493,50 @@ void WasmBase::finishShutdown() { } } -WasmForeignFunction WasmBase::getForeignFunction(std::string_view function_name) { - auto it = foreign_functions->find(std::string(function_name)); - if (it != foreign_functions->end()) { +bool WasmHandleBase::canary(const std::shared_ptr &plugin, + const WasmHandleCloneFactory &clone_factory) { + if (this->wasm() == nullptr) { + return false; + } + auto it = plugin_canary_cache_.find(plugin->key()); + if (it != plugin_canary_cache_.end()) { return it->second; } - return nullptr; + auto configuration_canary_handle = clone_factory(shared_from_this()); + if (!configuration_canary_handle) { + this->wasm()->fail(FailState::UnableToCloneVm, "Failed to clone Base Wasm"); + return false; + } + if (!configuration_canary_handle->wasm()->initialize()) { + configuration_canary_handle->wasm()->fail(FailState::UnableToInitializeCode, + "Failed to initialize Wasm code"); + return false; + } + auto *root_context = configuration_canary_handle->wasm()->start(plugin); + if (root_context == nullptr) { + configuration_canary_handle->wasm()->fail(FailState::StartFailed, "Failed to start base Wasm"); + return false; + } + if (!configuration_canary_handle->wasm()->configure(root_context, plugin)) { + configuration_canary_handle->wasm()->fail(FailState::ConfigureFailed, + "Failed to configure base Wasm plugin"); + plugin_canary_cache_[plugin->key()] = false; + return false; + } + configuration_canary_handle->kill(); + plugin_canary_cache_[plugin->key()] = true; + return true; } -std::shared_ptr createWasm(std::string vm_key, std::string code, - std::shared_ptr plugin, - WasmHandleFactory factory, - WasmHandleCloneFactory clone_factory, +std::shared_ptr createWasm(const std::string &vm_key, const std::string &code, + const std::shared_ptr &plugin, + const WasmHandleFactory &factory, + const WasmHandleCloneFactory &clone_factory, bool allow_precompiled) { std::shared_ptr wasm_handle; { std::lock_guard guard(base_wasms_mutex); - if (!base_wasms) { + if (base_wasms == nullptr) { base_wasms = new std::remove_reference::type; } auto it = base_wasms->find(vm_key); @@ -482,62 +546,48 @@ std::shared_ptr createWasm(std::string vm_key, std::string code, base_wasms->erase(it); } } - if (wasm_handle) { - return wasm_handle; - } - wasm_handle = factory(vm_key); if (!wasm_handle) { - return nullptr; + // If no cached base_wasm, creates a new base_wasm, loads the code and initializes it. + wasm_handle = factory(vm_key); + if (!wasm_handle) { + return nullptr; + } + if (!wasm_handle->wasm()->load(code, allow_precompiled)) { + wasm_handle->wasm()->fail(FailState::UnableToInitializeCode, "Failed to load Wasm code"); + return nullptr; + } + if (!wasm_handle->wasm()->initialize()) { + wasm_handle->wasm()->fail(FailState::UnableToInitializeCode, + "Failed to initialize Wasm code"); + return nullptr; + } + (*base_wasms)[vm_key] = wasm_handle; } - (*base_wasms)[vm_key] = wasm_handle; } - if (!wasm_handle->wasm()->load(code, allow_precompiled)) { - wasm_handle->wasm()->fail(FailState::UnableToInitializeCode, "Failed to load Wasm code"); + // Either creating new one or reusing the existing one, apply canary for each plugin. + if (!wasm_handle->canary(plugin, clone_factory)) { return nullptr; } - if (!wasm_handle->wasm()->initialize()) { - wasm_handle->wasm()->fail(FailState::UnableToInitializeCode, "Failed to initialize Wasm code"); - return nullptr; - } - auto configuration_canary_handle = clone_factory(wasm_handle); - if (!configuration_canary_handle) { - wasm_handle->wasm()->fail(FailState::UnableToCloneVm, "Failed to clone Base Wasm"); - return nullptr; - } - if (!configuration_canary_handle->wasm()->initialize()) { - wasm_handle->wasm()->fail(FailState::UnableToInitializeCode, "Failed to initialize Wasm code"); - return nullptr; - } - auto root_context = configuration_canary_handle->wasm()->start(plugin); - if (!root_context) { - configuration_canary_handle->wasm()->fail(FailState::StartFailed, "Failed to start base Wasm"); - return nullptr; - } - if (!configuration_canary_handle->wasm()->configure(root_context, plugin)) { - configuration_canary_handle->wasm()->fail(FailState::ConfigureFailed, - "Failed to configure base Wasm plugin"); - return nullptr; - } - configuration_canary_handle->kill(); return wasm_handle; }; std::shared_ptr getThreadLocalWasm(std::string_view vm_key) { auto it = local_wasms.find(std::string(vm_key)); - if (it == local_wasms.end()) { - return nullptr; - } - auto wasm = it->second.lock(); - if (!wasm) { - local_wasms.erase(std::string(vm_key)); + if (it != local_wasms.end()) { + auto wasm = it->second.lock(); + if (wasm) { + return wasm; + } + local_wasms.erase(it); } - return wasm; + removeStaleLocalCacheEntries(local_wasms, local_wasms_keys); + return nullptr; } static std::shared_ptr -getOrCreateThreadLocalWasm(std::shared_ptr base_handle, - WasmHandleCloneFactory clone_factory) { +getOrCreateThreadLocalWasm(const std::shared_ptr &base_handle, + const WasmHandleCloneFactory &clone_factory) { std::string vm_key(base_handle->wasm()->vm_key()); // Get existing thread-local WasmVM. auto it = local_wasms.find(vm_key); @@ -546,9 +596,9 @@ getOrCreateThreadLocalWasm(std::shared_ptr base_handle, if (wasm_handle) { return wasm_handle; } - // Remove stale entry. - local_wasms.erase(vm_key); + local_wasms.erase(it); } + removeStaleLocalCacheEntries(local_wasms, local_wasms_keys); // Create and initialize new thread-local WasmVM. auto wasm_handle = clone_factory(base_handle); if (!wasm_handle) { @@ -560,13 +610,21 @@ getOrCreateThreadLocalWasm(std::shared_ptr base_handle, base_handle->wasm()->fail(FailState::UnableToInitializeCode, "Failed to initialize Wasm code"); return nullptr; } - local_wasms[vm_key] = wasm_handle; + cacheLocalWasm(vm_key, wasm_handle); + wasm_handle->wasm()->wasm_vm()->addFailCallback([vm_key](proxy_wasm::FailState fail_state) { + if (fail_state == proxy_wasm::FailState::RuntimeError) { + // If VM failed, erase the entry so that: + // 1) we can recreate the new thread local VM from the same base_wasm. + // 2) we wouldn't reuse the failed VM for new plugins accidentally. + local_wasms.erase(vm_key); + }; + }); return wasm_handle; } std::shared_ptr getOrCreateThreadLocalPlugin( - std::shared_ptr base_handle, std::shared_ptr plugin, - WasmHandleCloneFactory clone_factory, PluginHandleFactory plugin_factory) { + const std::shared_ptr &base_handle, const std::shared_ptr &plugin, + const WasmHandleCloneFactory &clone_factory, const PluginHandleFactory &plugin_factory) { std::string key(std::string(base_handle->wasm()->vm_key()) + "||" + plugin->key()); // Get existing thread-local Plugin handle. auto it = local_plugins.find(key); @@ -575,17 +633,17 @@ std::shared_ptr getOrCreateThreadLocalPlugin( if (plugin_handle) { return plugin_handle; } - // Remove stale entry. - local_plugins.erase(key); + local_plugins.erase(it); } + removeStaleLocalCacheEntries(local_plugins, local_plugins_keys); // Get thread-local WasmVM. auto wasm_handle = getOrCreateThreadLocalWasm(base_handle, clone_factory); if (!wasm_handle) { return nullptr; } // Create and initialize new thread-local Plugin. - auto plugin_context = wasm_handle->wasm()->start(plugin); - if (!plugin_context) { + auto *plugin_context = wasm_handle->wasm()->start(plugin); + if (plugin_context == nullptr) { base_handle->wasm()->fail(FailState::StartFailed, "Failed to start thread-local Wasm"); return nullptr; } @@ -595,7 +653,15 @@ std::shared_ptr getOrCreateThreadLocalPlugin( return nullptr; } auto plugin_handle = plugin_factory(wasm_handle, plugin); - local_plugins[key] = plugin_handle; + cacheLocalPlugin(key, plugin_handle); + wasm_handle->wasm()->wasm_vm()->addFailCallback([key](proxy_wasm::FailState fail_state) { + if (fail_state == proxy_wasm::FailState::RuntimeError) { + // If VM failed, erase the entry so that: + // 1) we can recreate the new thread local plugin from the same base_wasm. + // 2) we wouldn't reuse the failed VM for new plugin configs accidentally. + local_plugins.erase(key); + }; + }); return plugin_handle; } @@ -603,10 +669,30 @@ void clearWasmCachesForTesting() { local_plugins.clear(); local_wasms.clear(); std::lock_guard guard(base_wasms_mutex); - if (base_wasms) { + if (base_wasms != nullptr) { delete base_wasms; base_wasms = nullptr; } } +std::vector staleLocalPluginsKeysForTesting() { + std::vector keys; + for (const auto &kv : local_plugins) { + if (kv.second.expired()) { + keys.push_back(kv.first); + } + } + return keys; +} + +std::vector staleLocalWasmsKeysForTesting() { + std::vector keys; + for (const auto &kv : local_wasms) { + if (kv.second.expired()) { + keys.push_back(kv.first); + } + } + return keys; +} + } // namespace proxy_wasm diff --git a/src/wasm.h b/src/wasm.h new file mode 100644 index 000000000..882dbcd99 --- /dev/null +++ b/src/wasm.h @@ -0,0 +1,25 @@ +// Copyright 2023 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. + +#pragma once + +#include +#include + +namespace proxy_wasm { + +std::vector staleLocalWasmsKeysForTesting(); +std::vector staleLocalPluginsKeysForTesting(); + +} // namespace proxy_wasm diff --git a/src/wasmedge/types.h b/src/wasmedge/types.h new file mode 100644 index 000000000..b6cd21952 --- /dev/null +++ b/src/wasmedge/types.h @@ -0,0 +1,29 @@ +// 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. + +#include "src/common/types.h" +#include "wasmedge/wasmedge.h" + +namespace proxy_wasm::WasmEdge { + +using WasmEdgeStorePtr = common::CSmartPtr; +using WasmEdgeVMPtr = common::CSmartPtr; +using WasmEdgeLoaderPtr = common::CSmartPtr; +using WasmEdgeValidatorPtr = common::CSmartPtr; +using WasmEdgeExecutorPtr = common::CSmartPtr; +using WasmEdgeASTModulePtr = common::CSmartPtr; +using WasmEdgeModulePtr = + common::CSmartPtr; + +} // namespace proxy_wasm::WasmEdge diff --git a/src/wasmedge/wasmedge.cc b/src/wasmedge/wasmedge.cc new file mode 100644 index 000000000..30fe78f5e --- /dev/null +++ b/src/wasmedge/wasmedge.cc @@ -0,0 +1,630 @@ +// Copyright 2016-2019 Envoy Project Authors +// 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. + +#include "include/proxy-wasm/wasmedge.h" +#include "include/proxy-wasm/wasm_vm.h" +#include "src/wasmedge/types.h" + +#include "wasmedge/wasmedge.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace proxy_wasm { +namespace WasmEdge { + +// Helper templates to make values. +template WasmEdge_Value makeVal(T t); +template <> WasmEdge_Value makeVal(Word t) { + return WasmEdge_ValueGenI32(static_cast(t.u64_)); +} +template <> WasmEdge_Value makeVal(uint32_t t) { + return WasmEdge_ValueGenI32(static_cast(t)); +} +template <> WasmEdge_Value makeVal(uint64_t t) { + return WasmEdge_ValueGenI64(static_cast(t)); +} +template <> WasmEdge_Value makeVal(double t) { return WasmEdge_ValueGenF64(t); } + +// Helper function to print values. +std::string printValue(const WasmEdge_Value &value) { + switch (value.Type) { + case WasmEdge_ValType_I32: + return std::to_string(WasmEdge_ValueGetI32(value)); + case WasmEdge_ValType_I64: + return std::to_string(WasmEdge_ValueGetI64(value)); + case WasmEdge_ValType_F32: + return std::to_string(WasmEdge_ValueGetF32(value)); + case WasmEdge_ValType_F64: + return std::to_string(WasmEdge_ValueGetF64(value)); + default: + return "unknown"; + } +} + +std::string printValues(const WasmEdge_Value *values, size_t size) { + if (size == 0) { + return ""; + } + + std::string s; + for (size_t i = 0; i < size; i++) { + if (i != 0U) { + s.append(", "); + } + s.append(printValue(values[i])); + } + return s; +} + +// Helper function to print valtype. +const char *printValType(WasmEdge_ValType kind) { + switch (kind) { + case WasmEdge_ValType_I32: + return "i32"; + case WasmEdge_ValType_I64: + return "i64"; + case WasmEdge_ValType_F32: + return "f32"; + case WasmEdge_ValType_F64: + return "f64"; + case WasmEdge_ValType_ExternRef: + return "anyref"; + case WasmEdge_ValType_FuncRef: + return "funcref"; + default: + return "unknown"; + } +} + +// Helper function to print valtype array. +std::string printValTypes(const WasmEdge_ValType *types, size_t size) { + if (size == 0) { + return "void"; + } + + std::string s; + s.reserve(size * 8 /* max size + " " */ - 1); + for (size_t i = 0; i < size; i++) { + if (i != 0U) { + s.append(" "); + } + s.append(printValType(types[i])); + } + return s; +} + +template struct ConvertWordType { + using type = T; // NOLINT(readability-identifier-naming) +}; +template <> struct ConvertWordType { + using type = uint32_t; // NOLINT(readability-identifier-naming) +}; + +// Helper templates to convert arg to valtype. +template enum WasmEdge_ValType convArgToValType(); +template <> enum WasmEdge_ValType convArgToValType() { return WasmEdge_ValType_I32; } +template <> enum WasmEdge_ValType convArgToValType() { return WasmEdge_ValType_I32; } +template <> enum WasmEdge_ValType convArgToValType() { return WasmEdge_ValType_I64; } +template <> enum WasmEdge_ValType convArgToValType() { return WasmEdge_ValType_I64; } +template <> enum WasmEdge_ValType convArgToValType() { return WasmEdge_ValType_F64; } + +// Helper templates to convert valtype to arg. +template T convValTypeToArg(WasmEdge_Value val); +template <> uint32_t convValTypeToArg(WasmEdge_Value val) { + return static_cast(WasmEdge_ValueGetI32(val)); +} +template <> Word convValTypeToArg(WasmEdge_Value val) { return WasmEdge_ValueGetI32(val); } +template <> int64_t convValTypeToArg(WasmEdge_Value val) { + return WasmEdge_ValueGetI64(val); +} +template <> uint64_t convValTypeToArg(WasmEdge_Value val) { + return static_cast(WasmEdge_ValueGetI64(val)); +} +template <> double convValTypeToArg(WasmEdge_Value val) { + return WasmEdge_ValueGetF64(val); +} + +// Helper templates to convert valtypes to args tuple. +template +constexpr T convValTypesToArgsTupleImpl(const WasmEdge_Value *arr, + std::index_sequence /*comptime*/) { + return std::make_tuple( + convValTypeToArg>::type>(arr[I])...); +} + +template ::value>> +constexpr T convValTypesToArgsTuple(const WasmEdge_Value *arr) { + return convValTypesToArgsTupleImpl(arr, Is()); +} + +// Helper templates to convert args tuple to valtypes. +template +uint32_t convArgsTupleToValTypesImpl(std::vector &types, + std::index_sequence /*comptime*/) { + auto size = std::tuple_size::value; + if (size > 0) { + auto ps = std::array::value>{ + convArgToValType::type>()...}; + types.resize(size); + std::copy_n(ps.data(), size, types.data()); + } + return size; +} + +template ::value>> +uint32_t convArgsTupleToValTypes(std::vector &types) { + return convArgsTupleToValTypesImpl(types, Is()); +} + +// Helper templates to create WasmEdge_FunctionTypeContext. +template WasmEdge_FunctionTypeContext *newWasmEdgeFuncType() { + std::vector params; + std::vector returns; + uint32_t param_nums = convArgsTupleToValTypes(params); + uint32_t return_nums = convArgsTupleToValTypes>(returns); + auto *ftype = WasmEdge_FunctionTypeCreate(params.data(), param_nums, returns.data(), return_nums); + return ftype; +} + +template WasmEdge_FunctionTypeContext *newWasmEdgeFuncType() { + std::vector params; + uint32_t param_nums = convArgsTupleToValTypes(params); + auto *ftype = WasmEdge_FunctionTypeCreate(params.data(), param_nums, nullptr, 0); + return ftype; +} + +struct HostFuncData { + HostFuncData(const std::string_view modname, const std::string_view name) + : modname_(modname), name_(name), callback_(nullptr), raw_func_(nullptr), vm_(nullptr) {} + ~HostFuncData() = default; + + std::string modname_, name_; + WasmEdge_HostFunc_t callback_; + void *raw_func_; + WasmVm *vm_; +}; + +using HostFuncDataPtr = std::unique_ptr; + +struct HostModuleData { + HostModuleData(const std::string_view modname) { + cxt_ = WasmEdge_ModuleInstanceCreate(WasmEdge_StringWrap(modname.data(), modname.length())); + } + ~HostModuleData() { WasmEdge_ModuleInstanceDelete(cxt_); } + + WasmEdge_ModuleInstanceContext *cxt_; +}; + +using HostModuleDataPtr = std::unique_ptr; + +class WasmEdge : public WasmVm { +public: + WasmEdge() { + store_ = nullptr; + ast_module_ = nullptr; + module_ = nullptr; + memory_ = nullptr; + } + + std::string_view getEngineName() override { return "wasmedge"; } + std::string_view getPrecompiledSectionName() override { return ""; } + + Cloneable cloneable() override { return Cloneable::NotCloneable; } + std::unique_ptr clone() override { return nullptr; } + + bool load(std::string_view bytecode, std::string_view precompiled, + const std::unordered_map &function_names) override; + bool link(std::string_view debug_name) override; + uint64_t getMemorySize() override; + std::optional getMemory(uint64_t pointer, uint64_t size) override; + bool setMemory(uint64_t pointer, uint64_t size, const void *data) override; + bool getWord(uint64_t pointer, Word *word) override; + bool setWord(uint64_t pointer, Word word) override; + size_t getWordSize() override { return sizeof(uint32_t); }; + +#define _REGISTER_HOST_FUNCTION(T) \ + void registerCallback(std::string_view module_name, std::string_view function_name, T, \ + typename ConvertFunctionTypeWordToUint32::type f) override { \ + registerHostFunctionImpl(module_name, function_name, f); \ + }; + FOR_ALL_WASM_VM_IMPORTS(_REGISTER_HOST_FUNCTION) +#undef _REGISTER_HOST_FUNCTION + +#define _GET_MODULE_FUNCTION(T) \ + void getFunction(std::string_view function_name, T *f) override { \ + getModuleFunctionImpl(function_name, f); \ + }; + FOR_ALL_WASM_VM_EXPORTS(_GET_MODULE_FUNCTION) +#undef _GET_MODULE_FUNCTION + + void warm() override; + +private: + template + void registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, + void (*function)(Args...)); + + template + void registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, + R (*function)(Args...)); + + template + void getModuleFunctionImpl(std::string_view function_name, + std::function *function); + + template + void getModuleFunctionImpl(std::string_view function_name, + std::function *function); + + void terminate() override {} + bool usesWasmByteOrder() override { return true; } + + // Initialize the WasmEdge store if necessary. + void initStore(); + + WasmEdgeLoaderPtr loader_; + WasmEdgeValidatorPtr validator_; + WasmEdgeExecutorPtr executor_; + WasmEdgeStorePtr store_; + WasmEdgeASTModulePtr ast_module_; + WasmEdgeModulePtr module_; + WasmEdge_MemoryInstanceContext *memory_; + + std::unordered_map host_functions_; + std::unordered_map host_modules_; + std::unordered_set module_functions_; +}; + +bool WasmEdge::load(std::string_view bytecode, std::string_view /*precompiled*/, + const std::unordered_map & /*function_names*/) { + initStore(); + WasmEdge_ASTModuleContext *mod = nullptr; + WasmEdge_Result res = WasmEdge_LoaderParseFromBuffer( + loader_.get(), &mod, reinterpret_cast(bytecode.data()), bytecode.size()); + if (!WasmEdge_ResultOK(res)) { + return false; + } + res = WasmEdge_ValidatorValidate(validator_.get(), mod); + if (!WasmEdge_ResultOK(res)) { + WasmEdge_ASTModuleDelete(mod); + return false; + } + ast_module_ = mod; + return true; +} + +void WasmEdge::initStore() { + if (store_ != nullptr) { + return; + } + loader_ = WasmEdge_LoaderCreate(nullptr); + validator_ = WasmEdge_ValidatorCreate(nullptr); + executor_ = WasmEdge_ExecutorCreate(nullptr, nullptr); + store_ = WasmEdge_StoreCreate(); +} + +bool WasmEdge::link(std::string_view /*debug_name*/) { + assert(ast_module_ != nullptr); + + // Create store and register imports. + initStore(); + if (store_ == nullptr) { + return false; + } + WasmEdge_Result res; + for (auto &&it : host_modules_) { + res = WasmEdge_ExecutorRegisterImport(executor_.get(), store_.get(), it.second->cxt_); + if (!WasmEdge_ResultOK(res)) { + fail(FailState::UnableToInitializeCode, + std::string("Failed to link Wasm module due to import: ") + it.first); + return false; + } + } + // Instantiate module. + WasmEdge_ModuleInstanceContext *mod = nullptr; + res = WasmEdge_ExecutorInstantiate(executor_.get(), &mod, store_.get(), ast_module_.get()); + if (!WasmEdge_ResultOK(res)) { + fail(FailState::UnableToInitializeCode, + std::string("Failed to link Wasm module: ") + std::string(WasmEdge_ResultGetMessage(res))); + return false; + } + // Get the function and memory exports. + uint32_t memory_num = WasmEdge_ModuleInstanceListMemoryLength(mod); + if (memory_num > 0) { + WasmEdge_String name; + WasmEdge_ModuleInstanceListMemory(mod, &name, 1); + memory_ = WasmEdge_ModuleInstanceFindMemory(mod, name); + if (memory_ == nullptr) { + WasmEdge_ModuleInstanceDelete(mod); + return false; + } + } + uint32_t func_num = WasmEdge_ModuleInstanceListFunctionLength(mod); + if (func_num > 0) { + std::vector names(func_num); + WasmEdge_ModuleInstanceListFunction(mod, &names[0], func_num); + for (auto i = 0; i < func_num; i++) { + module_functions_.insert(std::string(names[i].Buf, names[i].Length)); + } + } + module_ = mod; + return true; +} + +uint64_t WasmEdge::getMemorySize() { + if (memory_ != nullptr) { + return 65536ULL * WasmEdge_MemoryInstanceGetPageSize(memory_); + } + return 0; +} + +std::optional WasmEdge::getMemory(uint64_t pointer, uint64_t size) { + char *ptr = reinterpret_cast(WasmEdge_MemoryInstanceGetPointer(memory_, pointer, size)); + if (ptr == nullptr) { + return std::nullopt; + } + return std::string_view(ptr, size); +} + +bool WasmEdge::setMemory(uint64_t pointer, uint64_t size, const void *data) { + auto res = WasmEdge_MemoryInstanceSetData(memory_, reinterpret_cast(data), + pointer, size); + return WasmEdge_ResultOK(res); +} + +bool WasmEdge::getWord(uint64_t pointer, Word *word) { + constexpr auto size = sizeof(uint32_t); + uint32_t word32; + auto res = + WasmEdge_MemoryInstanceGetData(memory_, reinterpret_cast(&word32), pointer, size); + if (WasmEdge_ResultOK(res)) { + word->u64_ = word32; + return true; + } + return false; +} + +bool WasmEdge::setWord(uint64_t pointer, Word word) { + constexpr auto size = sizeof(uint32_t); + uint32_t word32 = word.u32(); + auto res = + WasmEdge_MemoryInstanceSetData(memory_, reinterpret_cast(&word32), pointer, size); + return WasmEdge_ResultOK(res); +} + +template +void WasmEdge::registerHostFunctionImpl(std::string_view module_name, + std::string_view function_name, void (*function)(Args...)) { + auto it = host_modules_.find(std::string(module_name)); + if (it == host_modules_.end()) { + host_modules_.emplace(module_name, std::make_unique(module_name)); + it = host_modules_.find(std::string(module_name)); + } + + auto data = std::make_unique(module_name, function_name); + auto *func_type = newWasmEdgeFuncType>(); + data->vm_ = this; + data->raw_func_ = reinterpret_cast(function); + data->callback_ = [](void *data, const WasmEdge_CallingFrameContext * /*CallFrameCxt*/, + const WasmEdge_Value *Params, + WasmEdge_Value * /*Returns*/) -> WasmEdge_Result { + auto *func_data = reinterpret_cast(data); + const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); + if (log) { + func_data->vm_->integration()->trace("[vm->host] " + func_data->modname_ + "." + + func_data->name_ + "(" + + printValues(Params, sizeof...(Args)) + ")"); + } + auto args = convValTypesToArgsTuple>(Params); + auto fn = reinterpret_cast(func_data->raw_func_); + std::apply(fn, args); + if (log) { + func_data->vm_->integration()->trace("[vm<-host] " + func_data->modname_ + "." + + func_data->name_ + " return: void"); + } + return WasmEdge_Result_Success; + }; + + auto *hostfunc_cxt = WasmEdge_FunctionInstanceCreate(func_type, data->callback_, data.get(), 0); + WasmEdge_FunctionTypeDelete(func_type); + if (hostfunc_cxt == nullptr) { + fail(FailState::MissingFunction, "Failed to allocate host function instance"); + return; + } + + WasmEdge_ModuleInstanceAddFunction( + it->second->cxt_, WasmEdge_StringWrap(function_name.data(), function_name.length()), + hostfunc_cxt); + host_functions_.insert_or_assign(std::string(module_name) + "." + std::string(function_name), + std::move(data)); +} + +template +void WasmEdge::registerHostFunctionImpl(std::string_view module_name, + std::string_view function_name, R (*function)(Args...)) { + auto it = host_modules_.find(std::string(module_name)); + if (it == host_modules_.end()) { + host_modules_.emplace(module_name, std::make_unique(module_name)); + it = host_modules_.find(std::string(module_name)); + } + + auto data = std::make_unique(module_name, function_name); + auto *func_type = newWasmEdgeFuncType>(); + data->vm_ = this; + data->raw_func_ = reinterpret_cast(function); + data->callback_ = [](void *data, const WasmEdge_CallingFrameContext * /*CallFrameCxt*/, + const WasmEdge_Value *Params, WasmEdge_Value *Returns) -> WasmEdge_Result { + auto *func_data = reinterpret_cast(data); + const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); + if (log) { + func_data->vm_->integration()->trace("[vm->host] " + func_data->modname_ + "." + + func_data->name_ + "(" + + printValues(Params, sizeof...(Args)) + ")"); + } + auto args = convValTypesToArgsTuple>(Params); + auto fn = reinterpret_cast(func_data->raw_func_); + R res = std::apply(fn, args); + Returns[0] = makeVal(res); + if (log) { + func_data->vm_->integration()->trace("[vm<-host] " + func_data->modname_ + "." + + func_data->name_ + " return: " + std::to_string(res)); + } + return WasmEdge_Result_Success; + }; + + auto *hostfunc_cxt = WasmEdge_FunctionInstanceCreate(func_type, data->callback_, data.get(), 0); + WasmEdge_FunctionTypeDelete(func_type); + if (hostfunc_cxt == nullptr) { + fail(FailState::MissingFunction, "Failed to allocate host function instance"); + return; + } + + WasmEdge_ModuleInstanceAddFunction( + it->second->cxt_, WasmEdge_StringWrap(function_name.data(), function_name.length()), + hostfunc_cxt); + host_functions_.insert_or_assign(std::string(module_name) + "." + std::string(function_name), + std::move(data)); +} + +template +void WasmEdge::getModuleFunctionImpl(std::string_view function_name, + std::function *function) { + auto *func_cxt = WasmEdge_ModuleInstanceFindFunction( + module_.get(), WasmEdge_StringWrap(function_name.data(), function_name.length())); + if (!func_cxt) { + *function = nullptr; + return; + } + + std::vector exp_args; + std::vector exp_returns; + convArgsTupleToValTypes>(exp_args); + convArgsTupleToValTypes>(exp_returns); + const auto *functype_cxt = WasmEdge_FunctionInstanceGetFunctionType(func_cxt); + std::vector act_args( + WasmEdge_FunctionTypeGetParametersLength(functype_cxt)); + std::vector act_returns( + WasmEdge_FunctionTypeGetReturnsLength(functype_cxt)); + WasmEdge_FunctionTypeGetParameters(functype_cxt, act_args.data(), act_args.size()); + WasmEdge_FunctionTypeGetReturns(functype_cxt, act_returns.data(), act_returns.size()); + + if (exp_args != act_args || exp_returns != act_returns) { + fail(FailState::UnableToInitializeCode, + "Bad function signature for: " + std::string(function_name) + + ", want: " + printValTypes(exp_args.data(), exp_args.size()) + " -> " + + printValTypes(exp_returns.data(), exp_returns.size()) + + ", but the module exports: " + printValTypes(act_args.data(), act_args.size()) + + " -> " + printValTypes(act_returns.data(), act_returns.size())); + return; + } + + *function = [function_name, func_cxt, this](ContextBase *context, Args... args) -> void { + WasmEdge_Value params[] = {makeVal(args)...}; + const bool log = cmpLogLevel(LogLevel::trace); + if (log) { + integration()->trace("[host->vm] " + std::string(function_name) + "(" + + printValues(params, sizeof...(Args)) + ")"); + } + SaveRestoreContext saved_context(context); + WasmEdge_Result res = + WasmEdge_ExecutorInvoke(executor_.get(), func_cxt, params, sizeof...(Args), nullptr, 0); + if (!WasmEdge_ResultOK(res)) { + fail(FailState::RuntimeError, "Function: " + std::string(function_name) + + " failed: " + WasmEdge_ResultGetMessage(res)); + return; + } + if (log) { + integration()->trace("[host<-vm] " + std::string(function_name) + " return: void"); + } + }; +} + +template +void WasmEdge::getModuleFunctionImpl(std::string_view function_name, + std::function *function) { + auto *func_cxt = WasmEdge_ModuleInstanceFindFunction( + module_.get(), WasmEdge_StringWrap(function_name.data(), function_name.length())); + if (!func_cxt) { + *function = nullptr; + return; + } + + std::vector exp_args; + std::vector exp_returns; + convArgsTupleToValTypes>(exp_args); + convArgsTupleToValTypes>(exp_returns); + const auto *functype_cxt = WasmEdge_FunctionInstanceGetFunctionType(func_cxt); + std::vector act_args( + WasmEdge_FunctionTypeGetParametersLength(functype_cxt)); + std::vector act_returns( + WasmEdge_FunctionTypeGetReturnsLength(functype_cxt)); + WasmEdge_FunctionTypeGetParameters(functype_cxt, act_args.data(), act_args.size()); + WasmEdge_FunctionTypeGetReturns(functype_cxt, act_returns.data(), act_returns.size()); + + if (exp_args != act_args || exp_returns != act_returns) { + fail(FailState::UnableToInitializeCode, + "Bad function signature for: " + std::string(function_name) + + ", want: " + printValTypes(exp_args.data(), exp_args.size()) + " -> " + + printValTypes(exp_returns.data(), exp_returns.size()) + + ", but the module exports: " + printValTypes(act_args.data(), act_args.size()) + + " -> " + printValTypes(act_returns.data(), act_returns.size())); + return; + } + + *function = [function_name, func_cxt, this](ContextBase *context, Args... args) -> R { + WasmEdge_Value params[] = {makeVal(args)...}; + WasmEdge_Value results[1]; + const bool log = cmpLogLevel(LogLevel::trace); + if (log) { + integration()->trace("[host->vm] " + std::string(function_name) + "(" + + printValues(params, sizeof...(Args)) + ")"); + } + SaveRestoreContext saved_context(context); + WasmEdge_Result res = + WasmEdge_ExecutorInvoke(executor_.get(), func_cxt, params, sizeof...(Args), results, 1); + if (!WasmEdge_ResultOK(res)) { + fail(FailState::RuntimeError, "Function: " + std::string(function_name) + + " failed: " + WasmEdge_ResultGetMessage(res)); + return R{}; + } + R ret = convValTypeToArg(results[0]); + if (log) { + integration()->trace("[host<-vm] " + std::string(function_name) + + " return: " + std::to_string(ret)); + } + return ret; + }; +} + +void WasmEdge::warm() { initStore(); } + +} // namespace WasmEdge + +std::unique_ptr createWasmEdgeVm() { return std::make_unique(); } + +} // namespace proxy_wasm diff --git a/src/wasmtime/types.h b/src/wasmtime/types.h index afae66e58..14fe75053 100644 --- a/src/wasmtime/types.h +++ b/src/wasmtime/types.h @@ -13,10 +13,9 @@ // limitations under the License. #include "src/common/types.h" -#include "wasmtime/include/wasm.h" +#include "crates/c-api/include/wasm.h" -namespace proxy_wasm { -namespace wasmtime { +namespace proxy_wasm::wasmtime { using WasmEnginePtr = common::CSmartPtr; using WasmFuncPtr = common::CSmartPtr; @@ -41,6 +40,4 @@ using WasmExternVec = using WasmValtypeVec = common::CSmartType; -} // namespace wasmtime - -} // namespace proxy_wasm +} // namespace proxy_wasm::wasmtime diff --git a/src/wasmtime/wasmtime.cc b/src/wasmtime/wasmtime.cc index 98b339658..a72a0361d 100644 --- a/src/wasmtime/wasmtime.cc +++ b/src/wasmtime/wasmtime.cc @@ -24,10 +24,9 @@ #include #include -#include "include/proxy-wasm/wasm_vm.h" #include "src/wasmtime/types.h" -#include "wasmtime/include/wasm.h" +#include "crates/c-api/include/wasm.h" namespace proxy_wasm { namespace wasmtime { @@ -37,8 +36,8 @@ struct HostFuncData { std::string name_; WasmFuncPtr callback_; - void *raw_func_; - WasmVm *vm_; + void *raw_func_{}; + WasmVm *vm_{}; }; using HostFuncDataPtr = std::unique_ptr; @@ -50,14 +49,14 @@ wasm_engine_t *engine() { class Wasmtime : public WasmVm { public: - Wasmtime() {} + Wasmtime() = default; - std::string_view runtime() override { return "wasmtime"; } + std::string_view getEngineName() override { return "wasmtime"; } Cloneable cloneable() override { return Cloneable::CompiledBytecode; } std::string_view getPrecompiledSectionName() override { return ""; } bool load(std::string_view bytecode, std::string_view precompiled, - const std::unordered_map function_names) override; + const std::unordered_map &function_names) override; bool link(std::string_view debug_name) override; std::unique_ptr clone() override; uint64_t getMemorySize() override; @@ -81,14 +80,17 @@ class Wasmtime : public WasmVm { }; FOR_ALL_WASM_VM_EXPORTS(_GET_MODULE_FUNCTION) #undef _GET_MODULE_FUNCTION + + void warm() override; + private: template void registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - void (*function)(void *, Args...)); + void (*function)(Args...)); template void registerHostFunctionImpl(std::string_view module_name, std::string_view function_name, - R (*function)(void *, Args...)); + R (*function)(Args...)); template void getModuleFunctionImpl(std::string_view function_name, @@ -98,6 +100,12 @@ class Wasmtime : public WasmVm { void getModuleFunctionImpl(std::string_view function_name, std::function *function); + void terminate() override {} + bool usesWasmByteOrder() override { return true; } + + // Initialize the Wasmtime store if necessary. + void initStore(); + WasmStorePtr store_; WasmModulePtr module_; WasmSharedModulePtr shared_module_; @@ -109,31 +117,59 @@ class Wasmtime : public WasmVm { std::unordered_map module_functions_; }; -bool Wasmtime::load(std::string_view bytecode, std::string_view, - const std::unordered_map) { +void Wasmtime::initStore() { + if (store_ != nullptr) { + return; + } store_ = wasm_store_new(engine()); +} + +bool Wasmtime::load(std::string_view bytecode, std::string_view /*precompiled*/, + const std::unordered_map & /*function_names*/) { + initStore(); + if (store_ == nullptr) { + return false; + } WasmByteVec vec; wasm_byte_vec_new(vec.get(), bytecode.size(), bytecode.data()); module_ = wasm_module_new(store_.get(), vec.get()); - if (!module_) { + if (module_ == nullptr) { return false; } shared_module_ = wasm_module_share(module_.get()); - assert(shared_module_ != nullptr); + if (shared_module_ == nullptr) { + return false; + } return true; } std::unique_ptr Wasmtime::clone() { assert(shared_module_ != nullptr); + auto clone = std::make_unique(); + if (clone == nullptr) { + return nullptr; + } - clone->integration().reset(integration()->clone()); clone->store_ = wasm_store_new(engine()); + if (clone->store_ == nullptr) { + return nullptr; + } + clone->module_ = wasm_module_obtain(clone->store_.get(), shared_module_.get()); + if (clone->module_ == nullptr) { + return nullptr; + } + + auto *integration_clone = integration()->clone(); + if (integration_clone == nullptr) { + return nullptr; + } + clone->integration().reset(integration_clone); return clone; } @@ -174,7 +210,7 @@ static std::string printValues(const wasm_val_vec_t *values) { std::string s; for (size_t i = 0; i < values->size; i++) { - if (i) { + if (i != 0U) { s.append(", "); } s.append(printValue(values->data[i])); @@ -192,8 +228,8 @@ static const char *printValKind(wasm_valkind_t kind) { return "f32"; case WASM_F64: return "f64"; - case WASM_ANYREF: - return "anyref"; + case WASM_EXTERNREF: + return "externref"; case WASM_FUNCREF: return "funcref"; default: @@ -209,7 +245,7 @@ static std::string printValTypes(const wasm_valtype_vec_t *types) { std::string s; s.reserve(types->size * 8 /* max size + " " */ - 1); for (size_t i = 0; i < types->size; i++) { - if (i) { + if (i != 0U) { s.append(" "); } s.append(printValKind(wasm_valtype_kind(types->data[i]))); @@ -217,7 +253,7 @@ static std::string printValTypes(const wasm_valtype_vec_t *types) { return s; } -bool Wasmtime::link(std::string_view debug_name) { +bool Wasmtime::link(std::string_view /*debug_name*/) { assert(module_ != nullptr); WasmImporttypeVec import_types; @@ -239,10 +275,10 @@ bool Wasmtime::link(std::string_view debug_name) { fail(FailState::UnableToInitializeCode, std::string("Failed to load Wasm module due to a missing import: ") + std::string(module_name) + "." + std::string(name)); - break; + return false; } - auto func = it->second->callback_.get(); + auto *func = it->second->callback_.get(); const wasm_functype_t *exp_type = wasm_externtype_as_functype_const(extern_type); WasmFunctypePtr actual_type = wasm_func_type(it->second->callback_.get()); if (!equalValTypes(wasm_functype_params(exp_type), wasm_functype_params(actual_type.get())) || @@ -256,7 +292,7 @@ bool Wasmtime::link(std::string_view debug_name) { printValTypes(wasm_functype_results(exp_type)) + ", but host exports: " + printValTypes(wasm_functype_params(actual_type.get())) + " -> " + printValTypes(wasm_functype_results(actual_type.get()))); - break; + return false; } imports.push_back(wasm_func_as_extern(func)); } break; @@ -265,19 +301,32 @@ bool Wasmtime::link(std::string_view debug_name) { fail(FailState::UnableToInitializeCode, "Failed to load Wasm module due to a missing import: " + std::string(module_name) + "." + std::string(name)); + return false; } break; case WASM_EXTERN_MEMORY: { assert(memory_ == nullptr); const wasm_memorytype_t *memory_type = wasm_externtype_as_memorytype_const(extern_type); // owned by `extern_type` + if (memory_type == nullptr) { + return false; + } memory_ = wasm_memory_new(store_.get(), memory_type); + if (memory_ == nullptr) { + return false; + } imports.push_back(wasm_memory_as_extern(memory_.get())); } break; case WASM_EXTERN_TABLE: { assert(table_ == nullptr); const wasm_tabletype_t *table_type = wasm_externtype_as_tabletype_const(extern_type); // owned by `extern_type` + if (table_type == nullptr) { + return false; + } table_ = wasm_table_new(store_.get(), table_type, nullptr); + if (table_ == nullptr) { + return false; + } imports.push_back(wasm_table_as_extern(table_.get())); } break; } @@ -289,7 +338,10 @@ bool Wasmtime::link(std::string_view debug_name) { wasm_extern_vec_t imports_vec = {imports.size(), imports.data()}; instance_ = wasm_instance_new(store_.get(), module_.get(), &imports_vec, nullptr); - assert(instance_ != nullptr); + if (instance_ == nullptr) { + fail(FailState::UnableToInitializeCode, "Failed to create new Wasm instance"); + return false; + } WasmExportTypeVec export_types; wasm_module_exports(module_.get(), export_types.get()); @@ -316,7 +368,9 @@ bool Wasmtime::link(std::string_view debug_name) { case WASM_EXTERN_MEMORY: { assert(memory_ == nullptr); memory_ = wasm_memory_copy(wasm_extern_as_memory(actual_extern)); - assert(memory_ != nullptr); + if (memory_ == nullptr) { + return false; + } } break; case WASM_EXTERN_TABLE: { // TODO(mathetake): add support when/if needed. @@ -354,7 +408,7 @@ bool Wasmtime::getWord(uint64_t pointer, Word *word) { uint32_t word32; ::memcpy(&word32, wasm_memory_data(memory_.get()) + pointer, size); - word->u64_ = word32; + word->u64_ = wasmtoh(word32, true); return true; } @@ -363,7 +417,7 @@ bool Wasmtime::setWord(uint64_t pointer, Word word) { if (pointer + size > wasm_memory_data_size(memory_.get())) { return false; } - uint32_t word32 = word.u32(); + uint32_t word32 = htowasm(word.u32(), true); ::memcpy(wasm_memory_data(memory_.get()) + pointer, &word32, size); return true; } @@ -418,21 +472,19 @@ template <> uint64_t convertValueTypeToArg(wasm_val_t val) { template <> double convertValueTypeToArg(wasm_val_t val) { return val.of.f64; } template -constexpr T convertValTypesToArgsTuple(const U &vec, std::index_sequence) { +constexpr T convertValTypesToArgsTuple(const U &vec, std::index_sequence /*comptime*/) { return std::make_tuple( convertValueTypeToArg>::type>( vec->data[I])...); } template -void convertArgsTupleToValTypesImpl(wasm_valtype_vec_t *types, std::index_sequence) { +void convertArgsTupleToValTypesImpl(wasm_valtype_vec_t *types, + std::index_sequence /*comptime*/) { auto size = std::tuple_size::value; auto ps = std::array::value>{ convertArgToValTypePtr::type>()...}; wasm_valtype_vec_new(types, size, ps.data()); - for (auto i = ps.begin(); i < ps.end(); i++) { // TODO(mathetake): better way to handle? - wasm_valtype_delete(*i); - } } template ::value>> @@ -441,14 +493,16 @@ void convertArgsTupleToValTypes(wasm_valtype_vec_t *types) { } template WasmFunctypePtr newWasmNewFuncType() { - WasmValtypeVec params, results; + WasmValtypeVec params; + WasmValtypeVec results; convertArgsTupleToValTypes(params.get()); convertArgsTupleToValTypes>(results.get()); return wasm_functype_new(params.get(), results.get()); } template WasmFunctypePtr newWasmNewFuncType() { - WasmValtypeVec params, results; + WasmValtypeVec params; + WasmValtypeVec results; convertArgsTupleToValTypes(params.get()); convertArgsTupleToValTypes>(results.get()); return wasm_functype_new(params.get(), results.get()); @@ -456,25 +510,23 @@ template WasmFunctypePtr newWasmNewFuncType() { template void Wasmtime::registerHostFunctionImpl(std::string_view module_name, - std::string_view function_name, - void (*function)(void *, Args...)) { + std::string_view function_name, void (*function)(Args...)) { auto data = std::make_unique(std::string(module_name) + "." + std::string(function_name)); WasmFunctypePtr type = newWasmNewFuncType>(); WasmFuncPtr func = wasm_func_new_with_env( store_.get(), type.get(), - [](void *data, const wasm_val_vec_t *params, wasm_val_vec_t *results) -> wasm_trap_t * { - auto func_data = reinterpret_cast(data); + [](void *data, const wasm_val_vec_t *params, wasm_val_vec_t * /*results*/) -> wasm_trap_t * { + auto *func_data = reinterpret_cast(data); const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); if (log) { func_data->vm_->integration()->trace("[vm->host] " + func_data->name_ + "(" + printValues(params) + ")"); } - auto args_tuple = convertValTypesToArgsTuple>( + auto args = convertValTypesToArgsTuple>( params, std::make_index_sequence{}); - auto args = std::tuple_cat(std::make_tuple(current_context_), args_tuple); - auto fn = reinterpret_cast(func_data->raw_func_); + auto fn = reinterpret_cast(func_data->raw_func_); std::apply(fn, args); if (log) { func_data->vm_->integration()->trace("[vm<-host] " + func_data->name_ + " return: void"); @@ -492,24 +544,22 @@ void Wasmtime::registerHostFunctionImpl(std::string_view module_name, template void Wasmtime::registerHostFunctionImpl(std::string_view module_name, - std::string_view function_name, - R (*function)(void *, Args...)) { + std::string_view function_name, R (*function)(Args...)) { auto data = std::make_unique(std::string(module_name) + "." + std::string(function_name)); WasmFunctypePtr type = newWasmNewFuncType>(); WasmFuncPtr func = wasm_func_new_with_env( store_.get(), type.get(), [](void *data, const wasm_val_vec_t *params, wasm_val_vec_t *results) -> wasm_trap_t * { - auto func_data = reinterpret_cast(data); + auto *func_data = reinterpret_cast(data); const bool log = func_data->vm_->cmpLogLevel(LogLevel::trace); if (log) { func_data->vm_->integration()->trace("[vm->host] " + func_data->name_ + "(" + printValues(params) + ")"); } - auto args_tuple = convertValTypesToArgsTuple>( + auto args = convertValTypesToArgsTuple>( params, std::make_index_sequence{}); - auto args = std::tuple_cat(std::make_tuple(current_context_), args_tuple); - auto fn = reinterpret_cast(func_data->raw_func_); + auto fn = reinterpret_cast(func_data->raw_func_); R res = std::apply(fn, args); assignVal(res, results->data[0]); if (log) { @@ -537,7 +587,8 @@ void Wasmtime::getModuleFunctionImpl(std::string_view function_name, return; } - WasmValtypeVec exp_args, exp_returns; + WasmValtypeVec exp_args; + WasmValtypeVec exp_returns; convertArgsTupleToValTypes>(exp_args.get()); convertArgsTupleToValTypes>(exp_returns.get()); wasm_func_t *func = it->second.get(); @@ -554,22 +605,34 @@ void Wasmtime::getModuleFunctionImpl(std::string_view function_name, } *function = [func, function_name, this](ContextBase *context, Args... args) -> void { - wasm_val_t params_arr[] = {makeVal(args)...}; - const wasm_val_vec_t params = WASM_ARRAY_VEC(params_arr); - wasm_val_vec_t results = WASM_EMPTY_VEC; const bool log = cmpLogLevel(LogLevel::trace); - if (log) { - integration()->trace("[host->vm] " + std::string(function_name) + "(" + printValues(¶ms) + - ")"); - } SaveRestoreContext saved_context(context); - WasmTrapPtr trap{wasm_func_call(func, ¶ms, &results)}; + wasm_val_vec_t results = WASM_EMPTY_VEC; + WasmTrapPtr trap; + + // Workaround for MSVC++ not supporting zero-sized arrays. + if constexpr (sizeof...(args) > 0) { + wasm_val_t params_arr[] = {makeVal(args)...}; + wasm_val_vec_t params = WASM_ARRAY_VEC(params_arr); + if (log) { + integration()->trace("[host->vm] " + std::string(function_name) + "(" + + printValues(¶ms) + ")"); + } + trap.reset(wasm_func_call(func, ¶ms, &results)); + } else { + wasm_val_vec_t params = WASM_EMPTY_VEC; + if (log) { + integration()->trace("[host->vm] " + std::string(function_name) + "()"); + } + trap.reset(wasm_func_call(func, ¶ms, &results)); + } + if (trap) { WasmByteVec error_message; wasm_trap_message(trap.get(), error_message.get()); + std::string message(error_message.get()->data); // NULL-terminated fail(FailState::RuntimeError, - "Function: " + std::string(function_name) + " failed:\n" + - std::string(error_message.get()->data, error_message.get()->size)); + "Function: " + std::string(function_name) + " failed: " + message); return; } if (log) { @@ -586,7 +649,8 @@ void Wasmtime::getModuleFunctionImpl(std::string_view function_name, *function = nullptr; return; } - WasmValtypeVec exp_args, exp_returns; + WasmValtypeVec exp_args; + WasmValtypeVec exp_returns; convertArgsTupleToValTypes>(exp_args.get()); convertArgsTupleToValTypes>(exp_returns.get()); wasm_func_t *func = it->second.get(); @@ -602,23 +666,35 @@ void Wasmtime::getModuleFunctionImpl(std::string_view function_name, } *function = [func, function_name, this](ContextBase *context, Args... args) -> R { - wasm_val_t params_arr[] = {makeVal(args)...}; - const wasm_val_vec_t params = WASM_ARRAY_VEC(params_arr); + const bool log = cmpLogLevel(LogLevel::trace); + SaveRestoreContext saved_context(context); wasm_val_t results_arr[1]; wasm_val_vec_t results = WASM_ARRAY_VEC(results_arr); - const bool log = cmpLogLevel(LogLevel::trace); - if (log) { - integration()->trace("[host->vm] " + std::string(function_name) + "(" + printValues(¶ms) + - ")"); + WasmTrapPtr trap; + + // Workaround for MSVC++ not supporting zero-sized arrays. + if constexpr (sizeof...(args) > 0) { + wasm_val_t params_arr[] = {makeVal(args)...}; + wasm_val_vec_t params = WASM_ARRAY_VEC(params_arr); + if (log) { + integration()->trace("[host->vm] " + std::string(function_name) + "(" + + printValues(¶ms) + ")"); + } + trap.reset(wasm_func_call(func, ¶ms, &results)); + } else { + wasm_val_vec_t params = WASM_EMPTY_VEC; + if (log) { + integration()->trace("[host->vm] " + std::string(function_name) + "()"); + } + trap.reset(wasm_func_call(func, ¶ms, &results)); } - SaveRestoreContext saved_context(context); - WasmTrapPtr trap{wasm_func_call(func, ¶ms, &results)}; + if (trap) { WasmByteVec error_message; wasm_trap_message(trap.get(), error_message.get()); + std::string message(error_message.get()->data); // NULL-terminated fail(FailState::RuntimeError, - "Function: " + std::string(function_name) + " failed:\n" + - std::string(error_message.get()->data, error_message.get()->size)); + "Function: " + std::string(function_name) + " failed: " + message); return R{}; } R ret = convertValueTypeToArg(results.data[0]); @@ -630,6 +706,8 @@ void Wasmtime::getModuleFunctionImpl(std::string_view function_name, }; }; +void Wasmtime::warm() { initStore(); } + } // namespace wasmtime std::unique_ptr createWasmtimeVm() { return std::make_unique(); } diff --git a/src/wavm/wavm.cc b/src/wavm/wavm.cc deleted file mode 100644 index 92b314688..000000000 --- a/src/wavm/wavm.cc +++ /dev/null @@ -1,441 +0,0 @@ -// Copyright 2016-2019 Envoy Project Authors -// 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. - -#include "include/proxy-wasm/wavm.h" -#include "include/proxy-wasm/wasm_vm.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "WAVM/IR/Module.h" -#include "WAVM/IR/Operators.h" -#include "WAVM/IR/Types.h" -#include "WAVM/IR/Validate.h" -#include "WAVM/IR/Value.h" -#include "WAVM/Inline/Assert.h" -#include "WAVM/Inline/BasicTypes.h" -#include "WAVM/Inline/Errors.h" -#include "WAVM/Inline/Hash.h" -#include "WAVM/Inline/HashMap.h" -#include "WAVM/Inline/IndexMap.h" -#include "WAVM/Inline/IntrusiveSharedPtr.h" -#include "WAVM/Platform/Mutex.h" -#include "WAVM/Platform/Thread.h" -#include "WAVM/Runtime/Intrinsics.h" -#include "WAVM/Runtime/Linker.h" -#include "WAVM/Runtime/Runtime.h" -#include "WAVM/RuntimeABI/RuntimeABI.h" -#include "WAVM/WASM/WASM.h" -#include "WAVM/WASTParse/WASTParse.h" - -#ifdef NDEBUG -#define ASSERT(_x) _x -#else -#define ASSERT(_x) \ - do { \ - if (!_x) \ - ::exit(1); \ - } while (0) -#endif - -using namespace WAVM; -using namespace WAVM::IR; - -namespace WAVM { -namespace IR { -template <> constexpr ValueType inferValueType() { return ValueType::i32; } -} // namespace IR -} // namespace WAVM - -namespace proxy_wasm { - -// Forward declarations. -template -void getFunctionWavm(WasmVm *vm, std::string_view function_name, - std::function *function); -template -void getFunctionWavm(WasmVm *vm, std::string_view function_name, - std::function *function); -template -void registerCallbackWavm(WasmVm *vm, std::string_view module_name, std::string_view function_name, - R (*function)(Args...)); - -namespace Wavm { - -struct Wavm; - -namespace { - -#define CALL_WITH_CONTEXT(_x, _context, _wavm) \ - do { \ - try { \ - SaveRestoreContext _saved_context(static_cast(_context)); \ - WAVM::Runtime::catchRuntimeExceptions( \ - [&] { _x; }, \ - [&](WAVM::Runtime::Exception *exception) { \ - _wavm->fail(FailState::RuntimeError, getFailMessage(function_name, exception)); \ - throw std::exception(); \ - }); \ - } catch (...) { \ - } \ - } while (0) - -std::string getFailMessage(std::string_view function_name, WAVM::Runtime::Exception *exception) { - std::string message = "Function: " + std::string(function_name) + - " failed: " + WAVM::Runtime::describeExceptionType(exception->type) + - "\nProxy-Wasm plugin in-VM backtrace:\n"; - std::vector callstack_descriptions = - WAVM::Runtime::describeCallStack(exception->callStack); - - // Since the first frame is on host and useless for developers, e.g.: `host!envoy+112901013` - // we start with index 1 here - for (size_t i = 1; i < callstack_descriptions.size(); i++) { - std::ostringstream oss; - std::string description = callstack_descriptions[i]; - if (description.find("wasm!") == std::string::npos) { - // end of WASM's call stack - break; - } - oss << std::setw(3) << std::setfill(' ') << std::to_string(i); - message += oss.str() + ": " + description + "\n"; - } - - WAVM::Runtime::destroyException(exception); - return message; -} - -struct WasmUntaggedValue : public WAVM::IR::UntaggedValue { - WasmUntaggedValue() = default; - WasmUntaggedValue(I32 inI32) { i32 = inI32; } - WasmUntaggedValue(I64 inI64) { i64 = inI64; } - WasmUntaggedValue(U32 inU32) { u32 = inU32; } - WasmUntaggedValue(Word w) { u32 = static_cast(w.u64_); } - WasmUntaggedValue(U64 inU64) { u64 = inU64; } - WasmUntaggedValue(F32 inF32) { f32 = inF32; } - WasmUntaggedValue(F64 inF64) { f64 = inF64; } -}; - -class RootResolver : public WAVM::Runtime::Resolver { -public: - RootResolver(WAVM::Runtime::Compartment *, WasmVm *vm) : vm_(vm) {} - - virtual ~RootResolver() { module_name_to_instance_map_.clear(); } - - bool resolve(const std::string &module_name, const std::string &export_name, ExternType type, - WAVM::Runtime::Object *&out_object) override { - auto named_instance = module_name_to_instance_map_.get(module_name); - if (named_instance) { - out_object = getInstanceExport(*named_instance, export_name); - if (out_object) { - if (isA(out_object, type)) { - return true; - } else { - vm_->fail(FailState::UnableToInitializeCode, - "Failed to load WASM module due to a type mismatch in an import: " + - std::string(module_name) + "." + export_name + " " + - asString(WAVM::Runtime::getExternType(out_object)) + - " but was expecting type: " + asString(type)); - return false; - } - } - } - for (auto r : resolvers_) { - if (r->resolve(module_name, export_name, type, out_object)) { - return true; - } - } - vm_->fail(FailState::MissingFunction, - "Failed to load Wasm module due to a missing import: " + std::string(module_name) + - "." + std::string(export_name) + " " + asString(type)); - return false; - } - - HashMap &moduleNameToInstanceMap() { - return module_name_to_instance_map_; - } - - void addResolver(WAVM::Runtime::Resolver *r) { resolvers_.push_back(r); } - -private: - WasmVm *vm_; - HashMap module_name_to_instance_map_; - std::vector resolvers_; -}; - -const uint64_t WasmPageSize = 1 << 16; - -} // namespace - -template struct NativeWord { using type = T; }; -template <> struct NativeWord { using type = uint32_t; }; - -template typename NativeWord::type ToNative(const T &t) { return t; } -template <> typename NativeWord::type ToNative(const Word &t) { return t.u32(); } - -struct PairHash { - template std::size_t operator()(const std::pair &x) const { - return std::hash()(x.first) + std::hash()(x.second); - } -}; - -struct Wavm : public WasmVm { - Wavm() : WasmVm() {} - ~Wavm() override; - - // WasmVm - std::string_view runtime() override { return "wavm"; } - Cloneable cloneable() override { return Cloneable::InstantiatedModule; }; - std::unique_ptr clone() override; - bool load(std::string_view bytecode, std::string_view precompiled, - const std::unordered_map function_names) override; - bool link(std::string_view debug_name) override; - uint64_t getMemorySize() override; - std::optional getMemory(uint64_t pointer, uint64_t size) override; - bool setMemory(uint64_t pointer, uint64_t size, const void *data) override; - bool getWord(uint64_t pointer, Word *data) override; - bool setWord(uint64_t pointer, Word data) override; - size_t getWordSize() override { return sizeof(uint32_t); }; - std::string_view getPrecompiledSectionName() override; - -#define _GET_FUNCTION(_T) \ - void getFunction(std::string_view function_name, _T *f) override { \ - getFunctionWavm(this, function_name, f); \ - }; - FOR_ALL_WASM_VM_EXPORTS(_GET_FUNCTION) -#undef _GET_FUNCTION - -#define _REGISTER_CALLBACK(_T) \ - void registerCallback(std::string_view module_name, std::string_view function_name, _T, \ - typename ConvertFunctionTypeWordToUint32<_T>::type f) override { \ - registerCallbackWavm(this, module_name, function_name, f); \ - }; - FOR_ALL_WASM_VM_IMPORTS(_REGISTER_CALLBACK) -#undef _REGISTER_CALLBACK - - IR::Module ir_module_; - WAVM::Runtime::ModuleRef module_ = nullptr; - WAVM::Runtime::GCPointer module_instance_; - WAVM::Runtime::Memory *memory_; - WAVM::Runtime::GCPointer compartment_; - WAVM::Runtime::GCPointer context_; - std::map intrinsic_modules_; - std::map> - intrinsic_module_instances_; - std::vector> host_functions_; - uint8_t *memory_base_ = nullptr; -}; - -Wavm::~Wavm() { - module_instance_ = nullptr; - context_ = nullptr; - intrinsic_module_instances_.clear(); - intrinsic_modules_.clear(); - host_functions_.clear(); - if (compartment_) { - ASSERT(tryCollectCompartment(std::move(compartment_))); - } -} - -std::unique_ptr Wavm::clone() { - auto wavm = std::make_unique(); - wavm->integration().reset(integration()->clone()); - - wavm->compartment_ = WAVM::Runtime::cloneCompartment(compartment_); - wavm->memory_ = WAVM::Runtime::remapToClonedCompartment(memory_, wavm->compartment_); - wavm->memory_base_ = WAVM::Runtime::getMemoryBaseAddress(wavm->memory_); - wavm->context_ = WAVM::Runtime::createContext(wavm->compartment_); - - for (auto &p : intrinsic_module_instances_) { - wavm->intrinsic_module_instances_.emplace( - p.first, WAVM::Runtime::remapToClonedCompartment(p.second, wavm->compartment_)); - } - wavm->module_instance_ = - WAVM::Runtime::remapToClonedCompartment(module_instance_, wavm->compartment_); - return wavm; -} - -bool Wavm::load(std::string_view bytecode, std::string_view precompiled, - const std::unordered_map) { - compartment_ = WAVM::Runtime::createCompartment(); - context_ = WAVM::Runtime::createContext(compartment_); - if (!WASM::loadBinaryModule(reinterpret_cast(bytecode.data()), - bytecode.size(), ir_module_)) { - return false; - } - - if (!precompiled.empty()) { - module_ = WAVM::Runtime::loadPrecompiledModule( - ir_module_, {precompiled.data(), precompiled.data() + precompiled.size()}); - } else { - module_ = WAVM::Runtime::compileModule(ir_module_); - } - - return module_ != nullptr; -} - -bool Wavm::link(std::string_view debug_name) { - RootResolver rootResolver(compartment_, this); - for (auto &p : intrinsic_modules_) { - auto instance = Intrinsics::instantiateModule(compartment_, {&intrinsic_modules_[p.first]}, - std::string(p.first)); - intrinsic_module_instances_.emplace(p.first, instance); - rootResolver.moduleNameToInstanceMap().set(p.first, instance); - } - WAVM::Runtime::LinkResult link_result = linkModule(ir_module_, rootResolver); - if (!link_result.missingImports.empty()) { - for (auto &i : link_result.missingImports) { - integration()->error("Missing Wasm import " + i.moduleName + " " + i.exportName); - } - fail(FailState::MissingFunction, "Failed to load Wasm module due to a missing import(s)"); - return false; - } - module_instance_ = instantiateModule( - compartment_, module_, std::move(link_result.resolvedImports), std::string(debug_name)); - memory_ = getDefaultMemory(module_instance_); - memory_base_ = WAVM::Runtime::getMemoryBaseAddress(memory_); - return true; -} - -uint64_t Wavm::getMemorySize() { return WAVM::Runtime::getMemoryNumPages(memory_) * WasmPageSize; } - -std::optional Wavm::getMemory(uint64_t pointer, uint64_t size) { - auto memory_num_bytes = WAVM::Runtime::getMemoryNumPages(memory_) * WasmPageSize; - if (pointer + size > memory_num_bytes) { - return std::nullopt; - } - return std::string_view(reinterpret_cast(memory_base_ + pointer), size); -} - -bool Wavm::setMemory(uint64_t pointer, uint64_t size, const void *data) { - auto memory_num_bytes = WAVM::Runtime::getMemoryNumPages(memory_) * WasmPageSize; - if (pointer + size > memory_num_bytes) { - return false; - } - auto p = reinterpret_cast(memory_base_ + pointer); - memcpy(p, data, size); - return true; -} - -bool Wavm::getWord(uint64_t pointer, Word *data) { - auto memory_num_bytes = WAVM::Runtime::getMemoryNumPages(memory_) * WasmPageSize; - if (pointer + sizeof(uint32_t) > memory_num_bytes) { - return false; - } - auto p = reinterpret_cast(memory_base_ + pointer); - uint32_t data32; - memcpy(&data32, p, sizeof(uint32_t)); - data->u64_ = data32; - return true; -} - -bool Wavm::setWord(uint64_t pointer, Word data) { - uint32_t data32 = data.u32(); - return setMemory(pointer, sizeof(uint32_t), &data32); -} - -std::string_view Wavm::getPrecompiledSectionName() { return "wavm.precompiled_object"; } - -} // namespace Wavm - -std::unique_ptr createWavmVm() { return std::make_unique(); } - -template -IR::FunctionType inferHostFunctionType(R (*)(void *, Args...)) { - return IR::FunctionType(IR::inferResultType(), IR::TypeTuple({IR::inferValueType()...}), - IR::CallingConvention::intrinsic); -} - -using namespace Wavm; - -template -void registerCallbackWavm(WasmVm *vm, std::string_view module_name, std::string_view function_name, - R (*f)(Args...)) { - auto wavm = static_cast(vm); - wavm->host_functions_.emplace_back(new Intrinsics::Function( - &wavm->intrinsic_modules_[std::string(module_name)], function_name.data(), - reinterpret_cast(f), inferHostFunctionType(f))); -} - -template -IR::FunctionType inferStdFunctionType(std::function *) { - return IR::FunctionType(IR::inferResultType(), IR::TypeTuple({IR::inferValueType()...})); -} - -static bool checkFunctionType(WAVM::Runtime::Function *f, IR::FunctionType t) { - return getFunctionType(f) == t; -} - -template -void getFunctionWavm(WasmVm *vm, std::string_view function_name, - std::function *function) { - auto wavm = static_cast(vm); - auto f = - asFunctionNullable(getInstanceExport(wavm->module_instance_, std::string(function_name))); - if (!f) - f = asFunctionNullable(getInstanceExport(wavm->module_instance_, std::string(function_name))); - if (!f) { - *function = nullptr; - return; - } - if (!checkFunctionType(f, inferStdFunctionType(function))) { - wavm->fail(FailState::UnableToInitializeCode, - "Bad function signature for: " + std::string(function_name)); - } - *function = [wavm, f, function_name](ContextBase *context, Args... args) -> R { - WasmUntaggedValue values[] = {args...}; - WasmUntaggedValue return_value; - CALL_WITH_CONTEXT( - invokeFunction(wavm->context_, f, getFunctionType(f), &values[0], &return_value), context, - wavm); - if (!wavm->isFailed()) { - return static_cast(return_value.i32); - } else { - return 0; - } - }; -} - -template -void getFunctionWavm(WasmVm *vm, std::string_view function_name, - std::function *function) { - auto wavm = static_cast(vm); - auto f = - asFunctionNullable(getInstanceExport(wavm->module_instance_, std::string(function_name))); - if (!f) - f = asFunctionNullable(getInstanceExport(wavm->module_instance_, std::string(function_name))); - if (!f) { - *function = nullptr; - return; - } - if (!checkFunctionType(f, inferStdFunctionType(function))) { - wavm->fail(FailState::UnableToInitializeCode, - "Bad function signature for: " + std::string(function_name)); - } - *function = [wavm, f, function_name](ContextBase *context, Args... args) { - WasmUntaggedValue values[] = {args...}; - CALL_WITH_CONTEXT(invokeFunction(wavm->context_, f, getFunctionType(f), &values[0]), context, - wavm); - }; -} - -} // namespace proxy_wasm diff --git a/test/BUILD b/test/BUILD index 132404b3f..97e70558a 100644 --- a/test/BUILD +++ b/test/BUILD @@ -1,4 +1,20 @@ -load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") +# Copyright 2022 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("@proxy_wasm_cpp_host//bazel:select.bzl", "proxy_wasm_select_engine_null") +load("@rules_cc//cc:defs.bzl", "cc_library") +load("//bazel:cc_defs.bzl", "cc_test") licenses(["notice"]) # Apache 2 @@ -6,7 +22,8 @@ package(default_visibility = ["//visibility:public"]) cc_test( name = "null_vm_test", - srcs = ["null_vm_test.cc"], + srcs = proxy_wasm_select_engine_null(["null_vm_test.cc"]), + linkstatic = 1, deps = [ "//:lib", "@com_google_googletest//:gtest", @@ -20,6 +37,7 @@ cc_test( data = [ "//test/test_data:abi_export.wasm", ], + linkstatic = 1, deps = [ ":utility_lib", "//:lib", @@ -36,6 +54,7 @@ cc_test( "//test/test_data:abi_export.signed.with.key2.wasm", "//test/test_data:abi_export.wasm", ], + linkstatic = 1, # Test only when compiled to verify plugins. tags = ["manual"], deps = [ @@ -48,12 +67,15 @@ cc_test( cc_test( name = "runtime_test", + timeout = "long", srcs = ["runtime_test.cc"], data = [ - "//test/test_data:abi_export.wasm", "//test/test_data:callback.wasm", + "//test/test_data:clock.wasm", + "//test/test_data:resource_limits.wasm", "//test/test_data:trap.wasm", ], + linkstatic = 1, deps = [ ":utility_lib", "//:lib", @@ -68,7 +90,56 @@ cc_test( data = [ "//test/test_data:clock.wasm", "//test/test_data:env.wasm", + "//test/test_data:random.wasm", + ], + linkstatic = 1, + shard_count = 8, + deps = [ + ":utility_lib", + "//:lib", + "@com_google_googletest//:gtest", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "wasm_test", + srcs = ["wasm_test.cc"], + data = [ + "//test/test_data:abi_export.wasm", + "//test/test_data:canary_check.wasm", + ], + linkstatic = 1, + deps = [ + ":utility_lib", + "//:lib", + "@com_google_googletest//:gtest", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "logging_test", + srcs = ["logging_test.cc"], + data = [ + "//test/test_data:http_logging.wasm", + ], + linkstatic = 1, + deps = [ + ":utility_lib", + "//:lib", + "@com_google_googletest//:gtest", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "stop_iteration_test", + srcs = ["stop_iteration_test.cc"], + data = [ + "//test/test_data:stop_iteration.wasm", ], + linkstatic = 1, deps = [ ":utility_lib", "//:lib", @@ -78,9 +149,14 @@ cc_test( ) cc_test( - name = "context_test", - srcs = ["context_test.cc"], + name = "security_test", + srcs = ["security_test.cc"], + data = [ + "//test/test_data:bad_malloc.wasm", + ], + linkstatic = 1, deps = [ + ":utility_lib", "//:lib", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", @@ -90,6 +166,7 @@ cc_test( cc_test( name = "shared_data", srcs = ["shared_data_test.cc"], + linkstatic = 1, deps = [ "//:lib", "@com_google_googletest//:gtest", @@ -100,6 +177,7 @@ cc_test( cc_test( name = "shared_queue", srcs = ["shared_queue_test.cc"], + linkstatic = 1, deps = [ "//:lib", "@com_google_googletest//:gtest", @@ -110,6 +188,34 @@ cc_test( cc_test( name = "vm_id_handle", srcs = ["vm_id_handle_test.cc"], + linkstatic = 1, + deps = [ + "//:lib", + "@com_google_googletest//:gtest", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "wasm_vm_test", + timeout = "long", + srcs = ["wasm_vm_test.cc"], + data = [ + "//test/test_data:abi_export.wasm", + ], + linkstatic = 1, + deps = [ + ":utility_lib", + "//:lib", + "@com_google_googletest//:gtest", + "@com_google_googletest//:gtest_main", + ], +) + +cc_test( + name = "pairs_util_test", + srcs = ["pairs_util_test.cc"], + linkstatic = 1, deps = [ "//:lib", "@com_google_googletest//:gtest", diff --git a/test/bytecode_util_test.cc b/test/bytecode_util_test.cc index 529434577..2e1a813cb 100644 --- a/test/bytecode_util_test.cc +++ b/test/bytecode_util_test.cc @@ -59,7 +59,14 @@ TEST(TestBytecodeUtil, getFunctionNameIndex) { // OK. EXPECT_TRUE(BytecodeUtil::getFunctionNameIndex(source, actual)); EXPECT_FALSE(actual.empty()); - EXPECT_EQ(actual.find(0)->second, "proxy_abi_version_0_2_0"); + bool abi_version_found = false; + for (const auto &it : actual) { + if (it.second == "proxy_abi_version_0_2_0") { + abi_version_found = true; + break; + } + } + EXPECT_TRUE(abi_version_found); // Fail due to the corrupted bytecode. // TODO(@mathetake): here we haven't covered all the parsing failure branches. Add more cases. diff --git a/test/exports_test.cc b/test/exports_test.cc index d18e0983a..026019c03 100644 --- a/test/exports_test.cc +++ b/test/exports_test.cc @@ -30,88 +30,131 @@ namespace proxy_wasm { namespace { -auto test_values = testing::ValuesIn(getRuntimes()); +INSTANTIATE_TEST_SUITE_P(WasmEngines, TestVm, testing::ValuesIn(getWasmEngines()), + [](const testing::TestParamInfo &info) { + return info.param; + }); -INSTANTIATE_TEST_SUITE_P(Runtimes, TestVM, test_values); - -class TestContext : public ContextBase { -public: - TestContext(WasmBase *base) : ContextBase(base){}; - WasmResult log(uint32_t, std::string_view msg) override { - log_ += std::string(msg) + "\n"; - return WasmResult::Ok; - } - std::string &log_msg() { return log_; } - -private: - std::string log_; -}; - -TEST_P(TestVM, Environment) { +TEST_P(TestVm, Environment) { std::unordered_map envs = {{"KEY1", "VALUE1"}, {"KEY2", "VALUE2"}}; - initialize("env.wasm"); - - auto wasm_base = WasmBase(std::move(vm_), "vm_id", "", "", envs, {}); - ASSERT_TRUE(wasm_base.wasm_vm()->load(source_, {}, {})); - - TestContext context(&wasm_base); - current_context_ = &context; - - wasm_base.registerCallbacks(); - - ASSERT_TRUE(wasm_base.wasm_vm()->link("")); + auto source = readTestWasmFile("env.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_), envs); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); WasmCallVoid<0> run; - wasm_base.wasm_vm()->getFunction("run", &run); - - run(current_context_); - - auto msg = context.log_msg(); - EXPECT_NE(std::string::npos, msg.find("KEY1: VALUE1\n")) << msg; - EXPECT_NE(std::string::npos, msg.find("KEY2: VALUE2\n")) << msg; + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); + run(wasm.vm_context()); + + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogged("KEY1: VALUE1\n")); + EXPECT_TRUE(context->isLogged("KEY2: VALUE2\n")); } -TEST_P(TestVM, WithoutEnvironment) { - initialize("env.wasm"); - auto wasm_base = WasmBase(std::move(vm_), "vm_id", "", "", {}, {}); - ASSERT_TRUE(wasm_base.wasm_vm()->load(source_, {}, {})); +TEST_P(TestVm, WithoutEnvironment) { + auto source = readTestWasmFile("env.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_), {}); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); - TestContext context(&wasm_base); - current_context_ = &context; + WasmCallVoid<0> run; + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); + run(wasm.vm_context()); - wasm_base.registerCallbacks(); + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogEmpty()); +} - ASSERT_TRUE(wasm_base.wasm_vm()->link("")); +TEST_P(TestVm, Clock) { + auto source = readTestWasmFile("clock.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); WasmCallVoid<0> run; - wasm_base.wasm_vm()->getFunction("run", &run); - - run(current_context_); - - EXPECT_EQ(context.log_msg(), ""); + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); + run(wasm.vm_context()); + + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogged("monotonic: ")); + EXPECT_TRUE(context->isLogged("realtime: ")); } -TEST_P(TestVM, Clock) { - initialize("clock.wasm"); - auto wasm_base = WasmBase(std::move(vm_), "vm_id", "", "", {}, {}); - ASSERT_TRUE(wasm_base.wasm_vm()->load(source_, {}, {})); - - TestContext context(&wasm_base); - current_context_ = &context; +TEST_P(TestVm, RandomZero) { + auto source = readTestWasmFile("random.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + WasmCallVoid<1> run; + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); + run(wasm.vm_context(), Word{0}); + + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogged("random_get(0) succeeded.")); +} - wasm_base.registerCallbacks(); +TEST_P(TestVm, RandomSmall) { + auto source = readTestWasmFile("random.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + WasmCallVoid<1> run; + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); + run(wasm.vm_context(), Word{32}); + + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogged("random_get(32) succeeded.")); +} - ASSERT_TRUE(wasm_base.wasm_vm()->link("")); +TEST_P(TestVm, RandomLarge) { + auto source = readTestWasmFile("random.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + WasmCallVoid<1> run; + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); + run(wasm.vm_context(), Word{64 * 1024}); + + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogged("random_get(65536) succeeded.")); +} - WasmCallVoid<0> run; - wasm_base.wasm_vm()->getFunction("run", &run); - ASSERT_TRUE(run); - run(current_context_); - - // Check logs. - auto msg = context.log_msg(); - EXPECT_NE(std::string::npos, msg.find("monotonic: ")) << msg; - EXPECT_NE(std::string::npos, msg.find("realtime: ")) << msg; +TEST_P(TestVm, RandomTooLarge) { + auto source = readTestWasmFile("random.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + WasmCallVoid<1> run; + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); + run(wasm.vm_context(), Word{65 * 1024}); + + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogged("random_get(66560) failed.")); } } // namespace diff --git a/test/fuzz/BUILD b/test/fuzz/BUILD new file mode 100644 index 000000000..2221f6367 --- /dev/null +++ b/test/fuzz/BUILD @@ -0,0 +1,47 @@ +# Copyright 2022 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:cc_defs.bzl", "cc_fuzz_test") + +licenses(["notice"]) # Apache 2 + +package(default_visibility = ["//visibility:public"]) + +filegroup( + name = "corpus_bytecode", + srcs = glob(["corpus_bytecode/**"]), +) + +cc_fuzz_test( + name = "bytecode_util_fuzzer", + srcs = ["bytecode_util_fuzzer.cc"], + corpus = [":corpus_bytecode"], + deps = [ + "//:lib", + ], +) + +filegroup( + name = "corpus_pairs", + srcs = glob(["corpus_pairs/**"]), +) + +cc_fuzz_test( + name = "pairs_util_fuzzer", + srcs = ["pairs_util_fuzzer.cc"], + corpus = [":corpus_pairs"], + deps = [ + "//:lib", + ], +) diff --git a/test/fuzz/bytecode_util_fuzzer.cc b/test/fuzz/bytecode_util_fuzzer.cc new file mode 100644 index 000000000..b77d9423b --- /dev/null +++ b/test/fuzz/bytecode_util_fuzzer.cc @@ -0,0 +1,41 @@ +// Copyright 2022 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. + +#include "include/proxy-wasm/bytecode_util.h" + +#include + +namespace proxy_wasm { +namespace { + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + auto bytecode = std::string_view(reinterpret_cast(data), size); + + AbiVersion version; + BytecodeUtil::getAbiVersion(bytecode, version); + + std::string_view custom_section; + BytecodeUtil::getCustomSection(bytecode, "precompiled", custom_section); + + std::string stripped_source; + BytecodeUtil::getStrippedSource(bytecode, stripped_source); + + std::unordered_map function_names; + BytecodeUtil::getFunctionNameIndex(bytecode, function_names); + + return 0; +} + +} // namespace +} // namespace proxy_wasm diff --git a/test/fuzz/corpus_bytecode/crash-10198e96614e9ff7ca6dae581f4f7f13143257d7 b/test/fuzz/corpus_bytecode/crash-10198e96614e9ff7ca6dae581f4f7f13143257d7 new file mode 100644 index 000000000..a8e688a41 Binary files /dev/null and b/test/fuzz/corpus_bytecode/crash-10198e96614e9ff7ca6dae581f4f7f13143257d7 differ diff --git a/test/fuzz/corpus_bytecode/crash-6d94d1b10bc8dabc467a8e4a9a7105f62c81ff4c b/test/fuzz/corpus_bytecode/crash-6d94d1b10bc8dabc467a8e4a9a7105f62c81ff4c new file mode 100644 index 000000000..81aa8f42e Binary files /dev/null and b/test/fuzz/corpus_bytecode/crash-6d94d1b10bc8dabc467a8e4a9a7105f62c81ff4c differ diff --git a/test/fuzz/corpus_bytecode/crash-8cff35e5a0f9722df891fd1f05ca6dc2bd3d42aa b/test/fuzz/corpus_bytecode/crash-8cff35e5a0f9722df891fd1f05ca6dc2bd3d42aa new file mode 100644 index 000000000..63b0377d5 Binary files /dev/null and b/test/fuzz/corpus_bytecode/crash-8cff35e5a0f9722df891fd1f05ca6dc2bd3d42aa differ diff --git a/test/fuzz/corpus_bytecode/crash-9718722528a7c015ef3852490a6c67649bda70c0 b/test/fuzz/corpus_bytecode/crash-9718722528a7c015ef3852490a6c67649bda70c0 new file mode 100644 index 000000000..c5eb9dd06 Binary files /dev/null and b/test/fuzz/corpus_bytecode/crash-9718722528a7c015ef3852490a6c67649bda70c0 differ diff --git a/test/fuzz/corpus_bytecode/crash-ed7193f661f04a66a13facee4d25709e6f479d3d b/test/fuzz/corpus_bytecode/crash-ed7193f661f04a66a13facee4d25709e6f479d3d new file mode 100644 index 000000000..30e3f1ae1 Binary files /dev/null and b/test/fuzz/corpus_bytecode/crash-ed7193f661f04a66a13facee4d25709e6f479d3d differ diff --git a/test/fuzz/corpus_pairs/crash-0bf4371e72f7ae83f9c5bf3e2485531cdcaaaa04 b/test/fuzz/corpus_pairs/crash-0bf4371e72f7ae83f9c5bf3e2485531cdcaaaa04 new file mode 100644 index 000000000..7be804a26 Binary files /dev/null and b/test/fuzz/corpus_pairs/crash-0bf4371e72f7ae83f9c5bf3e2485531cdcaaaa04 differ diff --git a/test/fuzz/pairs_util_fuzzer.cc b/test/fuzz/pairs_util_fuzzer.cc new file mode 100644 index 000000000..84e7ca0f1 --- /dev/null +++ b/test/fuzz/pairs_util_fuzzer.cc @@ -0,0 +1,47 @@ +// Copyright 2022 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. + +#include "include/proxy-wasm/pairs_util.h" + +#include +#include + +namespace proxy_wasm { +namespace { + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + auto input = std::string_view(reinterpret_cast(data), size); + + auto pairs = PairsUtil::toPairs(input); + + if (!pairs.empty()) { + // Verify that non-empty Pairs serializes back to the same bytes. + auto new_size = PairsUtil::pairsSize(pairs); + if (new_size != size) { + __builtin_trap(); + } + std::vector new_data(new_size); + if (!PairsUtil::marshalPairs(pairs, new_data.data(), new_data.size())) { + __builtin_trap(); + } + if (::memcmp(new_data.data(), data, size) != 0) { + __builtin_trap(); + } + } + + return 0; +} + +} // namespace +} // namespace proxy_wasm diff --git a/test/logging_test.cc b/test/logging_test.cc new file mode 100644 index 000000000..e4cbdcdca --- /dev/null +++ b/test/logging_test.cc @@ -0,0 +1,69 @@ +// Copyright 2023 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. + +#include "gtest/gtest.h" +#include "include/proxy-wasm/wasm.h" +#include "test/utility.h" + +namespace proxy_wasm { + +INSTANTIATE_TEST_SUITE_P(WasmEngines, TestVm, testing::ValuesIn(getWasmEngines()), + [](const testing::TestParamInfo &info) { + return info.param; + }); + +// TestVm is parameterized for each engine and creates a VM on construction. +TEST_P(TestVm, HttpLogging) { + // Read the wasm source. + auto source = readTestWasmFile("http_logging.wasm"); + ASSERT_FALSE(source.empty()); + + // Create a WasmBase and load the plugin. + auto wasm = std::make_shared(std::move(vm_)); + ASSERT_TRUE(wasm->load(source, /*allow_precompiled=*/false)); + ASSERT_TRUE(wasm->initialize()); + + // Create a plugin. + const auto plugin = std::make_shared( + /*name=*/"test", /*root_id=*/"", /*vm_id=*/"", + /*engine=*/wasm->wasm_vm()->getEngineName(), /*plugin_config=*/"", + /*fail_open=*/false, /*key=*/""); + + // Create root context, call onStart(). + ContextBase *root_context = wasm->start(plugin); + ASSERT_TRUE(root_context != nullptr); + + // On the root context, call onConfigure(). + ASSERT_TRUE(wasm->configure(root_context, plugin)); + + // Create a stream context. + { + auto wasm_handle = std::make_shared(wasm); + auto plugin_handle = std::make_shared(wasm_handle, plugin); + auto stream_context = TestContext(wasm.get(), root_context->id(), plugin_handle); + stream_context.onCreate(); + EXPECT_TRUE(stream_context.isLogged("onCreate called")); + stream_context.onRequestHeaders(/*headers=*/0, /*end_of_stream=*/false); + EXPECT_TRUE(stream_context.isLogged("onRequestHeaders called")); + stream_context.onResponseHeaders(/*headers=*/0, /*end_of_stream=*/false); + EXPECT_TRUE(stream_context.isLogged("onResponseHeaders called")); + stream_context.onDone(); + EXPECT_TRUE(stream_context.isLogged("onDone called")); + stream_context.onDelete(); + EXPECT_TRUE(stream_context.isLogged("onDelete called")); + } + EXPECT_FALSE(wasm->isFailed()); +} + +} // namespace proxy_wasm diff --git a/test/null_vm_test.cc b/test/null_vm_test.cc index eeae92698..5bb862f96 100644 --- a/test/null_vm_test.cc +++ b/test/null_vm_test.cc @@ -14,10 +14,11 @@ #include "include/proxy-wasm/wasm_vm.h" -#include "gtest/gtest.h" #include "include/proxy-wasm/null.h" #include "include/proxy-wasm/null_vm_plugin.h" +#include "gtest/gtest.h" + namespace proxy_wasm { class TestNullVmPlugin : public NullVmPlugin { @@ -58,13 +59,13 @@ TEST(WasmVm, Word) { class BaseVmTest : public testing::Test { public: - BaseVmTest() {} + BaseVmTest() = default; }; TEST_F(BaseVmTest, NullVmStartup) { auto wasm_vm = createNullVm(); EXPECT_TRUE(wasm_vm != nullptr); - EXPECT_TRUE(wasm_vm->runtime() == "null"); + EXPECT_TRUE(wasm_vm->getEngineName() == "null"); EXPECT_TRUE(wasm_vm->cloneable() == Cloneable::InstantiatedModule); auto wasm_vm_clone = wasm_vm->clone(); EXPECT_TRUE(wasm_vm_clone != nullptr); @@ -72,4 +73,10 @@ TEST_F(BaseVmTest, NullVmStartup) { EXPECT_NE(test_null_vm_plugin, nullptr); } +TEST_F(BaseVmTest, ByteOrder) { + auto wasm_vm = createNullVm(); + EXPECT_TRUE(wasm_vm->load("test_null_vm_plugin", {}, {})); + EXPECT_FALSE(wasm_vm->usesWasmByteOrder()); +} + } // namespace proxy_wasm diff --git a/test/pairs_util_test.cc b/test/pairs_util_test.cc new file mode 100644 index 000000000..3f9fcd965 --- /dev/null +++ b/test/pairs_util_test.cc @@ -0,0 +1,33 @@ +// Copyright 2022 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. + +#include "include/proxy-wasm/pairs_util.h" +#include "gtest/gtest.h" + +namespace proxy_wasm { + +TEST(PairsUtilTest, EncodeDecode) { + proxy_wasm::Pairs pairs1; + std::string data1("some_data"); + auto size_str = std::to_string(data1.size()); + pairs1.push_back({data1, size_str}); + std::vector buffer(PairsUtil::pairsSize(pairs1)); + EXPECT_TRUE(PairsUtil::marshalPairs(pairs1, buffer.data(), buffer.size())); + auto pairs2 = PairsUtil::toPairs(std::string_view(buffer.data(), buffer.size())); + EXPECT_EQ(pairs2.size(), pairs1.size()); + EXPECT_EQ(pairs2[0].first, pairs1[0].first); + EXPECT_EQ(pairs2[0].second, pairs1[0].second); +} + +} // namespace proxy_wasm diff --git a/test/runtime_test.cc b/test/runtime_test.cc index 11774f671..2e9080978 100644 --- a/test/runtime_test.cc +++ b/test/runtime_test.cc @@ -14,14 +14,12 @@ #include "gtest/gtest.h" -#include -#include #include -#include #include -#include +#include #include "include/proxy-wasm/context.h" +#include "include/proxy-wasm/limits.h" #include "include/proxy-wasm/wasm.h" #include "test/utility.h" @@ -29,175 +27,221 @@ namespace proxy_wasm { namespace { -auto test_values = testing::ValuesIn(getRuntimes()); +INSTANTIATE_TEST_SUITE_P(WasmEngines, TestVm, testing::ValuesIn(getWasmEngines()), + [](const testing::TestParamInfo &info) { + return info.param; + }); -INSTANTIATE_TEST_SUITE_P(Runtimes, TestVM, test_values); +TEST_P(TestVm, BadSignature) { + auto source = readTestWasmFile("clock.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); -TEST_P(TestVM, Basic) { - if (runtime_ == "wamr") { - EXPECT_EQ(vm_->cloneable(), proxy_wasm::Cloneable::NotCloneable); - } else if (runtime_ == "wasmtime" || runtime_ == "v8") { - EXPECT_EQ(vm_->cloneable(), proxy_wasm::Cloneable::CompiledBytecode); - } else if (runtime_ == "wavm") { - EXPECT_EQ(vm_->cloneable(), proxy_wasm::Cloneable::InstantiatedModule); - } else { - FAIL(); - } - EXPECT_EQ(vm_->runtime(), runtime_); + WasmCallVoid<0> non_existent; + wasm.wasm_vm()->getFunction("non_existent", &non_existent); + EXPECT_TRUE(non_existent == nullptr); + + WasmCallWord<2> bad_signature_run; + wasm.wasm_vm()->getFunction("run", &bad_signature_run); + EXPECT_TRUE(bad_signature_run == nullptr); + + WasmCallVoid<0> run; + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); } -TEST_P(TestVM, Memory) { - initialize("abi_export.wasm"); - ASSERT_TRUE(vm_->load(source_, {}, {})); - ASSERT_TRUE(vm_->link("")); - - Word word; - ASSERT_TRUE(vm_->setWord(0x2000, Word(100))); - ASSERT_TRUE(vm_->getWord(0x2000, &word)); - ASSERT_EQ(100, word.u64_); - - int32_t data[2] = {-1, 200}; - ASSERT_TRUE(vm_->setMemory(0x200, sizeof(int32_t) * 2, static_cast(data))); - ASSERT_TRUE(vm_->getWord(0x200, &word)); - ASSERT_EQ(-1, static_cast(word.u64_)); - ASSERT_TRUE(vm_->getWord(0x204, &word)); - ASSERT_EQ(200, static_cast(word.u64_)); +TEST_P(TestVm, StraceLogLevel) { + auto source = readTestWasmFile("clock.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + WasmCallVoid<0> run; + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); + + auto *host = dynamic_cast(wasm.wasm_vm()->integration().get()); + host->setLogLevel(LogLevel::info); + run(wasm.vm_context()); + EXPECT_TRUE(host->isTraceLogEmpty()); + + host->setLogLevel(LogLevel::trace); + run(wasm.vm_context()); + EXPECT_TRUE(host->isTraceLogged("[host->vm] run()")); + EXPECT_TRUE(host->isTraceLogged("[vm->host] wasi_snapshot_preview1.clock_time_get(1, 1, ")); + EXPECT_TRUE(host->isTraceLogged("[vm<-host] wasi_snapshot_preview1.clock_time_get return: 0")); + EXPECT_TRUE(host->isTraceLogged("[host<-vm] run return: void")); } -TEST_P(TestVM, Clone) { - if (vm_->cloneable() == proxy_wasm::Cloneable::NotCloneable) { +TEST_P(TestVm, TerminateExecution) { + // TODO(chaoqin-li1123): implement execution termination for other runtime. + if (engine_ != "v8") { return; } - initialize("abi_export.wasm"); - ASSERT_TRUE(vm_->load(source_, {}, {})); - ASSERT_TRUE(vm_->link("")); - const auto address = 0x2000; - Word word; - { - auto clone = vm_->clone(); - ASSERT_TRUE(clone != nullptr); - ASSERT_NE(vm_, clone); - if (clone->cloneable() != proxy_wasm::Cloneable::InstantiatedModule) { - ASSERT_TRUE(clone->link("")); - } - - ASSERT_TRUE(clone->setWord(address, Word(100))); - ASSERT_TRUE(clone->getWord(address, &word)); - ASSERT_EQ(100, word.u64_); - } - - // check memory arrays are not overrapped - ASSERT_TRUE(vm_->getWord(address, &word)); - ASSERT_NE(100, word.u64_); + auto source = readTestWasmFile("resource_limits.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + std::thread terminate([&]() { + std::this_thread::sleep_for(std::chrono::seconds(1)); + wasm.wasm_vm()->terminate(); + }); + + WasmCallVoid<0> infinite_loop; + wasm.wasm_vm()->getFunction("infinite_loop", &infinite_loop); + ASSERT_TRUE(infinite_loop != nullptr); + infinite_loop(wasm.vm_context()); + + terminate.join(); + + // Check integration logs. + auto *host = dynamic_cast(wasm.wasm_vm()->integration().get()); + EXPECT_TRUE(host->isErrorLogged("Function: infinite_loop failed")); + EXPECT_TRUE(host->isErrorLogged("TerminationException")); } -class TestContext : public ContextBase { -public: - TestContext(){}; - void increment() { counter++; } - int64_t counter = 0; -}; +TEST_P(TestVm, WasmMemoryLimit) { + // TODO(PiotrSikora): enforce memory limits in other engines. + if (engine_ != "v8") { + return; + } + auto source = readTestWasmFile("resource_limits.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + WasmCallVoid<0> infinite_memory; + wasm.wasm_vm()->getFunction("infinite_memory", &infinite_memory); + ASSERT_TRUE(infinite_memory != nullptr); + infinite_memory(wasm.vm_context()); + + EXPECT_GE(wasm.wasm_vm()->getMemorySize(), PROXY_WASM_HOST_MAX_WASM_MEMORY_SIZE_BYTES * 0.95); + EXPECT_LE(wasm.wasm_vm()->getMemorySize(), PROXY_WASM_HOST_MAX_WASM_MEMORY_SIZE_BYTES); + + // Check integration logs. + auto *host = dynamic_cast(wasm.wasm_vm()->integration().get()); + EXPECT_TRUE(host->isErrorLogged("Function: infinite_memory failed")); + // Trap message + EXPECT_TRUE(host->isErrorLogged("unreachable")); + // Backtrace + if (engine_ == "v8") { + EXPECT_TRUE(host->isErrorLogged("Proxy-Wasm plugin in-VM backtrace:")); + EXPECT_TRUE(host->isErrorLogged("rg_oom")); + EXPECT_TRUE(host->isErrorLogged(" - alloc::alloc::handle_alloc_error")); + } +} -void nopCallback(void *raw_context) {} +TEST_P(TestVm, Trap) { + auto source = readTestWasmFile("trap.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); -void callback(void *) { - TestContext *context = static_cast(current_context_); - context->increment(); + WasmCallVoid<0> trigger; + wasm.wasm_vm()->getFunction("trigger", &trigger); + ASSERT_TRUE(trigger != nullptr); + trigger(wasm.vm_context()); + + // Check integration logs. + auto *host = dynamic_cast(wasm.wasm_vm()->integration().get()); + EXPECT_TRUE(host->isErrorLogged("Function: trigger failed")); + // Trap message + EXPECT_TRUE(host->isErrorLogged("unreachable")); + // Backtrace + if (engine_ == "v8") { + EXPECT_TRUE(host->isErrorLogged("Proxy-Wasm plugin in-VM backtrace:")); + EXPECT_TRUE(host->isErrorLogged(" - std::panicking::begin_panic")); + EXPECT_TRUE(host->isErrorLogged(" - trigger")); + } } -Word callback2(void *, Word val) { return val + 100; } +TEST_P(TestVm, Trap2) { + auto source = readTestWasmFile("trap.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); -TEST_P(TestVM, StraceLogLevel) { - if (runtime_ == "wavm") { - // TODO(mathetake): strace is yet to be implemented for WAVM. - // See https://github.com/proxy-wasm/proxy-wasm-cpp-host/issues/120. - return; + WasmCallWord<1> trigger2; + wasm.wasm_vm()->getFunction("trigger2", &trigger2); + ASSERT_TRUE(trigger2 != nullptr); + trigger2(wasm.vm_context(), 0); + + // Check integration logs. + auto *host = dynamic_cast(wasm.wasm_vm()->integration().get()); + EXPECT_TRUE(host->isErrorLogged("Function: trigger2 failed")); + // Trap message + EXPECT_TRUE(host->isErrorLogged("unreachable")); + // Backtrace + if (engine_ == "v8") { + EXPECT_TRUE(host->isErrorLogged("Proxy-Wasm plugin in-VM backtrace:")); + EXPECT_TRUE(host->isErrorLogged(" - std::panicking::begin_panic")); + EXPECT_TRUE(host->isErrorLogged(" - trigger2")); } - initialize("callback.wasm"); - ASSERT_TRUE(vm_->load(source_, {}, {})); - vm_->registerCallback("env", "callback", &nopCallback, - &ConvertFunctionWordToUint32::convertFunctionWordToUint32); - vm_->registerCallback( - "env", "callback2", &callback2, - &ConvertFunctionWordToUint32::convertFunctionWordToUint32); - ASSERT_TRUE(vm_->link("")); +} - WasmCallVoid<0> run; - vm_->getFunction("run", &run); +class TestCounterContext : public TestContext { +public: + TestCounterContext(WasmBase *wasm) : TestContext(wasm) {} + + void increment() { counter++; } + size_t getCount() { return counter; } + +private: + size_t counter = 0; +}; + +class TestCounterWasm : public TestWasm { +public: + TestCounterWasm(std::unique_ptr wasm_vm) : TestWasm(std::move(wasm_vm)) {} - run(nullptr); - // no trace message found since DummyIntegration's log_level_ defaults to LogLevel::info - EXPECT_EQ(integration_->trace_message_, ""); + ContextBase *createVmContext() override { return new TestCounterContext(this); }; +}; - integration_->log_level_ = LogLevel::trace; - run(nullptr); - EXPECT_NE(integration_->trace_message_, ""); +void callback() { + auto *context = dynamic_cast(contextOrEffectiveContext()); + context->increment(); } -TEST_P(TestVM, Callback) { - initialize("callback.wasm"); - ASSERT_TRUE(vm_->load(source_, {}, {})); +Word callback2(Word val) { return val + 100; } - TestContext context; - current_context_ = &context; +TEST_P(TestVm, Callback) { + auto source = readTestWasmFile("callback.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestCounterWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); - vm_->registerCallback( + wasm.wasm_vm()->registerCallback( "env", "callback", &callback, &ConvertFunctionWordToUint32::convertFunctionWordToUint32); - vm_->registerCallback( + wasm.wasm_vm()->registerCallback( "env", "callback2", &callback2, &ConvertFunctionWordToUint32::convertFunctionWordToUint32); - ASSERT_TRUE(vm_->link("")); + ASSERT_TRUE(wasm.initialize()); WasmCallVoid<0> run; - vm_->getFunction("run", &run); - EXPECT_TRUE(run != nullptr); - for (auto i = 0; i < 100; i++) { - run(current_context_); + wasm.wasm_vm()->getFunction("run", &run); + ASSERT_TRUE(run != nullptr); + for (auto i = 0; i < 5; i++) { + run(wasm.vm_context()); } - ASSERT_EQ(context.counter, 100); + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_EQ(context->getCount(), 5); WasmCallWord<1> run2; - vm_->getFunction("run2", &run2); - Word res = run2(current_context_, Word{0}); - ASSERT_EQ(res.u32(), 100100); // 10000 (global) + 100(in callback) -} - -TEST_P(TestVM, Trap) { - initialize("trap.wasm"); - ASSERT_TRUE(vm_->load(source_, {}, {})); - ASSERT_TRUE(vm_->link("")); - TestContext context; - current_context_ = &context; - WasmCallVoid<0> trigger; - vm_->getFunction("trigger", &trigger); - EXPECT_TRUE(trigger != nullptr); - trigger(current_context_); - std::string exp_message = "Function: trigger failed"; - ASSERT_TRUE(integration_->error_message_.find(exp_message) != std::string::npos); -} - -TEST_P(TestVM, Trap2) { - if (runtime_ == "wavm") { - // TODO(mathetake): Somehow WAVM exits with 'munmap_chunk(): invalid pointer' on unidentified - // build condition in 'libstdc++ abi::__cxa_demangle' originally from - // WAVM::Runtime::describeCallStack. Needs further investigation. - return; - } - initialize("trap.wasm"); - ASSERT_TRUE(vm_->load(source_, {}, {})); - ASSERT_TRUE(vm_->link("")); - TestContext context; - current_context_ = &context; - WasmCallWord<1> trigger2; - vm_->getFunction("trigger2", &trigger2); - EXPECT_TRUE(trigger2 != nullptr); - trigger2(current_context_, 0); - std::string exp_message = "Function: trigger2 failed"; - ASSERT_TRUE(integration_->error_message_.find(exp_message) != std::string::npos); + wasm.wasm_vm()->getFunction("run2", &run2); + ASSERT_TRUE(run2 != nullptr); + Word res = run2(wasm.vm_context(), Word{0}); + EXPECT_EQ(res.u32(), 100100); // 10000 (global) + 100 (in callback) } } // namespace diff --git a/test/security_test.cc b/test/security_test.cc new file mode 100644 index 000000000..a077e4ae6 --- /dev/null +++ b/test/security_test.cc @@ -0,0 +1,106 @@ +// Copyright 2022 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. + +#include "gtest/gtest.h" + +#include +#include + +#include "include/proxy-wasm/context.h" +#include "include/proxy-wasm/wasm.h" + +#include "test/utility.h" + +namespace proxy_wasm { + +INSTANTIATE_TEST_SUITE_P(WasmEngines, TestVm, testing::ValuesIn(getWasmEngines()), + [](const testing::TestParamInfo &info) { + return info.param; + }); + +TEST_P(TestVm, MallocNoHostcalls) { + if (engine_ != "v8") { + return; + } + auto source = readTestWasmFile("bad_malloc.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + uint64_t ptr = 0; + void *result = wasm.allocMemory(0x1000, &ptr); + EXPECT_NE(result, nullptr); + EXPECT_FALSE(wasm.isFailed()); + + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogEmpty()); + // Check integration logs. + auto *integration = dynamic_cast(wasm.wasm_vm()->integration().get()); + EXPECT_FALSE(integration->isErrorLogged("Function: proxy_on_memory_allocate failed")); + EXPECT_FALSE(integration->isErrorLogged("restricted_callback")); +} + +TEST_P(TestVm, MallocWithLog) { + if (engine_ != "v8") { + return; + } + auto source = readTestWasmFile("bad_malloc.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + uint64_t ptr = 0; + // 0xAAAA => hostcall to proxy_log (allowed). + void *result = wasm.allocMemory(0xAAAA, &ptr); + EXPECT_NE(result, nullptr); + EXPECT_FALSE(wasm.isFailed()); + + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogged("this is fine")); + // Check integration logs. + auto *integration = dynamic_cast(wasm.wasm_vm()->integration().get()); + EXPECT_FALSE(integration->isErrorLogged("Function: proxy_on_memory_allocate failed")); + EXPECT_FALSE(integration->isErrorLogged("restricted_callback")); +} + +TEST_P(TestVm, MallocWithHostcall) { + if (engine_ != "v8") { + return; + } + auto source = readTestWasmFile("bad_malloc.wasm"); + ASSERT_FALSE(source.empty()); + auto wasm = TestWasm(std::move(vm_)); + ASSERT_TRUE(wasm.load(source, false)); + ASSERT_TRUE(wasm.initialize()); + + uint64_t ptr = 0; + // 0xBBBB => hostcall to proxy_done (not allowed). + void *result = wasm.allocMemory(0xBBBB, &ptr); + EXPECT_EQ(result, nullptr); + EXPECT_TRUE(wasm.isFailed()); + + // Check application logs. + auto *context = dynamic_cast(wasm.vm_context()); + EXPECT_TRUE(context->isLogEmpty()); + // Check integration logs. + auto *integration = dynamic_cast(wasm.wasm_vm()->integration().get()); + EXPECT_TRUE(integration->isErrorLogged("Function: proxy_on_memory_allocate failed")); + EXPECT_TRUE(integration->isErrorLogged("restricted_callback")); +} + +} // namespace proxy_wasm diff --git a/test/shared_data_test.cc b/test/shared_data_test.cc index 0c3d2dec8..89a964c33 100644 --- a/test/shared_data_test.cc +++ b/test/shared_data_test.cc @@ -24,10 +24,24 @@ namespace proxy_wasm { TEST(SharedData, SingleThread) { SharedData shared_data(false); + std::string_view vm_id = "id"; + + // Validate we get an 'Ok' response when fetching keys before anything + // is initialized. + std::vector keys; + EXPECT_EQ(WasmResult::Ok, shared_data.keys(vm_id, &keys)); + EXPECT_EQ(0, keys.size()); + + // Validate that we clear the result set + std::vector nonEmptyKeys(2); + nonEmptyKeys[0] = "valueA"; + nonEmptyKeys[1] = "valueB"; + EXPECT_EQ(WasmResult::Ok, shared_data.keys(vm_id, &nonEmptyKeys)); + EXPECT_EQ(0, nonEmptyKeys.size()); + std::pair result; EXPECT_EQ(WasmResult::NotFound, shared_data.get("non-exist", "non-exists", &result)); - std::string_view vm_id = "id"; std::string_view key = "key"; std::string_view value = "1"; EXPECT_EQ(WasmResult::Ok, shared_data.set(vm_id, key, value, 0)); @@ -44,6 +58,31 @@ TEST(SharedData, SingleThread) { EXPECT_EQ(WasmResult::Ok, shared_data.get(vm_id, key, &result)); EXPECT_EQ(value, result.first); EXPECT_EQ(result.second, 3); + + EXPECT_EQ(WasmResult::Ok, shared_data.keys(vm_id, &keys)); + EXPECT_EQ(1, keys.size()); + EXPECT_EQ(key, keys[0]); + + keys.clear(); + EXPECT_EQ(WasmResult::CasMismatch, shared_data.remove(vm_id, key, 911, nullptr)); + EXPECT_EQ(WasmResult::Ok, shared_data.keys(vm_id, &keys)); + EXPECT_EQ(1, keys.size()); + + EXPECT_EQ(WasmResult::Ok, shared_data.remove(vm_id, key, 0, nullptr)); + EXPECT_EQ(WasmResult::NotFound, shared_data.get(vm_id, key, &result)); + + EXPECT_EQ(WasmResult::NotFound, shared_data.remove(vm_id, "non-existent_key", 0, nullptr)); + + EXPECT_EQ(WasmResult::Ok, shared_data.set(vm_id, key, value, 0)); + EXPECT_EQ(WasmResult::Ok, shared_data.set(vm_id, key, value, 0)); + EXPECT_EQ(WasmResult::Ok, shared_data.get(vm_id, key, &result)); + + uint32_t expectedCasValue = result.second; + + std::pair removeResult; + EXPECT_EQ(WasmResult::Ok, shared_data.remove(vm_id, key, 0, &removeResult)); + EXPECT_EQ(value, removeResult.first); + EXPECT_EQ(removeResult.second, expectedCasValue); } void incrementData(SharedData *shared_data, std::string_view vm_id, std::string_view key) { @@ -59,7 +98,6 @@ void incrementData(SharedData *shared_data, std::string_view vm_id, std::string_ break; } } - return; } TEST(SharedData, Concurrent) { diff --git a/test/shared_queue_test.cc b/test/shared_queue_test.cc index 84e6d763e..6d08316a4 100644 --- a/test/shared_queue_test.cc +++ b/test/shared_queue_test.cc @@ -105,7 +105,8 @@ TEST(SharedQueue, Concurrent) { enqueue_second.join(); EXPECT_EQ(queued_count, 200); - size_t first_cnt = 0, second_cnt = 0; + size_t first_cnt = 0; + size_t second_cnt = 0; std::thread dequeue_first(dequeueData, &shared_queue, token, &first_cnt); std::thread dequeue_second(dequeueData, &shared_queue, token, &second_cnt); dequeue_first.join(); @@ -115,8 +116,8 @@ TEST(SharedQueue, Concurrent) { TEST(SharedQueue, DeleteByVmId) { SharedQueue shared_queue(false); - auto vm_id_1 = "id_1"; - auto vm_id_2 = "id_2"; + const auto *vm_id_1 = "id_1"; + const auto *vm_id_2 = "id_2"; std::string_view vm_key = "vm_key"; uint32_t context_id = 1; auto queue_num_per_vm = 3; diff --git a/test/stop_iteration_test.cc b/test/stop_iteration_test.cc new file mode 100644 index 000000000..9ff443f24 --- /dev/null +++ b/test/stop_iteration_test.cc @@ -0,0 +1,81 @@ +// Copyright 2025 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. + +#include "gtest/gtest.h" +#include "include/proxy-wasm/wasm.h" +#include "test/utility.h" + +namespace proxy_wasm { + +INSTANTIATE_TEST_SUITE_P(WasmEngines, TestVm, testing::ValuesIn(getWasmEngines()), + [](const testing::TestParamInfo &info) { + return info.param; + }); + +// TestVm is parameterized for each engine and creates a VM on construction. +TEST_P(TestVm, AllowOnHeadersStopIteration) { + // Read the wasm source. + auto source = readTestWasmFile("stop_iteration.wasm"); + ASSERT_FALSE(source.empty()); + + // Create a WasmBase and load the plugin. + auto wasm = std::make_shared(std::move(vm_)); + ASSERT_TRUE(wasm->load(source, /*allow_precompiled=*/false)); + ASSERT_TRUE(wasm->initialize()); + + // Create a plugin. + const auto plugin = std::make_shared( + /*name=*/"test", /*root_id=*/"", /*vm_id=*/"", + /*engine=*/wasm->wasm_vm()->getEngineName(), /*plugin_config=*/"", + /*fail_open=*/false, /*key=*/""); + + // Create root context, call onStart() and onConfigure() + ContextBase *root_context = wasm->start(plugin); + ASSERT_TRUE(root_context != nullptr); + ASSERT_TRUE(wasm->configure(root_context, plugin)); + + auto wasm_handle = std::make_shared(wasm); + auto plugin_handle = std::make_shared(wasm_handle, plugin); + + // By default, stream context onRequestHeaders and onResponseHeaders + // translates FilterHeadersStatus::StopIteration to + // FilterHeadersStatus::StopAllIterationAndWatermark. + { + auto stream_context = TestContext(wasm.get(), root_context->id(), plugin_handle); + stream_context.onCreate(); + EXPECT_EQ(stream_context.onRequestHeaders(/*headers=*/0, /*end_of_stream=*/false), + FilterHeadersStatus::StopAllIterationAndWatermark); + EXPECT_EQ(stream_context.onResponseHeaders(/*headers=*/0, /*end_of_stream=*/false), + FilterHeadersStatus::StopAllIterationAndWatermark); + stream_context.onDone(); + stream_context.onDelete(); + } + ASSERT_FALSE(wasm->isFailed()); + + // Create a stream context that propagates FilterHeadersStatus::StopIteration. + { + auto stream_context = TestContext(wasm.get(), root_context->id(), plugin_handle); + stream_context.set_allow_on_headers_stop_iteration(true); + stream_context.onCreate(); + EXPECT_EQ(stream_context.onRequestHeaders(/*headers=*/0, /*end_of_stream=*/false), + FilterHeadersStatus::StopIteration); + EXPECT_EQ(stream_context.onResponseHeaders(/*headers=*/0, /*end_of_stream=*/false), + FilterHeadersStatus::StopIteration); + stream_context.onDone(); + stream_context.onDelete(); + } + ASSERT_FALSE(wasm->isFailed()); +} + +} // namespace proxy_wasm diff --git a/test/test_data/BUILD b/test/test_data/BUILD index c6ed213e3..e5ecd439e 100644 --- a/test/test_data/BUILD +++ b/test/test_data/BUILD @@ -1,4 +1,19 @@ +# Copyright 2022 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("@proxy_wasm_cpp_host//bazel:wasm.bzl", "wasm_rust_binary") +load("@proxy_wasm_cpp_sdk//bazel:defs.bzl", "proxy_wasm_cc_binary") licenses(["notice"]) # Apache 2 @@ -27,6 +42,11 @@ wasm_rust_binary( ], ) +wasm_rust_binary( + name = "bad_malloc.wasm", + srcs = ["bad_malloc.rs"], +) + wasm_rust_binary( name = "callback.wasm", srcs = ["callback.rs"], @@ -37,6 +57,11 @@ wasm_rust_binary( srcs = ["trap.rs"], ) +wasm_rust_binary( + name = "resource_limits.wasm", + srcs = ["resource_limits.rs"], +) + wasm_rust_binary( name = "env.wasm", srcs = ["env.rs"], @@ -48,3 +73,24 @@ wasm_rust_binary( srcs = ["clock.rs"], wasi = True, ) + +wasm_rust_binary( + name = "random.wasm", + srcs = ["random.rs"], + wasi = True, +) + +proxy_wasm_cc_binary( + name = "canary_check.wasm", + srcs = ["canary_check.cc"], +) + +proxy_wasm_cc_binary( + name = "http_logging.wasm", + srcs = ["http_logging.cc"], +) + +proxy_wasm_cc_binary( + name = "stop_iteration.wasm", + srcs = ["stop_iteration.cc"], +) diff --git a/test/test_data/abi_export.rs b/test/test_data/abi_export.rs index f4a42f25f..64e47de65 100644 --- a/test/test_data/abi_export.rs +++ b/test/test_data/abi_export.rs @@ -14,3 +14,21 @@ #[no_mangle] pub extern "C" fn proxy_abi_version_0_2_0() {} + +#[no_mangle] +pub extern "C" fn proxy_on_vm_start(_: u32, _: usize) -> bool { + true +} + +#[no_mangle] +pub extern "C" fn proxy_on_context_create(_: u32, _: u32) {} + +#[no_mangle] +pub extern "C" fn proxy_on_memory_allocate(size: usize) -> *mut u8 { + let mut vec: Vec = Vec::with_capacity(size); + unsafe { + vec.set_len(size); + } + let slice = vec.into_boxed_slice(); + Box::into_raw(slice) as *mut u8 +} diff --git a/test/test_data/bad_malloc.rs b/test/test_data/bad_malloc.rs new file mode 100644 index 000000000..43c60da02 --- /dev/null +++ b/test/test_data/bad_malloc.rs @@ -0,0 +1,47 @@ +// Copyright 2022 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 std::mem::MaybeUninit; + +extern "C" { + fn proxy_log(level: u32, message_data: *const u8, message_size: usize) -> u32; + fn proxy_done() -> u32; +} + +#[no_mangle] +pub extern "C" fn proxy_abi_version_0_2_0() {} + +#[no_mangle] +pub extern "C" fn proxy_on_memory_allocate(size: usize) -> *mut u8 { + let mut vec: Vec> = Vec::with_capacity(size); + unsafe { + vec.set_len(size); + } + match size { + 0xAAAA => { + let message = "this is fine"; + unsafe { + proxy_log(0, message.as_ptr(), message.len()); + } + } + 0xBBBB => { + unsafe { + proxy_done(); + } + } + _ => {} + } + let slice = vec.into_boxed_slice(); + Box::into_raw(slice) as *mut u8 +} diff --git a/test/test_data/callback.rs b/test/test_data/callback.rs index 0c142a8ec..cab0141c4 100644 --- a/test/test_data/callback.rs +++ b/test/test_data/callback.rs @@ -12,6 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#[no_mangle] +pub extern "C" fn proxy_abi_version_0_2_0() {} + +#[no_mangle] +pub extern "C" fn proxy_on_memory_allocate(_: usize) -> *mut u8 { + std::ptr::null_mut() +} + #[no_mangle] pub extern "C" fn run() { unsafe { @@ -32,4 +40,3 @@ extern "C" { fn callback(); fn callback2(val: i32) -> i32; } - diff --git a/test/test_data/canary_check.cc b/test/test_data/canary_check.cc new file mode 100644 index 000000000..38cf8b410 --- /dev/null +++ b/test/test_data/canary_check.cc @@ -0,0 +1,52 @@ +// Copyright 2021 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. + +#include +#include +#include + +#include "proxy_wasm_intrinsics.h" + +class CanaryCheckRootContext1 : public RootContext { +public: + explicit CanaryCheckRootContext1(uint32_t id, std::string_view root_id) + : RootContext(id, root_id) {} + bool onConfigure(size_t s) override { + LOG_TRACE("onConfigure: root_id_1"); + return s != 0; + } +}; + +class CanaryCheckContext : public Context { +public: + explicit CanaryCheckContext(uint32_t id, RootContext *root) : Context(id, root) {} +}; + +class CanaryCheckRootContext2 : public RootContext { +public: + explicit CanaryCheckRootContext2(uint32_t id, std::string_view root_id) + : RootContext(id, root_id) {} + bool onConfigure(size_t s) override { + LOG_TRACE("onConfigure: root_id_2"); + return s != 0; + } +}; + +static RegisterContextFactory register_CanaryCheckContext1(CONTEXT_FACTORY(CanaryCheckContext), + ROOT_FACTORY(CanaryCheckRootContext1), + "root_id_1"); + +static RegisterContextFactory register_CanaryCheckContext2(CONTEXT_FACTORY(CanaryCheckContext), + ROOT_FACTORY(CanaryCheckRootContext2), + "root_id_2"); diff --git a/test/test_data/clock.rs b/test/test_data/clock.rs index 480a2b1bd..e2697a949 100644 --- a/test/test_data/clock.rs +++ b/test/test_data/clock.rs @@ -14,6 +14,14 @@ use std::time::{Instant, SystemTime}; +#[no_mangle] +pub extern "C" fn proxy_abi_version_0_2_0() {} + +#[no_mangle] +pub extern "C" fn proxy_on_memory_allocate(_: usize) -> *mut u8 { + std::ptr::null_mut() +} + #[no_mangle] pub extern "C" fn run() { println!("monotonic: {:?}", Instant::now()); diff --git a/test/test_data/env.rs b/test/test_data/env.rs index 59bf2cc72..63d345ee1 100644 --- a/test/test_data/env.rs +++ b/test/test_data/env.rs @@ -13,14 +13,26 @@ // limitations under the License. extern "C" { - fn __wasilibc_initialize_environ(); + fn __wasm_call_ctors(); } #[no_mangle] -pub extern "C" fn run() { +pub extern "C" fn _initialize() { unsafe { - __wasilibc_initialize_environ(); + __wasm_call_ctors(); } +} + +#[no_mangle] +pub extern "C" fn proxy_abi_version_0_2_0() {} + +#[no_mangle] +pub extern "C" fn proxy_on_memory_allocate(_: usize) -> *mut u8 { + std::ptr::null_mut() +} + +#[no_mangle] +pub extern "C" fn run() { for (key, value) in std::env::vars() { println!("{}: {}\n", key, value); } diff --git a/test/test_data/http_logging.cc b/test/test_data/http_logging.cc new file mode 100644 index 000000000..e25b410c2 --- /dev/null +++ b/test/test_data/http_logging.cc @@ -0,0 +1,37 @@ +// Copyright 2023 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. + +#include "proxy_wasm_intrinsics.h" + +class LoggingContext : public Context { +public: + explicit LoggingContext(uint32_t id, RootContext *root) : Context(id, root) {} + + void onCreate() override { LOG_INFO("onCreate called"); } + void onDelete() override { LOG_INFO("onDelete called"); } + void onDone() override { LOG_INFO("onDone called"); } + + FilterHeadersStatus onRequestHeaders(uint32_t headers, bool end_of_stream) override { + LOG_INFO("onRequestHeaders called"); + return FilterHeadersStatus::Continue; + } + + FilterHeadersStatus onResponseHeaders(uint32_t headers, bool end_of_stream) override { + LOG_INFO("onResponseHeaders called"); + return FilterHeadersStatus::Continue; + } +}; + +static RegisterContextFactory register_StaticContext(CONTEXT_FACTORY(LoggingContext), + ROOT_FACTORY(RootContext)); diff --git a/test/test_data/random.rs b/test/test_data/random.rs new file mode 100644 index 000000000..271434bb7 --- /dev/null +++ b/test/test_data/random.rs @@ -0,0 +1,38 @@ +// Copyright 2022 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. + +#[no_mangle] +pub extern "C" fn proxy_abi_version_0_2_0() {} + +#[no_mangle] +pub extern "C" fn proxy_on_memory_allocate(_: usize) -> *mut u8 { + std::ptr::null_mut() +} + +// TODO(PiotrSikora): switch to "getrandom" crate. +pub mod wasi_snapshot_preview1 { + #[link(wasm_import_module = "wasi_snapshot_preview1")] + extern "C" { + pub fn random_get(buf: *mut u8, buf_len: usize) -> u16; + } +} + +#[no_mangle] +pub extern "C" fn run(size: usize) { + let mut buf: Vec = Vec::with_capacity(size); + match unsafe { wasi_snapshot_preview1::random_get(buf.as_mut_ptr(), size) } { + 0 => println!("random_get({}) succeeded.", size), + _ => println!("random_get({}) failed.", size), + } +} diff --git a/test/test_data/resource_limits.rs b/test/test_data/resource_limits.rs new file mode 100644 index 000000000..4b1d2789e --- /dev/null +++ b/test/test_data/resource_limits.rs @@ -0,0 +1,37 @@ +// Copyright 2022 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. + +#[no_mangle] +pub extern "C" fn proxy_abi_version_0_2_0() {} + +#[no_mangle] +pub extern "C" fn proxy_on_memory_allocate(_: usize) -> *mut u8 { + std::ptr::null_mut() +} + +#[no_mangle] +pub extern "C" fn infinite_loop() { + let mut _count: u64 = 0; + loop { + _count += 1; + } +} + +#[no_mangle] +pub extern "C" fn infinite_memory() { + let mut vec = Vec::new(); + loop { + vec.push(Vec::::with_capacity(16384)); + } +} diff --git a/test/test_data/stop_iteration.cc b/test/test_data/stop_iteration.cc new file mode 100644 index 000000000..55594285f --- /dev/null +++ b/test/test_data/stop_iteration.cc @@ -0,0 +1,31 @@ +// Copyright 2025 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. + +#include "proxy_wasm_intrinsics.h" + +class StopIterationContext : public Context { +public: + explicit StopIterationContext(uint32_t id, RootContext *root) : Context(id, root) {} + + FilterHeadersStatus onRequestHeaders(uint32_t headers, bool end_of_stream) override { + return FilterHeadersStatus::StopIteration; + } + + FilterHeadersStatus onResponseHeaders(uint32_t headers, bool end_of_stream) override { + return FilterHeadersStatus::StopIteration; + } +}; + +static RegisterContextFactory register_StaticContext(CONTEXT_FACTORY(StopIterationContext), + ROOT_FACTORY(RootContext)); diff --git a/test/test_data/trap.rs b/test/test_data/trap.rs index fe6f71f62..467397206 100644 --- a/test/test_data/trap.rs +++ b/test/test_data/trap.rs @@ -12,6 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. +#[no_mangle] +pub extern "C" fn proxy_abi_version_0_2_0() {} + +#[no_mangle] +pub extern "C" fn proxy_on_memory_allocate(_: usize) -> *mut u8 { + std::ptr::null_mut() +} + #[no_mangle] pub extern "C" fn trigger() { one(); diff --git a/test/utility.cc b/test/utility.cc index e833f22e5..7bdf9d2ad 100644 --- a/test/utility.cc +++ b/test/utility.cc @@ -16,27 +16,28 @@ namespace proxy_wasm { -std::vector getRuntimes() { - std::vector runtimes = { -#if defined(PROXY_WASM_HAS_RUNTIME_V8) - "v8", +std::string TestContext::global_log_; + +std::vector getWasmEngines() { + std::vector engines = { +#if defined(PROXY_WASM_HOST_ENGINE_V8) + "v8", #endif -#if defined(PROXY_WASM_HAS_RUNTIME_WAVM) - "wavm", +#if defined(PROXY_WASM_HOST_ENGINE_WAMR) + "wamr", #endif -#if defined(PROXY_WASM_HAS_RUNTIME_WASMTIME) - "wasmtime", +#if defined(PROXY_WASM_HOST_ENGINE_WASMEDGE) + "wasmedge", #endif -#if defined(PROXY_WASM_HAS_RUNTIME_WAMR) - "wamr", +#if defined(PROXY_WASM_HOST_ENGINE_WASMTIME) + "wasmtime", #endif - "" - }; - runtimes.pop_back(); - return runtimes; + ""}; + engines.pop_back(); + return engines; } -std::string readTestWasmFile(std::string filename) { +std::string readTestWasmFile(const std::string &filename) { auto path = "test/test_data/" + filename; std::ifstream file(path, std::ios::binary); EXPECT_FALSE(file.fail()) << "failed to open: " << path; diff --git a/test/utility.h b/test/utility.h index 07094b893..0eb743037 100644 --- a/test/utility.h +++ b/test/utility.h @@ -18,86 +18,181 @@ #include #include #include +#include #include #include "include/proxy-wasm/context.h" #include "include/proxy-wasm/wasm.h" -#if defined(PROXY_WASM_HAS_RUNTIME_V8) +#if defined(PROXY_WASM_HOST_ENGINE_V8) #include "include/proxy-wasm/v8.h" #endif -#if defined(PROXY_WASM_HAS_RUNTIME_WAVM) -#include "include/proxy-wasm/wavm.h" -#endif -#if defined(PROXY_WASM_HAS_RUNTIME_WASMTIME) +#if defined(PROXY_WASM_HOST_ENGINE_WASMTIME) #include "include/proxy-wasm/wasmtime.h" #endif -#if defined(PROXY_WASM_HAS_RUNTIME_WAMR) +#if defined(PROXY_WASM_HOST_ENGINE_WASMEDGE) +#include "include/proxy-wasm/wasmedge.h" +#endif +#if defined(PROXY_WASM_HOST_ENGINE_WAMR) #include "include/proxy-wasm/wamr.h" #endif namespace proxy_wasm { -std::vector getRuntimes(); -std::string readTestWasmFile(std::string filename); +std::vector getWasmEngines(); +std::string readTestWasmFile(const std::string &filename); + +class TestIntegration : public WasmVmIntegration { +public: + ~TestIntegration() override = default; + WasmVmIntegration *clone() override { return new TestIntegration{}; } + + void setLogLevel(LogLevel level) { log_level_ = level; } + + LogLevel getLogLevel() override { return log_level_; } -struct DummyIntegration : public WasmVmIntegration { - ~DummyIntegration() override{}; - WasmVmIntegration *clone() override { return new DummyIntegration{}; } void error(std::string_view message) override { std::cout << "ERROR from integration: " << message << std::endl; - error_message_ = message; + error_log_ += std::string(message) + "\n"; + } + + bool isErrorLogEmpty() { return error_log_.empty(); } + + bool isErrorLogged(std::string_view message) { + return error_log_.find(message) != std::string::npos; } + void trace(std::string_view message) override { std::cout << "TRACE from integration: " << message << std::endl; - trace_message_ = message; + trace_log_ += std::string(message) + "\n"; + } + + bool isTraceLogEmpty() { return trace_log_.empty(); } + + bool isTraceLogged(std::string_view message) { + return trace_log_.find(message) != std::string::npos; } - bool getNullVmFunction(std::string_view function_name, bool returns_word, int number_of_arguments, - NullPlugin *plugin, void *ptr_to_function_return) override { + + bool getNullVmFunction(std::string_view /*function_name*/, bool /*returns_word*/, + int /*number_of_arguments*/, NullPlugin * /*plugin*/, + void * /*ptr_to_function_return*/) override { return false; }; - LogLevel getLogLevel() override { return log_level_; } - std::string error_message_; - std::string trace_message_; - LogLevel log_level_ = LogLevel::info; +private: + std::string error_log_; + std::string trace_log_; + LogLevel log_level_ = LogLevel::trace; }; -class TestVM : public testing::TestWithParam { +class TestContext : public ContextBase { public: - std::unique_ptr vm_; + TestContext(WasmBase *wasm) : ContextBase(wasm) {} + TestContext(WasmBase *wasm, const std::shared_ptr &plugin) + : ContextBase(wasm, plugin) {} + TestContext(WasmBase *wasm, uint32_t parent_context_id, + std::shared_ptr &plugin_handle) + : ContextBase(wasm, parent_context_id, plugin_handle) {} + + WasmResult log(uint32_t /*log_level*/, std::string_view message) override { + auto new_log = std::string(message) + "\n"; + log_ += new_log; + global_log_ += new_log; + return WasmResult::Ok; + } + + WasmResult getProperty(std::string_view path, std::string *result) override { + if (path == "plugin_root_id") { + *result = root_id_; + return WasmResult::Ok; + } + return unimplemented(); + } + + bool isLogEmpty() { return log_.empty(); } + + bool isLogged(std::string_view message) { return log_.find(message) != std::string::npos; } - TestVM() : integration_(new DummyIntegration{}) { - runtime_ = GetParam(); - if (runtime_ == "") { - EXPECT_TRUE(false) << "runtime must not be empty"; -#if defined(PROXY_WASM_HAS_RUNTIME_V8) - } else if (runtime_ == "v8") { - vm_ = proxy_wasm::createV8Vm(); + static bool isGlobalLogged(std::string_view message) { + return global_log_.find(message) != std::string::npos; + } + + static void resetGlobalLog() { global_log_ = ""; } + + uint64_t getCurrentTimeNanoseconds() override { + return std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()) + .count(); + } + uint64_t getMonotonicTimeNanoseconds() override { + return std::chrono::duration_cast( + std::chrono::steady_clock::now().time_since_epoch()) + .count(); + } + + void set_allow_on_headers_stop_iteration(bool allow) { allow_on_headers_stop_iteration_ = allow; } + +private: + std::string log_; + static std::string global_log_; +}; + +class TestWasm : public WasmBase { +public: + TestWasm(std::unique_ptr wasm_vm, std::unordered_map envs = {}, + std::string_view vm_id = "", std::string_view vm_configuration = "", + std::string_view vm_key = "") + : WasmBase(std::move(wasm_vm), vm_id, vm_configuration, vm_key, std::move(envs), {}) {} + + TestWasm(const std::shared_ptr &base_wasm_handle, const WasmVmFactory &factory) + : WasmBase(base_wasm_handle, factory) {} + + ContextBase *createVmContext() override { return new TestContext(this); }; + + ContextBase *createRootContext(const std::shared_ptr &plugin) override { + return new TestContext(this, plugin); + } +}; + +class TestVm : public testing::TestWithParam { +public: + TestVm() { + engine_ = GetParam(); + vm_ = makeVm(engine_); + } + + static std::unique_ptr makeVm(const std::string &engine) { + std::unique_ptr vm; + if (engine.empty()) { + ADD_FAILURE() << "engine must not be empty"; +#if defined(PROXY_WASM_HOST_ENGINE_V8) + } else if (engine == "v8") { + vm = proxy_wasm::createV8Vm(); #endif -#if defined(PROXY_WASM_HAS_RUNTIME_WAVM) - } else if (runtime_ == "wavm") { - vm_ = proxy_wasm::createWavmVm(); +#if defined(PROXY_WASM_HOST_ENGINE_WASMTIME) + } else if (engine == "wasmtime") { + vm = proxy_wasm::createWasmtimeVm(); #endif -#if defined(PROXY_WASM_HAS_RUNTIME_WASMTIME) - } else if (runtime_ == "wasmtime") { - vm_ = proxy_wasm::createWasmtimeVm(); +#if defined(PROXY_WASM_HOST_ENGINE_WASMEDGE) + } else if (engine == "wasmedge") { + vm = proxy_wasm::createWasmEdgeVm(); #endif -#if defined(PROXY_WASM_HAS_RUNTIME_WAMR) - } else if (runtime_ == "wamr") { - vm_ = proxy_wasm::createWamrVm(); +#if defined(PROXY_WASM_HOST_ENGINE_WAMR) + } else if (engine == "wamr") { + vm = proxy_wasm::createWamrVm(); #endif } else { - EXPECT_TRUE(false) << "compiled without support for the requested \"" << runtime_ - << "\" runtime"; + ADD_FAILURE() << "compiled without support for the requested \"" << engine << "\" engine"; } - vm_->integration().reset(integration_); + vm->integration() = std::make_unique(); + return vm; } - void initialize(std::string filename) { source_ = readTestWasmFile(filename); } - - DummyIntegration *integration_; - std::string source_; - std::string runtime_; + std::unique_ptr vm_; + std::string engine_; }; + +// TODO: remove when #412 is fixed. +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TestVm); + } // namespace proxy_wasm diff --git a/test/vm_id_handle_test.cc b/test/vm_id_handle_test.cc index b0d5b60a8..3eee9af03 100644 --- a/test/vm_id_handle_test.cc +++ b/test/vm_id_handle_test.cc @@ -19,12 +19,12 @@ namespace proxy_wasm { TEST(VmIdHandle, Basic) { - auto vm_id = "vm_id"; + const auto *vm_id = "vm_id"; auto handle = getVmIdHandle(vm_id); EXPECT_TRUE(handle); bool called = false; - registerVmIdHandleCallback([&called](std::string_view vm_id) { called = true; }); + registerVmIdHandleCallback([&called](std::string_view /*vm_id*/) { called = true; }); handle.reset(); EXPECT_TRUE(called); diff --git a/test/wasm_test.cc b/test/wasm_test.cc new file mode 100644 index 000000000..2a3e60cc4 --- /dev/null +++ b/test/wasm_test.cc @@ -0,0 +1,327 @@ +// 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. + +#include "include/proxy-wasm/wasm.h" + +#include + +#include "gtest/gtest.h" + +#include "test/utility.h" + +#include "src/wasm.h" + +namespace proxy_wasm { + +INSTANTIATE_TEST_SUITE_P(WasmEngines, TestVm, testing::ValuesIn(getWasmEngines()), + [](const testing::TestParamInfo &info) { + return info.param; + }); + +// Fail callbacks only used for WasmVMs - not available for NullVM. +TEST_P(TestVm, GetOrCreateThreadLocalWasmFailCallbacks) { + const auto *const plugin_name = "plugin_name"; + const auto *const root_id = "root_id"; + const auto *const vm_id = "vm_id"; + const auto *const vm_config = "vm_config"; + const auto *const plugin_config = "plugin_config"; + const auto fail_open = false; + + // Create a plugin. + const auto plugin = std::make_shared(plugin_name, root_id, vm_id, engine_, + plugin_config, fail_open, "plugin_key"); + + // Define callbacks. + WasmHandleFactory wasm_handle_factory = + [this, vm_id, vm_config](std::string_view vm_key) -> std::shared_ptr { + auto base_wasm = std::make_shared(makeVm(engine_), vm_id, vm_config, vm_key, + std::unordered_map{}, + AllowedCapabilitiesMap{}); + return std::make_shared(base_wasm); + }; + + WasmHandleCloneFactory wasm_handle_clone_factory = + [this](const std::shared_ptr &base_wasm_handle) + -> std::shared_ptr { + auto wasm = std::make_shared( + base_wasm_handle, [this]() -> std::unique_ptr { return makeVm(engine_); }); + return std::make_shared(wasm); + }; + + PluginHandleFactory plugin_handle_factory = + [](const std::shared_ptr &base_wasm, + const std::shared_ptr &plugin) -> std::shared_ptr { + return std::make_shared(base_wasm, plugin); + }; + + // Read the minimal loadable binary. + auto source = readTestWasmFile("abi_export.wasm"); + + // Create base Wasm via createWasm. + auto base_wasm_handle = + createWasm("vm_key", source, plugin, wasm_handle_factory, wasm_handle_clone_factory, false); + ASSERT_TRUE(base_wasm_handle && base_wasm_handle->wasm()); + + // Create a thread local plugin. + auto thread_local_plugin = getOrCreateThreadLocalPlugin( + base_wasm_handle, plugin, wasm_handle_clone_factory, plugin_handle_factory); + ASSERT_TRUE(thread_local_plugin && thread_local_plugin->plugin()); + // If the VM is not failed, same WasmBase should be used for the same configuration. + ASSERT_EQ(getOrCreateThreadLocalPlugin(base_wasm_handle, plugin, wasm_handle_clone_factory, + plugin_handle_factory) + ->wasm(), + thread_local_plugin->wasm()); + + // Cause runtime crash. + thread_local_plugin->wasm()->wasm_vm()->fail(FailState::RuntimeError, "runtime error msg"); + ASSERT_TRUE(thread_local_plugin->wasm()->isFailed()); + // the Base Wasm should not be affected by cloned ones. + ASSERT_FALSE(base_wasm_handle->wasm()->isFailed()); + + // Create another thread local plugin with the same configuration. + // This one should not end up using the failed VM. + auto thread_local_plugin2 = getOrCreateThreadLocalPlugin( + base_wasm_handle, plugin, wasm_handle_clone_factory, plugin_handle_factory); + ASSERT_TRUE(thread_local_plugin2 && thread_local_plugin2->plugin()); + ASSERT_FALSE(thread_local_plugin2->wasm()->isFailed()); + // Verify the pointer to WasmBase is different from the failed one. + ASSERT_NE(thread_local_plugin2->wasm(), thread_local_plugin->wasm()); + + // Cause runtime crash again. + thread_local_plugin2->wasm()->wasm_vm()->fail(FailState::RuntimeError, "runtime error msg"); + ASSERT_TRUE(thread_local_plugin2->wasm()->isFailed()); + // the Base Wasm should not be affected by cloned ones. + ASSERT_FALSE(base_wasm_handle->wasm()->isFailed()); + + // This time, create another thread local plugin with *different* plugin key for the same vm_key. + // This one also should not end up using the failed VM. + const auto plugin2 = std::make_shared(plugin_name, root_id, vm_id, engine_, + plugin_config, fail_open, "another_plugin_key"); + auto thread_local_plugin3 = getOrCreateThreadLocalPlugin( + base_wasm_handle, plugin2, wasm_handle_clone_factory, plugin_handle_factory); + ASSERT_TRUE(thread_local_plugin3 && thread_local_plugin3->plugin()); + ASSERT_FALSE(thread_local_plugin3->wasm()->isFailed()); + // Verify the pointer to WasmBase is different from the failed one. + ASSERT_NE(thread_local_plugin3->wasm(), thread_local_plugin->wasm()); + ASSERT_NE(thread_local_plugin3->wasm(), thread_local_plugin2->wasm()); +} + +// Tests the canary is always applied when making a call `createWasm` +TEST_P(TestVm, AlwaysApplyCanary) { + // Use different root_id, but the others are the same + const auto *const plugin_name = "plugin_name"; + + const std::string root_ids[2] = {"root_id_1", "root_id_2"}; + const std::string vm_ids[2] = {"vm_id_1", "vm_id_2"}; + const std::string vm_configs[2] = {"vm_config_1", "vm_config_2"}; + const std::string plugin_configs[3] = {"plugin_config_1", "plugin_config_2", + /* raising the error */ ""}; + const std::string plugin_keys[2] = {"plugin_key_1", "plugin_key_2"}; + const auto fail_open = false; + + // Define common callbacks + auto canary_count = 0; + WasmHandleCloneFactory wasm_handle_clone_factory_for_canary = + [&canary_count, this](const std::shared_ptr &base_wasm_handle) + -> std::shared_ptr { + auto wasm = std::make_shared( + base_wasm_handle, [this]() -> std::unique_ptr { return makeVm(engine_); }); + canary_count++; + return std::make_shared(wasm); + }; + + PluginHandleFactory plugin_handle_factory = + [](const std::shared_ptr &base_wasm, + const std::shared_ptr &plugin) -> std::shared_ptr { + return std::make_shared(base_wasm, plugin); + }; + + // Read the minimal loadable binary. + auto source = readTestWasmFile("canary_check.wasm"); + + WasmHandleFactory wasm_handle_factory_baseline = + [this, vm_ids, vm_configs](std::string_view vm_key) -> std::shared_ptr { + auto base_wasm = + std::make_shared(makeVm(engine_), std::unordered_map(), + vm_ids[0], vm_configs[0], vm_key); + return std::make_shared(base_wasm); + }; + + // Create a baseline plugin. + const auto plugin_baseline = std::make_shared( + plugin_name, root_ids[0], vm_ids[0], engine_, plugin_configs[0], fail_open, plugin_keys[0]); + + const auto vm_key_baseline = makeVmKey(vm_ids[0], vm_configs[0], "common_code"); + // Create a base Wasm by createWasm. + auto wasm_handle_baseline = + createWasm(vm_key_baseline, source, plugin_baseline, wasm_handle_factory_baseline, + wasm_handle_clone_factory_for_canary, false); + ASSERT_TRUE(wasm_handle_baseline && wasm_handle_baseline->wasm()); + + // Check if it ran for baseline root context + EXPECT_TRUE(TestContext::isGlobalLogged("onConfigure: " + root_ids[0])); + // For each create Wasm, canary should be done. + EXPECT_EQ(canary_count, 1); + + bool first = true; + std::unordered_set> reference_holder; + + for (const auto &root_id : root_ids) { + for (const auto &vm_id : vm_ids) { + for (const auto &vm_config : vm_configs) { + for (const auto &plugin_key : plugin_keys) { + for (const auto &plugin_config : plugin_configs) { + canary_count = 0; + TestContext::resetGlobalLog(); + WasmHandleFactory wasm_handle_factory_comp = + [this, vm_id, + vm_config](std::string_view vm_key) -> std::shared_ptr { + auto base_wasm = std::make_shared( + makeVm(engine_), std::unordered_map(), vm_id, vm_config, + vm_key); + return std::make_shared(base_wasm); + }; + const auto plugin_comp = std::make_shared( + plugin_name, root_id, vm_id, engine_, plugin_config, fail_open, plugin_key); + const auto vm_key = makeVmKey(vm_id, vm_config, "common_code"); + // Create a base Wasm by createWasm. + auto wasm_handle_comp = + createWasm(vm_key, source, plugin_comp, wasm_handle_factory_comp, + wasm_handle_clone_factory_for_canary, false); + // Validate that canarying is cached for the first baseline plugin variant. + if (first) { + first = false; + EXPECT_EQ(canary_count, 0); + } else { + // For each create Wasm, canary should be done. + EXPECT_EQ(canary_count, 1); + EXPECT_TRUE(TestContext::isGlobalLogged("onConfigure: " + root_id)); + } + + if (plugin_config.empty()) { + // canary_check.wasm should raise the error at `onConfigure` in canary when the + // `plugin_config` is empty string. + EXPECT_EQ(wasm_handle_comp, nullptr); + continue; + } + + ASSERT_TRUE(wasm_handle_comp && wasm_handle_comp->wasm()); + // Keep the reference of wasm_handle_comp in order to utilize the WasmHandleBase + // cache of createWasm. If we don't keep the reference, WasmHandleBase and VM will be + // destroyed for each iteration. + reference_holder.insert(wasm_handle_comp); + + // Wasm VM is unique for vm_key. + if (vm_key == vm_key_baseline) { + EXPECT_EQ(wasm_handle_baseline->wasm(), wasm_handle_comp->wasm()); + } else { + EXPECT_NE(wasm_handle_baseline->wasm(), wasm_handle_comp->wasm()); + } + + // plugin->key() is unique for root_id + plugin_config + plugin_key. + // plugin->key() is used as an identifier of local-specific plugins as well. + if (root_id == root_ids[0] && plugin_config == plugin_configs[0] && + plugin_key == plugin_keys[0]) { + EXPECT_EQ(plugin_baseline->key(), plugin_comp->key()); + } else { + EXPECT_NE(plugin_baseline->key(), plugin_comp->key()); + } + } + } + } + } + } +} + +// Check that there are no stale thread-local cache keys (eventually) +TEST_P(TestVm, CleanupThreadLocalCacheKeys) { + const auto *const plugin_name = "plugin_name"; + const auto *const root_id = "root_id"; + const auto *const vm_id = "vm_id"; + const auto *const vm_config = "vm_config"; + const auto *const plugin_config = "plugin_config"; + const auto fail_open = false; + + WasmHandleFactory wasm_handle_factory = + [this, vm_id, vm_config](std::string_view vm_key) -> std::shared_ptr { + auto base_wasm = std::make_shared(makeVm(engine_), vm_id, vm_config, vm_key, + std::unordered_map{}, + AllowedCapabilitiesMap{}); + return std::make_shared(base_wasm); + }; + + WasmHandleCloneFactory wasm_handle_clone_factory = + [this](const std::shared_ptr &base_wasm_handle) + -> std::shared_ptr { + auto wasm = std::make_shared( + base_wasm_handle, [this]() -> std::unique_ptr { return makeVm(engine_); }); + return std::make_shared(wasm); + }; + + PluginHandleFactory plugin_handle_factory = + [](const std::shared_ptr &base_wasm, + const std::shared_ptr &plugin) -> std::shared_ptr { + return std::make_shared(base_wasm, plugin); + }; + + // Read the minimal loadable binary. + auto source = readTestWasmFile("abi_export.wasm"); + + // Simulate a plugin lifetime. + const auto plugin1 = std::make_shared(plugin_name, root_id, vm_id, engine_, + plugin_config, fail_open, "plugin_1"); + auto base_wasm_handle1 = + createWasm("vm_1", source, plugin1, wasm_handle_factory, wasm_handle_clone_factory, false); + ASSERT_TRUE(base_wasm_handle1 && base_wasm_handle1->wasm()); + + auto local_plugin1 = getOrCreateThreadLocalPlugin( + base_wasm_handle1, plugin1, wasm_handle_clone_factory, plugin_handle_factory); + ASSERT_TRUE(local_plugin1 && local_plugin1->plugin()); + local_plugin1.reset(); + + auto stale_plugins_keys = staleLocalPluginsKeysForTesting(); + EXPECT_EQ(1, stale_plugins_keys.size()); + + // Now we create another plugin with a slightly different key and expect that there are no stale + // thread-local cache entries. + const auto plugin2 = std::make_shared(plugin_name, root_id, vm_id, engine_, + plugin_config, fail_open, "plugin_2"); + auto local_plugin2 = getOrCreateThreadLocalPlugin( + base_wasm_handle1, plugin2, wasm_handle_clone_factory, plugin_handle_factory); + ASSERT_TRUE(local_plugin2 && local_plugin2->plugin()); + + stale_plugins_keys = staleLocalPluginsKeysForTesting(); + EXPECT_TRUE(stale_plugins_keys.empty()); + + // Trigger deletion of the thread-local WasmVM cloned from base_wasm_handle1 by freeing objects + // referencing it. + local_plugin2.reset(); + + auto stale_wasms_keys = staleLocalWasmsKeysForTesting(); + EXPECT_EQ(1, stale_wasms_keys.size()); + + // Create another base WASM handle and invoke WASM thread-local cache key cleanup. + auto base_wasm_handle2 = + createWasm("vm_2", source, plugin2, wasm_handle_factory, wasm_handle_clone_factory, false); + ASSERT_TRUE(base_wasm_handle2 && base_wasm_handle2->wasm()); + + auto local_plugin3 = getOrCreateThreadLocalPlugin( + base_wasm_handle2, plugin2, wasm_handle_clone_factory, plugin_handle_factory); + ASSERT_TRUE(local_plugin3 && local_plugin3->plugin()); + + stale_wasms_keys = staleLocalWasmsKeysForTesting(); + EXPECT_TRUE(stale_wasms_keys.empty()); +} + +} // namespace proxy_wasm diff --git a/test/wasm_vm_test.cc b/test/wasm_vm_test.cc new file mode 100644 index 000000000..346fe2a07 --- /dev/null +++ b/test/wasm_vm_test.cc @@ -0,0 +1,168 @@ +// 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. + +#include "gtest/gtest.h" + +#include +#include +#include + +#include "include/proxy-wasm/wasm_vm.h" + +#include "test/utility.h" + +namespace proxy_wasm { +namespace { + +INSTANTIATE_TEST_SUITE_P(WasmEngines, TestVm, testing::ValuesIn(getWasmEngines()), + [](const testing::TestParamInfo &info) { + return info.param; + }); + +TEST_P(TestVm, Init) { + auto time1 = std::chrono::steady_clock::now(); + vm_->warm(); + auto time2 = std::chrono::steady_clock::now(); + vm_->warm(); + auto time3 = std::chrono::steady_clock::now(); + + auto cold = std::chrono::duration_cast(time2 - time1).count(); + auto warm = std::chrono::duration_cast(time3 - time2).count(); + + std::cout << "[" << engine_ << "] \"cold\" engine time: " << cold << "ns" << std::endl; + std::cout << "[" << engine_ << "] \"warm\" engine time: " << warm << "ns" << std::endl; + + // Default warm time in nanoseconds. + int warm_time_ns_limit = 10000; + +#if defined(__linux__) && defined(__s390x__) + // Linux 390x is significantly slower, so we use a more lenient limit. + warm_time_ns_limit = 75000; +#endif + + // Verify that getting a "warm" engine takes less than 10us. + EXPECT_LE(warm, warm_time_ns_limit); + + // Verify that getting a "warm" engine takes at least 50x less time than getting a "cold" one. + // We skip NullVM because warm() is a noop. + if (engine_ == "null") { + std::cout << "Skipping warm() performance assertions for NullVM." << std::endl; + return; + } + EXPECT_LE(warm * 50, cold); +} + +TEST_P(TestVm, Basic) { + if (engine_ == "wasmedge") { + EXPECT_EQ(vm_->cloneable(), proxy_wasm::Cloneable::NotCloneable); + } else if (engine_ == "wasmtime" || engine_ == "v8" || engine_ == "wamr") { + EXPECT_EQ(vm_->cloneable(), proxy_wasm::Cloneable::CompiledBytecode); + } else { + FAIL(); + } + EXPECT_EQ(vm_->getEngineName(), engine_); +} + +TEST_P(TestVm, Memory) { + auto source = readTestWasmFile("abi_export.wasm"); + ASSERT_TRUE(vm_->load(source, {}, {})); + ASSERT_TRUE(vm_->link("")); + + Word word; + ASSERT_TRUE(vm_->setWord(0x2000, Word(100))); + ASSERT_TRUE(vm_->getWord(0x2000, &word)); + ASSERT_EQ(100, word.u64_); + + uint32_t data[2] = {htowasm(static_cast(-1), vm_->usesWasmByteOrder()), + htowasm(200, vm_->usesWasmByteOrder())}; + ASSERT_TRUE(vm_->setMemory(0x200, sizeof(int32_t) * 2, static_cast(data))); + ASSERT_TRUE(vm_->getWord(0x200, &word)); + ASSERT_EQ(-1, static_cast(word.u64_)); + ASSERT_TRUE(vm_->getWord(0x204, &word)); + ASSERT_EQ(200, static_cast(word.u64_)); +} + +TEST_P(TestVm, Clone) { + if (vm_->cloneable() == proxy_wasm::Cloneable::NotCloneable) { + return; + } + auto source = readTestWasmFile("abi_export.wasm"); + ASSERT_TRUE(vm_->load(source, {}, {})); + ASSERT_TRUE(vm_->link("")); + const auto address = 0x2000; + Word word; + { + auto clone = vm_->clone(); + ASSERT_TRUE(clone != nullptr); + ASSERT_NE(vm_, clone); + if (clone->cloneable() != proxy_wasm::Cloneable::InstantiatedModule) { + ASSERT_TRUE(clone->link("")); + } + + ASSERT_TRUE(clone->setWord(address, Word(100))); + ASSERT_TRUE(clone->getWord(address, &word)); + ASSERT_EQ(100, word.u64_); + } + + // check memory arrays are not overrapped + ASSERT_TRUE(vm_->getWord(address, &word)); + ASSERT_NE(100, word.u64_); +} + +#if defined(__linux__) && defined(__x86_64__) + +TEST_P(TestVm, DISABLED_CloneUntilOutOfMemory) { + if (vm_->cloneable() == proxy_wasm::Cloneable::NotCloneable) { + return; + } + + auto source = readTestWasmFile("abi_export.wasm"); + ASSERT_TRUE(vm_->load(source, {}, {})); + ASSERT_TRUE(vm_->link("")); + + size_t max_clones = 100000; +#if defined(__has_feature) +#if __has_feature(address_sanitizer) + max_clones = 1000; +#endif +#endif + + std::vector> clones; + for (size_t i = 0; i < max_clones; i++) { + auto clone = vm_->clone(); + if (clone == nullptr) { + break; + } + if (clone->cloneable() != proxy_wasm::Cloneable::InstantiatedModule) { + if (!clone->link("")) { + break; + } + } + // Prevent clone from droping out of scope and freeing memory. + clones.push_back(std::move(clone)); + } + + size_t min_clones = 1000; +#if defined(__has_feature) +#if __has_feature(thread_sanitizer) + min_clones = 100; +#endif +#endif + EXPECT_GE(clones.size(), min_clones); +} + +#endif + +} // namespace +} // namespace proxy_wasm diff --git a/tools/gen_compilation_database.py b/tools/gen_compilation_database.py new file mode 100755 index 000000000..bff3d82d5 --- /dev/null +++ b/tools/gen_compilation_database.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 + +# Copyright 2016-2019 Envoy Project Authors +# 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. + +import argparse +import json +import os +import shlex +import subprocess +from pathlib import Path + +# This is copied from https://github.com/envoyproxy/envoy and remove unnecessary code. + +# This method is equivalent to https://github.com/grailbio/bazel-compilation-database/blob/master/generate.py +def generate_compilation_database(args): + # We need to download all remote outputs for generated source code. This option lives here to override those + # specified in bazelrc. + bazel_startup_options = shlex.split(os.environ.get("BAZEL_STARTUP_OPTION_LIST", "")) + bazel_options = shlex.split(os.environ.get("BAZEL_BUILD_OPTION_LIST", "")) + [ + "--remote_download_outputs=all", + ] + + source_dir_targets = args.bazel_targets + + subprocess.check_call(["bazel", *bazel_startup_options, "build"] + bazel_options + [ + "--aspects=@bazel_compdb//:aspects.bzl%compilation_database_aspect", + "--output_groups=compdb_files,header_files" + ] + source_dir_targets) + + execroot = subprocess.check_output( + ["bazel", *bazel_startup_options, "info", *bazel_options, + "execution_root"]).decode().strip() + + db_entries = [] + for db in Path(execroot).glob('**/*.compile_commands.json'): + db_entries.extend(json.loads(db.read_text())) + + def replace_execroot_marker(db_entry): + if 'directory' in db_entry and db_entry['directory'] == '__EXEC_ROOT__': + db_entry['directory'] = execroot + if 'command' in db_entry: + db_entry['command'] = ( + db_entry['command'].replace('-isysroot __BAZEL_XCODE_SDKROOT__', '')) + return db_entry + + return list(map(replace_execroot_marker, db_entries)) + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Generate JSON compilation database') + parser.add_argument('--include_external', action='https://github.com/store_true') + parser.add_argument('--include_genfiles', action='https://github.com/store_true') + parser.add_argument('--include_headers', action='https://github.com/store_true') + parser.add_argument('--include_all', action='https://github.com/store_true') + parser.add_argument( + '--system-clang', + action='https://github.com/store_true', + help= + 'Use `clang++` instead of the bazel wrapper for commands. This may help if `clangd` cannot find/run the tools.' + ) + parser.add_argument('bazel_targets', nargs='*', default=[]) + + args = parser.parse_args() + db = generate_compilation_database(args) + + with open("compile_commands.json", "w") as db_file: + json.dump(db, db_file, indent=2)