Skip to content
This repository has been archived by the owner on Feb 26, 2025. It is now read-only.

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
noise64 committed Jan 14, 2025
1 parent 35f1783 commit 6eb3ce9
Show file tree
Hide file tree
Showing 78 changed files with 34 additions and 6,099 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ default-run = "golem-examples-cli"
clap = { version = "4.5.23", features = ["derive"], optional = true }
colored = "2.1.0"
derive_more = { version = "1.0.0", features = ["from_str"] }
golem-wit = { version = "1.1.0" }
golem-wit = { version = "1.1.1" }
include_dir = { version = "0.7.4" }
Inflector = { version = "0.11.4" }
once_cell = { version = "1.20.2" }
Expand Down
6 changes: 3 additions & 3 deletions examples/c/INSTRUCTIONS
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ See the documentation about installing tooling: https://learn.golem.cloud/docs/c

Generate bindings from WIT:
wit-bindgen c --autodrop-borrows yes --out-dir component_name ./wit
Compile the C code with WASI SDK:
~/wasi-sdk-23.0/bin/clang --sysroot ~/wasi-sdk-23.0/share/wasi-sysroot main.c component_name/component_name.c component_name/component_name_component_type.o -o component_name.module.wasm
Compile the C code with WASI SDK (set WASI_SDK_PATH where wasi-sdk-25.0 is installed):
$WASI_SDK_PATH/bin/clang --sysroot $WASI_SDK_PATH/share/wasi-sysroot main.c component_name/component_name.c component_name/component_name_component_type.o -o component_name.module.wasm
Convert the result into a Component:
wasm-tools component new component_name.module.wasm -o component_name.wasm --adapt adapters/tier1/wasi_snapshot_preview1.wasm

A Makefile is provided to automate the process:
export WASI_SDK=...
export WASI_SDK_PATH=...
make build
2 changes: 1 addition & 1 deletion examples/c/c-default-minimal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bindings:
wit-bindgen c --autodrop-borrows yes --out-dir component_name ./wit

compile: bindings
${WASI_SDK}/bin/clang --sysroot ${WASI_SDK}/share/wasi-sysroot main.c component_name/component_name.c component_name/component_name_component_type.o -o component_name.module.wasm
${WASI_SDK_PATH}/bin/clang --sysroot ${WASI_SDK_PATH}/share/wasi-sysroot main.c component_name/component_name.c component_name/component_name_component_type.o -o component_name.module.wasm

clean:
rm -rf component_name
Expand Down
2 changes: 1 addition & 1 deletion examples/go/go-default/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type ResponseBody struct {
}

func init() {
binding.SetExportsPackNameInterfaceApi(&ComponentNameImpl{})
binding.SetExportsPackNameExportsApi(&ComponentNameImpl{})
}

// total State can be stored in global variables
Expand Down
2 changes: 0 additions & 2 deletions examples/go/go-multi-rpc/.gitignore

This file was deleted.

188 changes: 0 additions & 188 deletions examples/go/go-multi-rpc/README.md

This file was deleted.

142 changes: 0 additions & 142 deletions examples/go/go-multi-rpc/component-generator/generator.go

This file was deleted.

Loading

0 comments on commit 6eb3ce9

Please sign in to comment.