Skip to content

Commit

Permalink
fix: componentize script to use local bins (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Oct 7, 2024
1 parent 234d7c4 commit 306a7ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function(componentize OUTPUT)
add_custom_command(
OUTPUT ${OUTPUT}.wasm
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E env "PATH=${WASM_TOOLS_DIR};${WIZER_DIR};$ENV{PATH}" ${RUNTIME_DIR}/componentize.sh ${SOURCES} -o ${OUTPUT}.wasm
COMMAND ${CMAKE_COMMAND} ${RUNTIME_DIR}/componentize.sh ${SOURCES} -o ${OUTPUT}.wasm
DEPENDS ${ARG_SOURCES} ${RUNTIME_DIR}/componentize.sh starling.wasm
VERBATIM
)
Expand Down
10 changes: 9 additions & 1 deletion builtins/web/fetch/headers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ host_api::HostString normalize_and_validate_header_value(JSContext *cx, HandleVa
}
bool valid = normalize_header_value(value);
if (!valid) {
api::throw_error(cx, FetchErrors::InvalidHeaderValue, fun_name, value.begin());
// need to coerce to utf8 to report the error value
JS::RootedString str(cx, JS::ToString(cx, value_val));
if (!str) {
return host_api::HostString{};
}
auto maybe_utf8 = core::encode(cx, str);
if (maybe_utf8) {
api::throw_error(cx, FetchErrors::InvalidHeaderValue, fun_name, maybe_utf8.begin());
}
return host_api::HostString{};
}
return value;
Expand Down
4 changes: 2 additions & 2 deletions componentize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#set -euo pipefail

wizer="${WIZER:-wizer}"
wasm_tools="${WASM_TOOLS:-wasm-tools}"
wizer="${WIZER:-@WIZER_DIR@/wizer}"
wasm_tools="${WASM_TOOLS:-@WASM_TOOLS_BIN@}"
weval="${WEVAL:-@WEVAL_BIN@}"
aot=@AOT@
preopen_dir="${PREOPEN_DIR:-}"
Expand Down

0 comments on commit 306a7ad

Please sign in to comment.