-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GitHub workflow for wasm-wasi-component #1175
Conversation
53bfd88
to
77d9079
Compare
## | ||
## wasm-wasi-component | ||
## | ||
|
||
- name: Setup rust | ||
run: | | ||
curl https://sh.rustup.rs | sh -s -- -y | ||
if: steps.metadata.outputs.module == 'wasm-wasi-component' | ||
|
||
- name: Configure wasm-wasi-component | ||
run: | | ||
./configure wasm-wasi-component | ||
if: steps.metadata.outputs.module == 'wasm-wasi-component' | ||
|
||
- name: Make wasm-wasi-component | ||
run: | | ||
CLANG_PATH=/usr/bin/clang-15 \ | ||
BINDGEN_EXTRA_CLANG_ARGS="-I../../njs/src -I../../njs/build" \ | ||
make wasm-wasi-component | ||
if: steps.metadata.outputs.module == 'wasm-wasi-component' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense just to include this in the wasm
step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did at first, but then thought it was sufficiently different...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Looks to good to me 👍🏻
if: steps.metadata.outputs.module != 'wasm' && | ||
steps.metadata.outputs.module != 'wasm-wasi-component' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also do
if: steps.metadata.outputs.module != 'wasm' && | |
steps.metadata.outputs.module != 'wasm-wasi-component' | |
if: startsWith(steps.metadata.outputs.module, 'wasm') |
startsWith
is a builtin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's neater, although we may get tests for one before the other... then it's aonly a matter of removing one of the conditions vs changing the whole thing... I'm 50/50...
# Split the build name by '-' into module and version | ||
IFS='-' read -r module version <<< "${{ matrix.build }}" | ||
if [ "${{ matrix.build }}" = "wasm-wasi-component" ]; then | ||
module="wasm-wasi-component" | ||
else | ||
# Split the build name by '-' into module and version | ||
IFS='-' read -r module version <<< "${{ matrix.build }}" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need to improve upon my hacky language-version
idea eventually, but this works for now! 😄
This adds a GitHub CI workflow for the new wasm-wasi-component language module. Some things of note. 1) We need to special case 'wasm-wasi-component' in the 'Output build metadata' section as we are splitting the module names on '-' to split them into name and version. 2) Apart from needing to tell bindgen about the njs include paths, we also need to explicitly specify which version of clang to use to work around an issue with multiple versions of clang installed. Link: <https://gitlab.freedesktop.org/mesa/mesa/-/issues/7268> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
This adds a GitHub CI workflow for the new wasm-wasi-component language module.
Some things of note.
We need to special case 'wasm-wasi-component' in the 'Output build
metadata' section as we are splitting the module names on '-' to
split them into name and version.
Apart from needing to tell bindgen about the njs include paths, we
also need to explicitly specify which version of clang to use to
work around an issue with multiple versions of clang installed.