Skip to content

Commit 91687fa

Browse files
authored
CLI component no longer depends on wasi:config (#3)
The CLI is composed with the valkey-ops component rather than the valkey-client component. Signed-off-by: Scott Andrews <scott@andrews.me>
1 parent 4792318 commit 91687fa

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
run: cargo binstall --force cargo-component
2525
- name: Install wac
2626
run: cargo binstall --force wac-cli
27+
- name: Install wasmtime
28+
run: cargo binstall --force wasmtime-cli
2729
- name: Install wkg
2830
run: cargo binstall --force wkg
2931
- name: Sync wit
@@ -41,6 +43,10 @@ jobs:
4143
name: components.tar
4244
path: components.tar
4345
retention-days: 7
46+
- name: Start Valkey service
47+
run: docker run --rm --name valkey -d -p 6379:6379 valkey/valkey:8
48+
- name: Test
49+
run: make test
4450

4551
publish:
4652
if: startsWith(github.ref, 'refs/tags/')

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/lib/*.wasm
22
/target
33
.DS_Store
4+
*.rdb

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ define BUILD_COMPONENT
3232
lib/$1.wasm: $4 Cargo.toml Cargo.lock components/wit/deps $(shell find components/wit -type f) $(shell find components/$1 -type f)
3333
cargo $3 component build -p $1 --target $2 --release
3434
$(if $(findstring $1,cli),
35-
wac plug target/$2/release/$(subst -,_,$1).wasm --plug lib/valkey-client.wasm -o lib/$1.wasm,
35+
wac plug target/$2/release/$(subst -,_,$1).wasm --plug lib/valkey-ops.wasm -o lib/$1.wasm,
3636
cp target/$2/release/$(subst -,_,$1).wasm lib/$1.wasm)
3737
cp components/$1/README.md lib/$1.wasm.md
3838

3939
lib/$1.debug.wasm: $5 Cargo.toml Cargo.lock wit/deps $(shell find components/$1 -type f)
4040
cargo +nightly component build -p $1 --target wasm32-wasip2
4141
$(if $(findstring $1,cli),
42-
wac plug target/$2/debug/$(subst -,_,$1).wasm --plug lib/valkey-client.debug.wasm -o lib/$1.debug.wasm,
42+
wac plug target/$2/debug/$(subst -,_,$1).wasm --plug lib/valkey-ops.debug.wasm -o lib/$1.debug.wasm,
4343
cp target/wasm32-wasip2/debug/$(subst -,_,$1).wasm lib/$1.debug.wasm)
4444
cp components/$1/README.md lib/$1.debug.wasm.md
4545

4646
endef
4747

4848
$(eval $(call BUILD_COMPONENT,valkey-ops,wasm32-unknown-unknown))
4949
$(eval $(call BUILD_COMPONENT,keyvalue-to-valkey,wasm32-unknown-unknown))
50-
$(eval $(call BUILD_COMPONENT,cli,wasm32-wasip2,+nightly,lib/valkey-client.wasm,lib/valkey-client.debug.wasm))
50+
$(eval $(call BUILD_COMPONENT,cli,wasm32-wasip2,+nightly,lib/valkey-ops.wasm,lib/valkey-ops.debug.wasm))
5151

5252
lib/valkey-client.wasm: components/valkey-client.wac lib/valkey-ops.wasm lib/keyvalue-to-valkey.wasm
5353
wac compose -o lib/valkey-client.wasm \
@@ -72,6 +72,10 @@ wit/deps: wkg.toml $(shell find wit -type f -name "*.wit" -not -path "deps")
7272
components/wit/deps: wit/deps components/wkg.toml $(shell find components/wit -type f -name "*.wit" -not -path "deps")
7373
(cd components && wkg wit fetch)
7474

75+
.PHONY: test
76+
test:
77+
@$(MAKE) run cmd="hello"
78+
7579
.PHONY: publish
7680
publish: $(shell find lib -type f -name "*.wasm" | sed -e 's:^lib/:publish-:g')
7781

0 commit comments

Comments
 (0)