From 7e7611bf013fd3e6503a5444acab56bc1f193d45 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 12 Dec 2024 16:38:32 -0800 Subject: [PATCH 1/3] deps: update to latest WASI SDK 25 --- runtime/StarlingMonkey | 2 +- runtime/fastly/builtins/cache-core.cpp | 4 ++-- runtime/fastly/builtins/cache-simple.cpp | 14 +++++++------- runtime/fastly/host-api/host_api_fastly.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/runtime/StarlingMonkey b/runtime/StarlingMonkey index 2fba6fe7e6..ab14a9f4fb 160000 --- a/runtime/StarlingMonkey +++ b/runtime/StarlingMonkey @@ -1 +1 @@ -Subproject commit 2fba6fe7e621fa05f9a6ce861c1c44cd2fe50646 +Subproject commit ab14a9f4fbdba0fa36ab03b8862b4175da5b8c58 diff --git a/runtime/fastly/builtins/cache-core.cpp b/runtime/fastly/builtins/cache-core.cpp index 7a0bb32ba3..88cbe60a2a 100644 --- a/runtime/fastly/builtins/cache-core.cpp +++ b/runtime/fastly/builtins/cache-core.cpp @@ -74,7 +74,7 @@ JS::Result parseLookupOptions(JSContext *cx, Headers::HeadersList *headers_list = Headers::get_list(cx, headers); MOZ_ASSERT(headers_list); auto res = host_api::write_headers(request_handle.headers_writable(), *headers_list); - if (auto *err = res.to_err()) { + if ([[maybe_unused]] auto *err = res.to_err()) { return JS::Result(JS::Error()); } options.request_headers = host_api::HttpReq(request_handle); @@ -364,7 +364,7 @@ JS::Result parseInsertOptions(JSContext *cx, Headers::HeadersList *headers_list = Headers::get_list(cx, headers); MOZ_ASSERT(headers_list); auto res = host_api::write_headers(request_handle.headers_writable(), *headers_list); - if (auto *err = res.to_err()) { + if ([[maybe_unused]] auto *err = res.to_err()) { return JS::Result(JS::Error()); } options.request_headers = host_api::HttpReq(request_handle); diff --git a/runtime/fastly/builtins/cache-simple.cpp b/runtime/fastly/builtins/cache-simple.cpp index d80d5d9bf9..111d62cf2f 100644 --- a/runtime/fastly/builtins/cache-simple.cpp +++ b/runtime/fastly/builtins/cache-simple.cpp @@ -329,7 +329,7 @@ bool get_or_set_then_handler(JSContext *cx, JS::HandleObject lookup_state, JS::H options.surrogate_keys = key_result.inspect(); auto inserted_res = handle.transaction_insert_and_stream_back(options); - if (auto *err = inserted_res.to_err()) { + if ([[maybe_unused]] auto *err = inserted_res.to_err()) { return false; } @@ -340,22 +340,22 @@ bool get_or_set_then_handler(JSContext *cx, JS::HandleObject lookup_state, JS::H // source_body will only be valid when the body is a Host-backed ReadableStream if (source_body.valid()) { auto res = body.append(source_body); - if (auto *error = res.to_err()) { + if ([[maybe_unused]] auto *error = res.to_err()) { return false; } } else { auto write_res = body.write_all_back(reinterpret_cast(buf.get()), options.length); - if (auto *error = write_res.to_err()) { + if ([[maybe_unused]] auto *error = write_res.to_err()) { return false; } auto close_res = body.close(); - if (auto *error = close_res.to_err()) { + if ([[maybe_unused]] auto *error = close_res.to_err()) { return false; } } auto res = inserted_handle.get_body(host_api::CacheGetBodyOptions{}); - if (auto *err = res.to_err()) { + if ([[maybe_unused]] auto *err = res.to_err()) { return false; } @@ -442,7 +442,7 @@ bool SimpleCache::getOrSet(JSContext *cx, unsigned argc, JS::Value *vp) { // cache under the provided `key`, and then we will resolve with a SimpleCacheEntry // containing the value. auto state_res = handle.get_state(); - if (auto *err = state_res.to_err()) { + if ([[maybe_unused]] auto *err = state_res.to_err()) { return false; } @@ -450,7 +450,7 @@ bool SimpleCache::getOrSet(JSContext *cx, unsigned argc, JS::Value *vp) { args.rval().setObject(*promise); if (state.is_usable()) { auto body_res = handle.get_body(host_api::CacheGetBodyOptions{}); - if (auto *err = body_res.to_err()) { + if ([[maybe_unused]] auto *err = body_res.to_err()) { return false; } diff --git a/runtime/fastly/host-api/host_api_fastly.h b/runtime/fastly/host-api/host_api_fastly.h index 68f6b4badc..6d4f021ba5 100644 --- a/runtime/fastly/host-api/host_api_fastly.h +++ b/runtime/fastly/host-api/host_api_fastly.h @@ -355,7 +355,7 @@ struct TlsVersion { uint8_t value = 0; explicit TlsVersion(uint8_t raw); - explicit TlsVersion(){}; + explicit TlsVersion() {}; uint8_t get_version() const; double get_version_number() const; From 63fde5413358a1629bb9374199a6216da9a3655d Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 12 Dec 2024 16:40:21 -0800 Subject: [PATCH 2/3] fixup github workflow --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62f05a212d..2d19434ea1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,13 +99,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: "Install wasi-sdk-20 (linux)" + - name: "Install wasi-sdk-25 (linux)" run: | set -x - curl -sS -L -O https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz - tar xf wasi-sdk-20.0-linux.tar.gz + curl -sS -L -O https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz + tar xf wasi-sdk-25.0-linux.tar.gz sudo mkdir -p /opt/wasi-sdk - sudo mv wasi-sdk-20.0/* /opt/wasi-sdk/ + sudo mv wasi-sdk-25.0/* /opt/wasi-sdk/ ls /opt/wasi-sdk/ - run: | /opt/wasi-sdk/bin/clang-format --version From 3eb17794d405435b2e4c1bf3302fdd044b39a880 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Thu, 12 Dec 2024 18:31:48 -0800 Subject: [PATCH 3/3] update workflow file --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d19434ea1..ba8b667e00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -103,9 +103,9 @@ jobs: run: | set -x curl -sS -L -O https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz - tar xf wasi-sdk-25.0-linux.tar.gz + tar xf wasi-sdk-25.0-x86_64-linux.tar.gz sudo mkdir -p /opt/wasi-sdk - sudo mv wasi-sdk-25.0/* /opt/wasi-sdk/ + sudo mv wasi-sdk-25.0-x86_64-linux/* /opt/wasi-sdk/ ls /opt/wasi-sdk/ - run: | /opt/wasi-sdk/bin/clang-format --version