Skip to content

Suggested updates to proof of concept C host documentation#1

Merged
ohAitch merged 2 commits into
ohAitch:example-c-hostfrom
kate-goldenring:c-docs-updates
Apr 15, 2026
Merged

Suggested updates to proof of concept C host documentation#1
ohAitch merged 2 commits into
ohAitch:example-c-hostfrom
kate-goldenring:c-docs-updates

Conversation

@kate-goldenring
Copy link
Copy Markdown

@kate-goldenring kate-goldenring commented Apr 15, 2026

  • Fills in documentation on how to use the C host
  • Updates Dockerfile to be cross architecture
  • Adds a new Dockerfile that is just the host

Done with the help of Copilot with Sonnet 4.6

&& rm wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.deb
RUN set -eux; \
case "${TARGETARCH}" in \
amd64) WASI_SDK_ARCH=amd64 ;; \
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
amd64) WASI_SDK_ARCH=amd64 ;; \
amd64) WASI_SDK_ARCH=x86_64 ;; \

got a 404 for https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-27/wasi-sdk-27.0-amd64-linux.deb trying to run this on x86

0.435 Errors were encountered while processing:
0.435  wasi-sdk-27.0-amd64-linux.deb
------
Dockerfile.guest_and_host:23
--------------------
  22 |     # Install wasi-sdk (for building the guest component)
  23 | >>> RUN set -eux; \
  24 | >>>     case "${TARGETARCH}" in \
  25 | >>>         amd64) WASI_SDK_ARCH=amd64 ;; \
  26 | >>>         arm64) WASI_SDK_ARCH=arm64 ;; \
  27 | >>>         *) echo "Unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;; \
  28 | >>>     esac; \
  29 | >>>     curl -sLO "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-${WASI_SDK_ARCH}-linux.deb"; \
  30 | >>>     dpkg -i "wasi-sdk-${WASI_SDK_VERSION}.0-${WASI_SDK_ARCH}-linux.deb"; \
  31 | >>>     rm "wasi-sdk-${WASI_SDK_VERSION}.0-${WASI_SDK_ARCH}-linux.deb"
  32 |     
--------------------

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though this is the guest one so if rebasing onto bytecodealliance:main and grabbing that adder.wasm works, this file can just go away

Comment thread component-model/src/language-support/building-a-simple-component/c.md Outdated
1 + 2 = 3
```

*TODO: work in `wasmtime --invoke 'add(2,2)' adder.wasm`*
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want wasmtime --invoke as Option C?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me

.
```

*TODO: the C++ API is nicer and may be more appropriate for example code*
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also seems fine to remove if it'd be annoying

@kate-goldenring
Copy link
Copy Markdown
Author

@ohAitch do you mind pushing any suggestions as changes to this/ overwriting anything that you disagree with?

@ohAitch
Copy link
Copy Markdown
Owner

ohAitch commented Apr 15, 2026

Yeah legit we're getting into patches on patches on patches, I'll take a more hands-on look

- Fills in documentation on how to use the C host
- Updates Dockerfile to be cross architecture
- Adds a new Dockerfile that is just the host

Signed-off-by: Kate Goldenring <kgoldenr@akamai.com>
Signed-off-by: Kate Goldenring <kgoldenr@akamai.com>
@kate-goldenring
Copy link
Copy Markdown
Author

@ohAitch I added in a couple of your requested changes. I think it is mainly the rebasing that needs to be taken care of

@ohAitch ohAitch merged commit 18c4ec8 into ohAitch:example-c-host Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants