From 6a5baa45a023a36a702db577082cf9e255582334 Mon Sep 17 00:00:00 2001 From: Charles Eckman Date: Wed, 13 Aug 2025 11:12:14 -0400 Subject: [PATCH 1/2] Update development instructions to reflect wasm-tools --- DEVELOPMENT.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 567a2ca5f6..6e86015896 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -93,8 +93,14 @@ npm run build ``` - [cbindgen](https://github.com/eqrion/cbindgen#quick-start) ```sh - cargo install cbindgen + cargo install --locked cbindgen ``` + +- [wasm-tools](https://github.com/bytecodealliance/wasm-tools) + ```sh + cargo install --locked wasm-tools + ``` + - [wasi-sdk, version 20](https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-20), with alternate [install instructions](https://github.com/WebAssembly/wasi-sdk#install) ```sh From 5f0f5d34f07529babbf06168a0139b03b50ab59e Mon Sep 17 00:00:00 2001 From: Charles Eckman Date: Wed, 13 Aug 2025 11:08:07 -0400 Subject: [PATCH 2/2] Remove non-collapsing lookup This is not (as far as I can tell!) exposed to the guest JS code. Remove it. --- runtime/fastly/host-api/fastly.h | 4 ---- runtime/fastly/host-api/host_api.cpp | 24 ----------------------- runtime/fastly/host-api/host_api_fastly.h | 3 --- 3 files changed, 31 deletions(-) diff --git a/runtime/fastly/host-api/fastly.h b/runtime/fastly/host-api/fastly.h index b0d0cb28c6..48fa7f6bfa 100644 --- a/runtime/fastly/host-api/fastly.h +++ b/runtime/fastly/host-api/fastly.h @@ -362,10 +362,6 @@ WASM_IMPORT("fastly_http_cache", "get_suggested_cache_key") int http_cache_get_suggested_cache_key(uint32_t req_handle, char *key_out, size_t key_out_len, size_t *nwritten_out); -WASM_IMPORT("fastly_http_cache", "lookup") -int http_cache_lookup(uint32_t req_handle, uint32_t options_mask, - fastly_http_cache_lookup_options *options, uint32_t *handle_out); - WASM_IMPORT("fastly_http_cache", "transaction_lookup") int http_cache_transaction_lookup(uint32_t req_handle, uint32_t options_mask, fastly_http_cache_lookup_options *options, uint32_t *handle_out); diff --git a/runtime/fastly/host-api/host_api.cpp b/runtime/fastly/host-api/host_api.cpp index ab33543bfc..1690c54ed0 100644 --- a/runtime/fastly/host-api/host_api.cpp +++ b/runtime/fastly/host-api/host_api.cpp @@ -2117,30 +2117,6 @@ Result HttpReq::get_suggested_cache_key() const { return Result::ok(make_host_string(str)); } -// HttpCacheEntry method implementations -Result HttpCacheEntry::lookup(const HttpReq &req, std::span override_key) { - TRACE_CALL() - uint32_t handle_out; - fastly::fastly_http_cache_lookup_options opts{}; - uint32_t opts_mask = 0; - - if (!override_key.empty()) { - MOZ_ASSERT(override_key.size() == 32); - opts.override_key = reinterpret_cast(override_key.data()); - opts.override_key_len = override_key.size(); - opts_mask |= FASTLY_HTTP_CACHE_LOOKUP_OPTIONS_MASK_OVERRIDE_KEY; - } - - auto res = fastly::http_cache_lookup(req.handle, opts_mask, - override_key.empty() ? nullptr : &opts, &handle_out); - - if (res != 0) { - return Result::err(host_api::APIError(res)); - } - - return Result::ok(HttpCacheEntry(handle_out)); -} - Result HttpCacheEntry::transaction_lookup(const HttpReq &req, std::span override_key) { TRACE_CALL_ARGS(TSV(std::to_string(req.handle))) diff --git a/runtime/fastly/host-api/host_api_fastly.h b/runtime/fastly/host-api/host_api_fastly.h index ad444c67d0..aecfe392f7 100644 --- a/runtime/fastly/host-api/host_api_fastly.h +++ b/runtime/fastly/host-api/host_api_fastly.h @@ -728,9 +728,6 @@ class HttpCacheEntry final { bool is_valid() const { return handle != invalid; } - /// Lookup a cached object without participating in request collapsing - static Result lookup(const HttpReq &req, std::span override_key = {}); - /// Lookup a cached object, participating in request collapsing static Result transaction_lookup(const HttpReq &req, std::span override_key = {});