From 967a695a3530990c480a9a9b5373a617bf06fdab Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Thu, 18 May 2023 18:21:44 +0200 Subject: [PATCH] fix: module path --- README.md | 2 +- buf.gen.yaml | 2 +- entrypoint.go | 4 ++-- examples/hello_world_go/go.mod | 7 ------- examples/hello_world_go/main.go | 2 +- examples/hello_world_go/main_test.go | 4 ++-- examples/hello_world_go/module/hello_world.go | 2 +- integration/go.mod | 3 --- integration/test_host.go | 6 +++--- logger.go | 4 ++-- protocol/generated/rpc/v1/executor.pb.go | 20 +++++++++---------- state_proxy.go | 4 ++-- 12 files changed, 25 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index f5db029..406d368 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This module provides glue code to implement a buildr WASI module easily and quic To implement a new buildr WASI module: 1. Create a new Go module -1. Reference this SDK (`go get -u code.icb4dc0.de/buildr/wasi-module-sdk`) +1. Reference this SDK (`go get -u code.icb4dc0.de/buildr/wasi-module-sdk-go`) 1. create a `main.go` with an **empty** `main()` function 1. implement the `sdk.Module` interface for your module 1. implement an `init()` function that registers your module and the SDK's type registry diff --git a/buf.gen.yaml b/buf.gen.yaml index 797355f..95aa392 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -2,7 +2,7 @@ version: v1 managed: enabled: true go_package_prefix: - default: code.icb4dc0.de/buildr/wasi-module-sdk/internal + default: code.icb4dc0.de/buildr/wasi-module-sdk-go/internal except: - buf.build/googleapis/googleapis plugins: diff --git a/entrypoint.go b/entrypoint.go index 8552f22..0d9d320 100644 --- a/entrypoint.go +++ b/entrypoint.go @@ -6,8 +6,8 @@ import ( "github.com/mailru/easyjson" _ "github.com/tetratelabs/tinymem" - "code.icb4dc0.de/buildr/wasi-module-sdk/mem" - rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk/protocol/generated/rpc/v1" + "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" ) var defaultRegistry = NewTypeRegistry() diff --git a/examples/hello_world_go/go.mod b/examples/hello_world_go/go.mod index 494427e..c3def56 100644 --- a/examples/hello_world_go/go.mod +++ b/examples/hello_world_go/go.mod @@ -3,17 +3,10 @@ module hello_world go 1.20 require ( - code.icb4dc0.de/buildr/wasi-module-sdk-go v0.0.0-00010101000000-000000000000 - code.icb4dc0.de/buildr/wasi-module-sdk/integration v0.0.0-00010101000000-000000000000 github.com/mailru/easyjson v0.7.7 golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 ) -replace ( - code.icb4dc0.de/buildr/wasi-module-sdk => ../../ - code.icb4dc0.de/buildr/wasi-module-sdk/integration => ../../integration -) - require ( github.com/google/uuid v1.3.0 // indirect github.com/josharian/intern v1.0.0 // indirect diff --git a/examples/hello_world_go/main.go b/examples/hello_world_go/main.go index 9ac87c0..67cc06e 100644 --- a/examples/hello_world_go/main.go +++ b/examples/hello_world_go/main.go @@ -3,7 +3,7 @@ package main //go:generate tinygo build -o hello_world.wasm -scheduler=none -gc=leaking --no-debug -target=wasi main.go import ( - sdk "code.icb4dc0.de/buildr/wasi-module-sdk" + sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go" "hello_world/module" ) diff --git a/examples/hello_world_go/main_test.go b/examples/hello_world_go/main_test.go index 9a7b041..2f417a4 100644 --- a/examples/hello_world_go/main_test.go +++ b/examples/hello_world_go/main_test.go @@ -1,8 +1,8 @@ package main_test import ( - sdk "code.icb4dc0.de/buildr/wasi-module-sdk" - "code.icb4dc0.de/buildr/wasi-module-sdk/integration" + sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go" + "code.icb4dc0.de/buildr/wasi-module-sdk-go/integration" "context" _ "embed" "golang.org/x/exp/slog" diff --git a/examples/hello_world_go/module/hello_world.go b/examples/hello_world_go/module/hello_world.go index b80637f..4e0fcd0 100644 --- a/examples/hello_world_go/module/hello_world.go +++ b/examples/hello_world_go/module/hello_world.go @@ -3,7 +3,7 @@ package module //go:generate go run -mod=mod github.com/mailru/easyjson/easyjson -all hello_world.go import ( - sdk "code.icb4dc0.de/buildr/wasi-module-sdk" + sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go" "golang.org/x/exp/slog" ) diff --git a/integration/go.mod b/integration/go.mod index b2d5b85..6c10861 100644 --- a/integration/go.mod +++ b/integration/go.mod @@ -3,7 +3,6 @@ module code.icb4dc0.de/buildr/wasi-module-sdk-go/integration go 1.20 require ( - code.icb4dc0.de/buildr/wasi-module-sdk-go v0.0.0-00010101000000-000000000000 github.com/google/uuid v1.3.0 github.com/tetratelabs/wazero v1.1.0 golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 @@ -15,5 +14,3 @@ require ( github.com/tetratelabs/tinymem v0.1.0 // indirect google.golang.org/protobuf v1.30.0 // indirect ) - -replace code.icb4dc0.de/buildr/wasi-module-sdk => ../ diff --git a/integration/test_host.go b/integration/test_host.go index d0e85e4..c626f77 100644 --- a/integration/test_host.go +++ b/integration/test_host.go @@ -8,7 +8,7 @@ import ( "os" "time" - "code.icb4dc0.de/buildr/wasi-module-sdk/mem" + "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" "github.com/google/uuid" "github.com/tetratelabs/wazero" @@ -16,8 +16,8 @@ import ( "github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1" "golang.org/x/exp/slog" - sdk "code.icb4dc0.de/buildr/wasi-module-sdk" - rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk/protocol/generated/rpc/v1" + sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go" + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" ) func StateKey(cat sdk.Category, modName, key string) string { diff --git a/logger.go b/logger.go index 6e12fec..9234518 100644 --- a/logger.go +++ b/logger.go @@ -8,8 +8,8 @@ import ( "golang.org/x/exp/slog" - "code.icb4dc0.de/buildr/wasi-module-sdk/mem" - rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk/protocol/generated/rpc/v1" + "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" ) var _ slog.Handler = (*WASIHandler)(nil) diff --git a/protocol/generated/rpc/v1/executor.pb.go b/protocol/generated/rpc/v1/executor.pb.go index c517572..70791ba 100644 --- a/protocol/generated/rpc/v1/executor.pb.go +++ b/protocol/generated/rpc/v1/executor.pb.go @@ -865,19 +865,19 @@ var file_rpc_v1_executor_proto_rawDesc = []byte{ 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0xb6, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0xb9, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x63, 0x62, 0x34, 0x64, 0x63, 0x30, 0x2e, 0x64, 0x65, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2f, 0x77, 0x61, 0x73, 0x69, 0x2d, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x42, - 0x52, 0x58, 0xaa, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x52, 0x70, 0x63, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x19, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x42, 0x52, 0x58, 0xaa, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x52, + 0x70, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, + 0x70, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, + 0x70, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/state_proxy.go b/state_proxy.go index 579f14e..b67d160 100644 --- a/state_proxy.go +++ b/state_proxy.go @@ -3,8 +3,8 @@ package sdk import ( "errors" - "code.icb4dc0.de/buildr/wasi-module-sdk/mem" - rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk/protocol/generated/rpc/v1" + "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" ) type StateProxy struct {