-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: change tag name for static build #49
Merged
whylee259
merged 2 commits into
Finschia:main
from
whylee259:feat/change-tag-name-for-static-build
Oct 1, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,6 @@ lib*.a | |
# artifacts from compile tests | ||
artifacts/ | ||
muslc.exe | ||
static.exe | ||
tmp | ||
a.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,13 +61,17 @@ release-build-alpine: | |
# build the muslc *.a file | ||
docker run --rm -v $(shell pwd):/code $(BUILDERS_PREFIX):alpine | ||
# try running go tests using this lib with muslc | ||
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code -w /code $(BUILDERS_PREFIX):alpine go build -tags muslc . | ||
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code -w /code $(BUILDERS_PREFIX):alpine go test -tags='muslc mocks' ./api ./types | ||
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code -w /code $(BUILDERS_PREFIX):alpine go build -tags static . | ||
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code -w /code $(BUILDERS_PREFIX):alpine go test -tags='static mocks' ./api ./types | ||
|
||
# Creates a release build in a containerized build environment of the static library for glibc Linux (.a) | ||
release-build-linux-static: | ||
rm -rf target/release | ||
# build the glibc *.a file | ||
docker run --rm -v $(shell pwd):/code $(BUILDERS_PREFIX):static | ||
# try running go tests using this lib with glibc | ||
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code -w /code $(BUILDERS_PREFIX):static go build -tags static . | ||
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code -w /code $(BUILDERS_PREFIX):static go test -tags='static mocks' ./api ./types | ||
|
||
# Creates a release build in a containerized build environment of the shared library for glibc Linux (.so) | ||
release-build-linux: | ||
|
@@ -88,10 +92,18 @@ release-build: | |
|
||
test-alpine: release-build-alpine | ||
# build a go binary | ||
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code -w /code $(BUILDERS_PREFIX)-alpine go build -tags='muslc mocks' -o muslc.exe ./cmd | ||
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code -w /code $(BUILDERS_PREFIX):alpine go build -tags='static mocks' -o muslc.exe ./cmd | ||
# run static binary in an alpine machines (not dlls) | ||
docker run --rm --read-only -v $(shell pwd):/code -w /code alpine:3.12 ./muslc.exe ./api/testdata/hackatom.wasm | ||
docker run --rm --read-only -v $(shell pwd):/code -w /code alpine:3.11 ./muslc.exe ./api/testdata/hackatom.wasm | ||
docker run --rm --read-only -v $(shell pwd):/code -w /code alpine:3.10 ./muslc.exe ./api/testdata/hackatom.wasm | ||
# run static binary locally if you are on Linux | ||
# ./muslc.exe ./api/testdata/hackatom.wasm | ||
|
||
test-static: release-build-linux-static | ||
# build a go binary | ||
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code -w /code $(BUILDERS_PREFIX):static go build -tags='static mocks' -o static.exe ./cmd | ||
# run static binary in an alpine machines (not dlls) | ||
docker run --rm --read-only -v $(shell pwd):/code -w /code centos ./static.exe ./api/testdata/hackatom.wasm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about choice a more specific the centos version? |
||
# run static binary locally if you are on Linux | ||
# ./static.exe ./api/testdata/hackatom.wasm |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
# Versioned by a simple counter that is not bound to a specific CosmWasm version | ||
# See builders/README.md | ||
BUILDERS_PREFIX := cosmwasm/go-ext-builder:0006 | ||
BUILDERS_PREFIX := line/wasmvm-builder | ||
|
||
.PHONY: docker-image-centos7 | ||
docker-image-centos7: | ||
docker build . -t $(BUILDERS_PREFIX)-centos7 -f ./Dockerfile.centos7 | ||
docker build . -t $(BUILDERS_PREFIX):centos7 -f ./Dockerfile.centos7 | ||
|
||
.PHONY: docker-image-cross | ||
docker-image-cross: | ||
docker build . -t $(BUILDERS_PREFIX)-cross -f ./Dockerfile.cross | ||
docker build . -t $(BUILDERS_PREFIX):cross -f ./Dockerfile.cross | ||
|
||
.PHONY: docker-image-alpine | ||
docker-image-alpine: | ||
docker build . -t $(BUILDERS_PREFIX)-alpine -f ./Dockerfile.alpine | ||
docker build . -t $(BUILDERS_PREFIX):alpine -f ./Dockerfile.alpine | ||
|
||
.PHONY: docker-image-static | ||
docker-image-static: | ||
docker build . -t $(BUILDERS_PREFIX):static -f ./Dockerfile.static | ||
|
||
.PHONY: docker-images | ||
docker-images: docker-image-centos7 docker-image-cross docker-image-alpine | ||
docker-images: docker-image-centos7 docker-image-cross docker-image-alpine docker-image-static | ||
|
||
.PHONY: docker-publish | ||
docker-publish: docker-images | ||
docker push $(BUILDERS_PREFIX)-cross | ||
docker push $(BUILDERS_PREFIX)-centos7 | ||
docker push $(BUILDERS_PREFIX)-alpine | ||
# TODO publish images to registry | ||
# .PHONY: docker-publish | ||
# docker-publish: docker-images | ||
# docker push $(BUILDERS_PREFIX):cross | ||
# docker push $(BUILDERS_PREFIX):centos7 | ||
# docker push $(BUILDERS_PREFIX):alpine | ||
# docker push $(BUILDERS_PREFIX):static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
#!/bin/sh | ||
|
||
TARGET_NAME="${1:-static}" | ||
|
||
cargo build --release --example staticlib | ||
cp /code/target/release/examples/libstaticlib.a "/code/api/libwasmvm_$TARGET_NAME.a" | ||
cp /code/target/release/examples/libstaticlib.a "/code/api/libwasmvm_static.a" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it right that 'dlls' to windows dlls? It seems unfamiliar Windows terminology in the linux environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I will fix the comment in another PR.