Skip to content

Deactivate .dll build #390

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

Merged
merged 4 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,13 @@ jobs:
- run:
name: Build shared library for macOS
command: make release-build-macos
- run:
name: Build shared library for Windows
command: make release-build-windows
# 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
Expand Down
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# wasmvm

This is a wrapper around the [CosmWasm VM](https://github.com/CosmWasm/cosmwasm/tree/main/packages/vm).
It allows you to compile, initialize and execute CosmWasm smart contracts
from Go applications, in particular from [x/wasm](https://github.com/CosmWasm/wasmd/tree/master/x/wasm).
This is a wrapper around the
[CosmWasm VM](https://github.com/CosmWasm/cosmwasm/tree/main/packages/vm). It
allows you to compile, initialize and execute CosmWasm smart contracts from Go
applications, in particular from
[x/wasm](https://github.com/CosmWasm/wasmd/tree/master/x/wasm).

## Structure

Expand Down Expand Up @@ -93,12 +95,12 @@ CGO_ENABLED=0 go build .
See [COMPILER_VERSIONS.md](docs/COMPILER_VERSIONS.md) for information on Go and
Rust compiler support.

The Rust implementation of the VM is compiled to a library called libwasmvm. This is
then linked to the Go code when the final binary is built. For that reason not all
systems supported by Go are supported by this project.
The Rust implementation of the VM is compiled to a library called libwasmvm.
This is then linked to the Go code when the final binary is built. For that
reason not all systems supported by Go are supported by this project.

Linux (tested on Ubuntu, Debian, and CentOS7, Alpine) and macOS is supported.
We are working on Windows (#288).
Linux (tested on Ubuntu, Debian, and CentOS7, Alpine) and macOS is supported. We
are working on Windows (#288).

[#288]: https://github.com/CosmWasm/wasmvm/pull/288

Expand All @@ -125,12 +127,13 @@ which for example excludes all 32 bit systems.
| macOS | x86_64 | static | 🚫​ | |
| macOS | aarch64 | shared | ✅​libwasmvm.dylib | Fat/universal library with multiple archs ([#294]) |
| macOS | aarch64 | static | 🚫​ | |
| Windows (mingw) | x86_64 | shared | ​wasmvm.dll | |
| Windows (mingw) | x86_64 | static | 🚫​ | |
| Windows (mingw) | aarch64 | shared | 🚫​ | |
| Windows (mingw) | aarch64 | static | 🚫​ | |
| Windows (mingw) | x86_64 | shared | 🏗​wasmvm.dll | Shared library linking not working on Windows ([#389]) |
| Windows (mingw) | x86_64 | static | 🚫​ | Unclear if this can work using a cross compiler; needs research on .lib (MSVC toolchain) vs. .a (GNU toolchain). ([#389]) |
| Windows (mingw) | aarch64 | shared | 🚫​ | Shared library linking not working on Windows ([#389]) |
| Windows (mingw) | aarch64 | static | 🚫​ | Unclear if this can work using a cross compiler; needs research on .lib (MSVC toolchain) vs. .a (GNU toolchain). ([#389]) |

[#294]: https://github.com/CosmWasm/wasmvm/pull/294
[#389]: https://github.com/CosmWasm/wasmvm/issues/389

<!-- AUTO GENERATED BY libwasmvm_builds.py END -->

Expand All @@ -146,18 +149,19 @@ Please read the [Documentation](./spec/Index.md) to understand both the general

## Development

There are two halfs to this code - go and rust. The first step is to ensure that there is
a proper dll built for your platform. This should be `api/libwasmvm.X`, where X is:
There are two halfs to this code - go and rust. The first step is to ensure that
there is a proper dll built for your platform. This should be `api/libwasmvm.X`,
where X is:

- `so` for Linux systems
- `dylib` for MacOS
- `dll` for Windows - Not currently supported due to upstream dependency

If this is present, then `make test` will run the Go test suite and you can import this code freely.
If it is not present you will have to build it for your system, and ideally add it to this repo
with a PR (on your fork). We will set up a proper CI system for building these binaries,
but we are not there yet.
If this is present, then `make test` will run the Go test suite and you can
import this code freely. If it is not present you will have to build it for your
system, and ideally add it to this repo with a PR (on your fork). We will set up
a proper CI system for building these binaries, but we are not there yet.

To build the rust side, try `make build-rust` and wait for it to compile. This depends on
`cargo` being installed with `rustc` version 1.47+. Generally, you can just use `rustup` to
install all this with no problems.
To build the rust side, try `make build-rust` and wait for it to compile. This
depends on `cargo` being installed with `rustc` version 1.47+. Generally, you
can just use `rustup` to install all this with no problems.
7 changes: 6 additions & 1 deletion docs/libwasmvm_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def wasmer22_supported(os, cpu, build_type):
if os == "Windows (mingw)":
if cpu == "x86_64" and build_type == "shared":
return SUPPORTED + "wasmvm.dll"
return UNDER_CONSTRUCTION + "wasmvm.dll"
else:
return UNSUPPORTED
if os == "macOS" and build_type == "static":
Expand Down Expand Up @@ -47,11 +47,16 @@ def get_note(os, cpu, build_type):
return "Possible but not needed"
if os == "macOS" and build_type == "shared":
return "Fat/universal library with multiple archs ([#294])"
if os == "Windows (mingw)" and build_type == "shared":
return "Shared library linking not working on Windows ([#389])"
if os == "Windows (mingw)" and build_type == "static":
return "Unclear if this can work using a cross compiler; needs research on .lib (MSVC toolchain) vs. .a (GNU toolchain). ([#389])"
return ""

def get_links():
return """
[#294]: https://github.com/CosmWasm/wasmvm/pull/294
[#389]: https://github.com/CosmWasm/wasmvm/issues/389
"""

print("<!-- AUTO GENERATED BY libwasmvm_builds.py START -->")
Expand Down
Binary file removed internal/api/wasmvm.dll
Binary file not shown.