Skip to content

Commit

Permalink
fix: makefile compatbile with osx (#8)
Browse files Browse the repository at this point in the history
* fix: makefile compatbile with osx

Prior to this commit, makefile used sed to compute metadata of the
project.

However, the sed command is not uniform between unix and osx platforms,
producing different results. This commit removes the dynamic computation
of version and project name.

* update makefile & wasm

* fix manifest shasum
  • Loading branch information
vlopes11 authored Dec 7, 2023
1 parent 369ec86 commit 0768850
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
29 changes: 13 additions & 16 deletions external/sov-wasm/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
PROJECT := $(shell sed -n '0,/name\s*=\s*"\(.*\)"/s/name\s*=\s*"\(.*\)"/\1/p' Cargo.toml)
VERSION := $(shell sed -n '0,/version\s*=\s*"\(.*\)"/s/version\s*=\s*"\(.*\)"/\1/p' Cargo.toml)
PROJECT := "sov-wasm"
FLAGS := RUSTFLAGS="$(RUSTFLAGS) --remap-path-prefix $(HOME)= -C link-args=-zstack-size=65536"
WASM := "target/wasm32-wasi/release/$(shell sed -n '0,/name\s*=\s*"\(.*\)"/s/name\s*=\s*"\(.*\)"/\1/p' Cargo.toml | sed 's/-/_/g').wasm"
WAT := "assets/$(PROJECT)-$(VERSION).wat"
WAT_THIN := "assets/$(PROJECT)-$(VERSION)-thin.wat"
PACKAGE := "assets/$(PROJECT)-$(VERSION).wasm"
PACKAGE_SHORT := "assets/$(PROJECT).wasm"
PACKAGE_OPTIMIZED := "assets/$(PROJECT)-$(VERSION)-initial-optimized.wasm"
PACKAGE_INITIAL_OPTIMIZED := "assets/$(PROJECT)-$(VERSION)-initial-optimized.wasm"
PACKAGE_INITIAL_THIN := "assets/$(PROJECT)-$(VERSION)-initial-thin.wasm"
PACKAGE_RESTORED := "assets/$(PROJECT)-$(VERSION)-restored.wasm"
PACKAGE_RESTORED_OPTIMIZED := "assets/$(PROJECT)-$(VERSION)-restored-optimized.wasm"
PACKAGE_THIN := "assets/$(PROJECT)-$(VERSION)-thin.wasm"
WASM := "target/wasm32-wasi/release/sov_wasm.wasm"
WAT := "assets/$(PROJECT).wat"
WAT_THIN := "assets/$(PROJECT)-thin.wat"
PACKAGE := "assets/$(PROJECT).wasm"
PACKAGE_OPTIMIZED := "assets/$(PROJECT)-initial-optimized.wasm"
PACKAGE_INITIAL_OPTIMIZED := "assets/$(PROJECT)-initial-optimized.wasm"
PACKAGE_INITIAL_THIN := "assets/$(PROJECT)-initial-thin.wasm"
PACKAGE_RESTORED := "assets/$(PROJECT)-restored.wasm"
PACKAGE_RESTORED_OPTIMIZED := "assets/$(PROJECT)-restored-optimized.wasm"
PACKAGE_THIN := "assets/$(PROJECT)-thin.wasm"

wasm: ## Build the WASM files
@$(FLAGS) cargo build --release --target wasm32-wasi
Expand All @@ -27,9 +25,8 @@ wasm: ## Build the WASM files
$(WAT) \
$(PACKAGE_RESTORED) \
$(PACKAGE_RESTORED_OPTIMIZED)
@mv $(PACKAGE_THIN) $(PACKAGE_SHORT)
@rm $(PACKAGE)
@echo "Package created: $(PACKAGE_SHORT)"
@mv $(PACKAGE_THIN) $(PACKAGE)
@echo "Package created: $(PACKAGE)"

help: ## Display this help screen
@grep -h \
Expand Down
Binary file modified external/sov-wasm/assets/sov-wasm.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/Sovereign-Labs/sov-snap.git"
},
"source": {
"shasum": "4o0iXdvcsoPhEgfJ41LTGihawXvb1EHJ67P7GNnXgbk=",
"shasum": "1G80rwa6ZQIDDxiY0sKohNoXRYfvzAbIT4/i1oW5pU8=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/module.ts

Large diffs are not rendered by default.

0 comments on commit 0768850

Please sign in to comment.