Skip to content

Commit f51e875

Browse files
authored
Re-generate fastly-world with wit-bindgen 0.6 (#528)
1 parent 5a56613 commit f51e875

19 files changed

+570
-434
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"typescript": "^5.0"
4646
},
4747
"dependencies": {
48-
"@bytecodealliance/jco": "^0.6.1",
48+
"@bytecodealliance/jco": "^0.7.0",
4949
"@bytecodealliance/wizer": "^1.6.1-beta.4",
5050
"acorn": "^8.8.2",
5151
"acorn-walk": "^8.2.0",

runtime/js-compute-runtime/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/compile_commands.json
33
/.cache
44

5+
!/fastly-world/*.o
56
/js-compute-runtime*.wasm
67
/build
7-
/shared
8+
/shared

runtime/js-compute-runtime/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ $(eval $(call compile_c,$(FSM_SRC)/fastly-world/fastly_world.c))
326326
# that script for more information about why we do this.
327327
$(OBJ_DIR)/js-compute-runtime-component.wasm: $(FSM_OBJ) $(SM_OBJ) $(RUST_URL_LIB) $(RUST_ENCODING_LIB)
328328
$(OBJ_DIR)/js-compute-runtime-component.wasm: $(OBJ_DIR)/impl/main_component.o
329+
# NOTE: we don't currently link in the component type object because we
330+
# explicitly reference fastly.wit when building the component. If this changes,
331+
# uncommenting this line will link the component type object in.
332+
# $(OBJ_DIR)/js-compute-runtime-component.wasm: $(FSM_SRC)/fastly-world/fastly_world_component_type.o
329333
$(OBJ_DIR)/js-compute-runtime-component.wasm: $(OBJ_DIR)/fastly-world/fastly_world.o
330334
$(call cmd_format,WASI_LD,$@) PATH="$(FSM_SRC)/scripts:$$PATH" \
331335
$(WASI_CXX) $(LD_FLAGS) $(OPENSSL_LIBS) -o $@ $^

runtime/js-compute-runtime/builtins/client-info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ JSString *geo_info(JSObject *obj) {
2222
static JSString *retrieve_address(JSContext *cx, JS::HandleObject self) {
2323
JS::RootedString address(cx);
2424

25-
fastly_list_u8_t octets;
25+
fastly_world_list_u8_t octets;
2626
fastly_error_t err;
2727
if (!fastly_http_req_downstream_client_ip_addr(&octets, &err)) {
2828
HANDLE_ERROR(cx, err);

runtime/js-compute-runtime/builtins/config-store.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bool ConfigStore::get(JSContext *cx, unsigned argc, JS::Value *vp) {
2727
return false;
2828
}
2929

30-
fastly_option_string_t ret;
30+
fastly_world_option_string_t ret;
3131
fastly_error_t err;
3232
// Ensure that we throw an exception for all unexpected host errors.
3333
if (!fastly_dictionary_get(ConfigStore::config_store_handle(self), &key_str, &ret, &err)) {

runtime/js-compute-runtime/builtins/dictionary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bool Dictionary::get(JSContext *cx, unsigned argc, JS::Value *vp) {
3333
return false;
3434
}
3535

36-
fastly_option_string_t ret;
36+
fastly_world_option_string_t ret;
3737
fastly_error_t err;
3838

3939
// Ensure that we throw an exception for all unexpected host errors.

runtime/js-compute-runtime/builtins/kv-store.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ bool KVStore::get(JSContext *cx, unsigned argc, JS::Value *vp) {
202202
if (!parse_and_validate_key(cx, &key_chars, key_str.len))
203203
return ReturnPromiseRejectedWithPendingError(cx, args);
204204

205-
fastly_option_body_handle_t ret;
205+
fastly_world_option_body_handle_t ret;
206206
fastly_error_t err;
207207
if (!fastly_object_store_lookup(kv_store_handle(self), &key_str, &ret, &err)) {
208208
HANDLE_ERROR(cx, err);

runtime/js-compute-runtime/builtins/secret-store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fastly_secret_handle_t SecretStoreEntry::secret_handle(JSObject *obj) {
1111
bool SecretStoreEntry::plaintext(JSContext *cx, unsigned argc, JS::Value *vp) {
1212
METHOD_HEADER(0)
1313

14-
fastly_option_string_t ret;
14+
fastly_world_option_string_t ret;
1515
fastly_error_t err;
1616
// Ensure that we throw an exception for all unexpected host errors.
1717
if (!fastly_secret_store_plaintext(SecretStoreEntry::secret_handle(self), &ret, &err)) {
@@ -110,7 +110,7 @@ bool SecretStore::get(JSContext *cx, unsigned argc, JS::Value *vp) {
110110
fastly_world_string_t key_str;
111111
key_str.len = length;
112112
key_str.ptr = key.get();
113-
fastly_option_secret_handle_t secret;
113+
fastly_world_option_secret_handle_t secret;
114114
fastly_error_t err;
115115
// Ensure that we throw an exception for all unexpected host errors.
116116
if (!fastly_secret_store_get(SecretStore::secret_store_handle(self), &key_str, &secret, &err)) {

runtime/js-compute-runtime/core/geo_ip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ JSString *get_geo_info(JSContext *cx, JS::HandleString address_str) {
3434
return nullptr;
3535
}
3636

37-
fastly_list_u8_t octets_list = {const_cast<uint8_t *>(&octets[0]), octets_len};
37+
fastly_world_list_u8_t octets_list = {const_cast<uint8_t *>(&octets[0]), octets_len};
3838

3939
fastly_world_string_t ret;
4040
fastly_error_t err;

0 commit comments

Comments
 (0)