Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .github/workflows/integration-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,20 @@ jobs:
- name: Setup integration test
working-directory: examples
run: |
# Override MODULE.bazel to use local rules checkout
cat >> MODULE.bazel << 'EOF'

# Integration test override - use PR branch
local_path_override(
module_name = "rules_wasm_component",
path = "../rules_wasm_component",
)
EOF
# Replace git_override with local_path_override between markers
sed -i '/RULES_WASM_COMPONENT_OVERRIDE_START/,/RULES_WASM_COMPONENT_OVERRIDE_END/c\
# RULES_WASM_COMPONENT_OVERRIDE_START\
local_path_override(\
module_name = "rules_wasm_component",\
path = "../rules_wasm_component",\
)\
# RULES_WASM_COMPONENT_OVERRIDE_END' MODULE.bazel

echo "=== MODULE.bazel override block ==="
sed -n '/OVERRIDE_START/,/OVERRIDE_END/p' MODULE.bazel

echo "=== Testing against PR branch ==="
cd ../rules_wasm_component && git log -1 --oneline
echo ""

- name: Install Bazelisk
run: |
Expand Down
2 changes: 2 additions & 0 deletions cpp/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def _cpp_component_impl(ctx):

# Basic compiler flags for Preview2
compile_args.add("--target=wasm32-wasip2")
compile_args.add("-mexec-model=reactor") # Library component, not CLI

# Build sysroot path from toolchain repository for external compatibility
if sysroot_files and sysroot_files.files:
Expand Down Expand Up @@ -522,6 +523,7 @@ def _cpp_component_impl(ctx):
"name": ctx.label.name,
"language": ctx.attr.language,
"target": "wasm32-wasip2",
"exec_model": "reactor",
"wasi_sdk": True,
"toolchain": "wasi-sdk",
"cxx_std": ctx.attr.cxx_std if ctx.attr.cxx_std else None,
Expand Down
2 changes: 2 additions & 0 deletions cpp/private/cpp_wasm_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def _cpp_wasm_binary_impl(ctx):

# Basic compiler flags for WASI Preview 2
compile_args.add("--target=wasm32-wasip2")
compile_args.add("-mexec-model=command") # CLI executable with main()

# Resolve sysroot path
if sysroot_files and sysroot_files.files:
Expand Down Expand Up @@ -237,6 +238,7 @@ def _cpp_wasm_binary_impl(ctx):
"name": ctx.label.name,
"language": ctx.attr.language,
"target": "wasm32-wasip2",
"exec_model": "command",
"wasi_sdk": True,
"toolchain": "wasi-sdk",
"cxx_std": ctx.attr.cxx_std if ctx.attr.cxx_std else None,
Expand Down