Skip to content

Commit 2106284

Browse files
committed
Improve docs on system support
1 parent 0bab52e commit 2106284

File tree

3 files changed

+135
-33
lines changed

3 files changed

+135
-33
lines changed

.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ insert_final_newline = true
1111
indent_style = space
1212
indent_size = 4
1313

14+
[*.py]
15+
indent_style = space
16+
indent_size = 4
17+
1418
[{Makefile,*.go}]
1519
indent_style = tab
1620
indent_size = 4

README.md

+39-33
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,45 @@ link with, and Go developers should just be able to import this directly.
1414

1515
## Supported Platforms
1616

17-
Requires Rust 1.51+, Requires Go 1.17+
18-
19-
Since this package includes a rust prebuilt dll, you cannot just import the go code,
20-
but need to be on a system that works with an existing dll. Currently this is Linux
21-
(tested on Ubuntu, Debian, and CentOS7) and MacOS. We have a build system for Windows,
22-
but it is [not supported][wasmer_support] by the Wasmer Singlepass backend which we rely upon.
23-
24-
[wasmer_support]: https://docs.wasmer.io/ecosystem/wasmer/wasmer-features
25-
26-
### Overview
27-
28-
| | [x86] | [x86_64] | [ARM32] | [ARM64] |
29-
| ------------- | ------------------- | ------------------- | -------------------- | -------------------- |
30-
| Linux (glibc) | ❌‍ || ❌‍ <sub>[#53]</sub> | ❌‍ <sub>[#53]</sub> |
31-
| Linux (muslc) | ❌‍ || ❌‍ <sub>[#53]</sub> | ❌‍ <sub>[#53]</sub> |
32-
| macOS | ❌‍ || ❌‍ <sub>[#53]</sub> | ❌‍ <sub>[#53]</sub> |
33-
| Windows | ❌ <sub>[#28]</sub> | ❌ <sub>[#28]</sub> | ❌ <sub>[#28]</sub> | ❌ <sub>[#28]</sub> |
34-
35-
[x86]: https://en.wikipedia.org/wiki/X86
36-
[x86_64]: https://en.wikipedia.org/wiki/X86-64
37-
[arm32]: https://en.wikipedia.org/wiki/AArch32
38-
[arm64]: https://en.wikipedia.org/wiki/AArch64
39-
[#28]: https://github.com/CosmWasm/wasmvm/issues/28
40-
[#53]: https://github.com/CosmWasm/wasmvm/issues/53
41-
42-
✅ Supported and activly maintained.
43-
44-
❌ Blocked by external dependency.
45-
46-
🤷‍ Not supported because nobody cares so far. Feel free to look into it.
47-
48-
This is all blocked on [wasmer support for singlepass backend](https://docs.wasmer.io/ecosystem/wasmer/wasmer-features#compiler-support-by-chipset).
49-
We can only move on these wasmvm issues when the upstream has support.
17+
Requires Rust 1.55+ and Go 1.17+.
18+
19+
The Rust implementation of the VM is compiled to a library called libwasmvm. This is
20+
then linked to the Go code when the final binary is built. For that reason not all
21+
systems supported by Go are supported by this project.
22+
23+
Linux (tested on Ubuntu, Debian, and CentOS7, Alpine) and macOS is supported.
24+
We are working on Windows (#288).
25+
26+
[#288]: https://github.com/CosmWasm/wasmvm/pull/288
27+
28+
### Builds of libwasmvm
29+
30+
Our system currently supports the following builds. In general we can only support targets
31+
that are [supported by Wasmer's singlepass backend](https://docs.wasmer.io/ecosystem/wasmer/wasmer-features#compiler-support-by-chipset),
32+
which for example excludes all 32 bit systems.
33+
34+
<!-- AUTO GENERATED BY libwasmvm_builds.py START -->
35+
36+
| OS family | Arch | Linking | Supported | Wasmer 2.2+ | Note |
37+
| --------------- | ------- | ------- | -------------------- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
38+
| Linux (glibc) | x86_64 | shared | ✅​libwasmvm.so | ✅​libwasmvm.so | |
39+
| Linux (glibc) | x86_64 | static | 🚫​ | 🚫​ | Would link libwasmvm statically but glibc dynamically as static glibc linking is not recommended. Potentially interesting for Osmosis. |
40+
| Linux (glibc) | aarch64 | shared | 🚫​ | ✅​libwasmvm.aarch64.so | |
41+
| Linux (glibc) | aarch64 | static | 🚫​ | 🚫​ | |
42+
| Linux (musl) | x86_64 | shared | 🚫​ | 🚫​ | Possible but not needed |
43+
| Linux (musl) | x86_64 | static | ✅​libwasmvm_muslc.a | ✅​libwasmvm_muslc.a | |
44+
| Linux (musl) | aarch64 | shared | 🚫​ | 🚫​ | Possible but not needed |
45+
| Linux (musl) | aarch64 | static | 🚫​ | ✅​libwasmvm_muslc.aarch64.a | |
46+
| macOS | x86_64 | shared | ✅​libwasmvm.dylib | ✅​libwasmvm.dylib | Fat/universal library with multiple archs (#294) |
47+
| macOS | x86_64 | static | 🚫​ | 🚫​ | |
48+
| macOS | aarch64 | shared | 🚫​ | ✅​libwasmvm.dylib | Fat/universal library with multiple archs (#294) |
49+
| macOS | aarch64 | static | 🚫​ | 🚫​ | |
50+
| Windows (mingw) | x86_64 | shared | 🏗​wasmvm.dll | 🏗​wasmvm.dll | See #288 |
51+
| Windows (mingw) | x86_64 | static | 🚫​ | 🚫​ | |
52+
| Windows (mingw) | aarch64 | shared | 🚫​ | 🚫​ | |
53+
| Windows (mingw) | aarch64 | static | 🚫​ | 🚫​ | |
54+
55+
<!-- AUTO GENERATED BY libwasmvm_builds.py END -->
5056

5157
## Docs
5258

docs/libwasmvm_builds.py

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
2+
3+
oss = ["Linux (glibc)", "Linux (musl)", "macOS", "Windows (mingw)"]
4+
cpus = ["x86_64", "aarch64"]
5+
build_types = ["shared", "static"]
6+
# libc = ["glibc", "musl"]
7+
8+
ZERO_WIDTH_SPACE = "\u200B"
9+
SUPPORTED = "✅" + ZERO_WIDTH_SPACE
10+
UNSUPPORTED = "🚫" + ZERO_WIDTH_SPACE
11+
UNKNOWN = "🤷" + ZERO_WIDTH_SPACE
12+
UNDER_CONSTRUCTION = "🏗" + ZERO_WIDTH_SPACE
13+
14+
def is_supported(os, cpu, build_type):
15+
if cpu == "aarch64":
16+
return UNSUPPORTED
17+
if os == "Windows (mingw)":
18+
if cpu == "x86_64" and build_type == "shared":
19+
return UNDER_CONSTRUCTION + "wasmvm.dll"
20+
else:
21+
return UNSUPPORTED
22+
if os == "macOS" and build_type == "static":
23+
return UNSUPPORTED
24+
if os == "macOS" and build_type == "shared":
25+
return SUPPORTED + "libwasmvm.dylib"
26+
if os == "Linux (musl)":
27+
if build_type == "static":
28+
return SUPPORTED + "libwasmvm_muslc.a"
29+
if build_type == "shared":
30+
return UNSUPPORTED
31+
if os == "Linux (glibc)":
32+
if build_type == "static":
33+
return UNSUPPORTED
34+
if build_type == "shared":
35+
return SUPPORTED + "libwasmvm.so"
36+
return UNKNOWN
37+
38+
def wasmer22_supported(os, cpu, build_type):
39+
if os == "Windows (mingw)":
40+
if cpu == "x86_64" and build_type == "shared":
41+
return UNDER_CONSTRUCTION + "wasmvm.dll"
42+
else:
43+
return UNSUPPORTED
44+
if os == "macOS" and build_type == "static":
45+
return UNSUPPORTED
46+
if os == "macOS" and build_type == "shared":
47+
return SUPPORTED + "libwasmvm.dylib"
48+
if os == "Linux (musl)":
49+
if build_type == "static":
50+
if cpu == "x86_64":
51+
return SUPPORTED + "libwasmvm_muslc.a"
52+
elif cpu == "aarch64":
53+
return SUPPORTED + "libwasmvm_muslc.aarch64.a"
54+
if build_type == "shared":
55+
return UNSUPPORTED
56+
if os == "Linux (glibc)":
57+
if build_type == "static":
58+
return UNSUPPORTED
59+
if build_type == "shared":
60+
if cpu == "x86_64":
61+
return SUPPORTED + "libwasmvm.so"
62+
elif cpu == "aarch64":
63+
return SUPPORTED + "libwasmvm.aarch64.so"
64+
return UNKNOWN
65+
66+
def get_note(os, cpu, build_type):
67+
if os == "Windows (mingw)" and cpu == "x86_64" and build_type == "shared":
68+
return "See #288"
69+
if os == "Linux (glibc)" and cpu == "x86_64" and build_type == "static":
70+
return "Would link libwasmvm statically but glibc dynamically as static glibc linking is not recommended. Potentially interesting for Osmosis."
71+
if os == "Linux (musl)" and build_type == "shared":
72+
return "Possible but not needed"
73+
if os == "macOS" and build_type == "shared":
74+
return "Fat/universal library with multiple archs (#294)"
75+
return ""
76+
77+
print("<!-- AUTO GENERATED BY libwasmvm_builds.py START -->")
78+
print("| OS family | Arch | Linking | Supported | Wasmer 2.2+ | Note |")
79+
print("| --------------- | ------- | ------- | ------------------- | ----------------------------- | ------- |")
80+
81+
for os in oss:
82+
for cpu in cpus:
83+
for build_type in build_types:
84+
s1 = is_supported(os, cpu, build_type)
85+
s2 = wasmer22_supported(os, cpu, build_type)
86+
note = get_note(os, cpu, build_type)
87+
print(
88+
"| {:<15} | {:<7} | {:<7} | {:<19} | {:<29} | {} |".format(
89+
os, cpu, build_type, s1, s2, note
90+
)
91+
)
92+
print("<!-- AUTO GENERATED BY libwasmvm_builds.py END -->")

0 commit comments

Comments
 (0)