Skip to content

Commit

Permalink
Merge pull request #418 from CosmWasm/version-check-binary
Browse files Browse the repository at this point in the history
Add libwasmvm check to demo binary
  • Loading branch information
webmaster128 authored Apr 12, 2023
2 parents 7db6c12 + c2855c9 commit 890f653
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/internal/api/lib*.a

# artifacts from compile tests
/build/
/demo
tmp
a.out
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ build-rust-release:

build-go:
go build ./...
go build -o build/demo ./cmd/demo

test:
# Use package list mode to include all subdirectores. The -count=1 turns off caching.
Expand Down
10 changes: 10 additions & 0 deletions cmd/demo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ const (
// This is just a demo to ensure we can compile a static go binary
func main() {
file := os.Args[1]

if file == "version" {
libwasmvmVersion, err := wasmvm.LibwasmvmVersion()
if err != nil {
panic(err)
}
fmt.Printf("libwasmvm: %s\n", libwasmvmVersion)
return
}

fmt.Printf("Running %s...\n", file)
bz, err := ioutil.ReadFile(file)
if err != nil {
Expand Down

0 comments on commit 890f653

Please sign in to comment.