finschia / wasmvm Goto Github PK
View Code? Open in Web Editor NEWGo bindings to the CosmWasm smart contract framework. In particular, it allows you to easily compile, initialize, and execute these contracts from Go.
License: Apache License 2.0
Go bindings to the CosmWasm smart contract framework. In particular, it allows you to easily compile, initialize, and execute these contracts from Go.
License: Apache License 2.0
wasmvm/.github/workflows/release.yml
Lines 73 to 76 in 46ee232
It adds only 2 binary, it needs to add libwasmvm.dylib
, too.
line -> finschia
Add a CI which automatic build the shared libraries.
The shared libraries are referenced by other project like finschia for building.
we need to compile shared library every commit is added if we want to apply the changes of wasmvm, but it doesn't seems to do that often. So I propose adding CI to automatically build the shared libraries.
The cosmwasm/wasmvm
already do auto commit it.
https://github.com/CosmWasm/wasmvm/blob/1638725b25d799f078d053391945399cb35664b1/.circleci/config.yml#L282-L322
deploy_to_git:
machine:
image: ubuntu-2004:2022.10.1
resource_class: xlarge
steps:
- add_ssh_keys:
fingerprints:
# Custom read/write deployment key with private key stored on CircleCI
# (see https://app.circleci.com/settings/project/github/CosmWasm/wasmvm/ssh and https://github.com/CosmWasm/wasmvm/settings/keys)
- "31:de:e5:84:1b:12:81:94:aa:06:50:c0:cb:bd:79:f0"
- checkout
- run:
name: Build shared library for Linux
command: make release-build-linux
- run:
name: Build shared library for macOS
command: make release-build-macos
# Shared libraries for Windows (.dll) currently do not work (https://github.com/CosmWasm/wasmvm/issues/389)
# and .dll builds are not deterministic.
# Deactivating this step to avoid polluting the git hostory.
#
# - run:
# name: Build shared library for Windows
# command: make release-build-windows
- run:
name: Debug build results
command: ls -l ./internal/api
- run:
name: Configure git user
# This is not a GitHub user and no permissions can be configured other than "push access", which
# we can configure for Deploy keys at https://github.com/CosmWasm/wasmvm/settings/keys
command: |
git config user.email "[email protected]"
git config user.name "Deployer"
- run:
name: Check-in and push new libraries
command: |
git status
git add ./internal/api
git commit --allow-empty -m '[skip ci] Built release libraries'
git push origin $CIRCLE_BRANCH
https://github.com/line/wasmvm/blob/9ca6a90d72b4075ab0cdfa5aaf7ee700bfc6a8d8/lib.go#L161
does not cost gas in
https://github.com/line/wasmvm/blob/9ca6a90d72b4075ab0cdfa5aaf7ee700bfc6a8d8/lib.go#L149
But it should be costed.
There might be an issue with finschia-auto-pr operating correctly.
In #135, a PR was created even though the shared library was up to date.
We need to check if there's a difference between the libwasmvm generated locally and the one generated through GitHub actions. If a problem is found, it needs to be corrected.
The related file is https://github.com/Finschia/wasmvm/blob/main/.github/workflows/deploy_to_git.yml
Currently, libwasmvm_static.so is excluded from the remote repository by gitignore. Therefore, ci that uses static lib must be built locally each time. Let's upload the static lib to remote as well.
---- cache::tests::init_cache_writes_error stdout ----
thread 'cache::tests::init_cache_writes_error' panicked at 'assertion failed: `(left == right)`
left: `"Error calling the VM: Cache error: Error creating directory broken\0dir/state: file name contained an unexpected NUL byte"`,
right: `"Error calling the VM: Cache error: Error creating directory broken\0dir/state: data provided contains a nul byte"`', src/cache.rs:375:9
If we decide to prepare our Docker image, we will respond. If not, please close.
I need aarch64-linux-musl-cross for the wasmer build, but the github actions refuse to get it from musl.cc using wget.
Therefore, I use the image that already contains this as a builder and copy and use it.
https://github.com/line/wasmvm/pull/71/files#diff-a3e40ace4c88526a8320154b12cfc19c7b048c6fd2ea67ddddb3e4849711f249R10
If we should prepare our own Docker image beforehand without using this, then I think this is a matter for another issue.
Originally posted by @shiki-tak in #71 (comment)
https://github.com/Finschia/wasmvm/actions/runs/5963271098/job/16176122794
has some problems
It has the same problem as Finschia/cosmwasm#72.
Since developer may push commits to auto PR, so it is better to add a label to make a warning.
So we need add a new label for the auto PR.
replace github.com/line
with github.com/Finschia
Replace the api/testdata and the document
https://github.com/line/wasmvm/blob/a1e53772733b3691aa44220c40122db532502f74/api/testdata/README.md
Cache
is a struct contains the C pointer of the cache.
type Cache struct {
ptr *C.cache_t
}
So, this is not much big struct. And, when there is cache Cache
and go pass it to C in GetContractEnv
as a form of &cache
, it issues an error as bellow. (for example https://github.com/line/wasmvm/actions/runs/4203381739/jobs/7292793005#step:7:105)
fatal error: Go pointer stored into non-Go memory
Now, we do not meet it in x/wasm, but it happens when we make some tests like https://github.com/loloicci/wasmvm/blob/59041273a09d3a4c7dbddd3fafc3c1f14260ef7e/api/lib_test.go#L1228-L1237.
So I suggest changing the arg type of GetContractEnv's 2nd arg from *Cache
to Cache
.
Refer: Finschia/finschia#228
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.