-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathlibwasmvm_builds.py
81 lines (74 loc) · 3.25 KB
/
libwasmvm_builds.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# In the repo root run python3 docs/libwasmvm_builds.py
# and paste output into README.md
oss = ["Linux (glibc)", "Linux (musl)", "macOS", "Windows (mingw)"]
cpus = ["x86_64", "aarch64"]
build_types = ["shared", "static"]
# libc = ["glibc", "musl"]
ZERO_WIDTH_SPACE = "\u200B"
SUPPORTED = "✅" + ZERO_WIDTH_SPACE
UNSUPPORTED = "🚫" + ZERO_WIDTH_SPACE
UNKNOWN = "🤷" + ZERO_WIDTH_SPACE
UNDER_CONSTRUCTION = "🏗" + ZERO_WIDTH_SPACE
def wasmer22_supported(os, cpu, build_type):
if os == "Windows (mingw)":
if cpu == "x86_64" and build_type == "shared":
return UNDER_CONSTRUCTION + "wasmvm.dll"
else:
return UNSUPPORTED
if os == "macOS":
if build_type == "static":
return SUPPORTED + "libwasmvmstatic_darwin.a"
if build_type == "shared":
return SUPPORTED + "libwasmvm.dylib"
if os == "Linux (musl)":
if build_type == "static":
if cpu == "x86_64":
return SUPPORTED + "libwasmvm_muslc.x86_64.a"
elif cpu == "aarch64":
return SUPPORTED + "libwasmvm_muslc.aarch64.a"
if build_type == "shared":
return UNSUPPORTED
if os == "Linux (glibc)":
if build_type == "static":
return UNSUPPORTED
if build_type == "shared":
if cpu == "x86_64":
return SUPPORTED + "libwasmvm.x86_64.so"
elif cpu == "aarch64":
return SUPPORTED + "libwasmvm.aarch64.so"
return UNKNOWN
def get_note(os, cpu, build_type):
if os == "Linux (glibc)" and cpu == "x86_64" and build_type == "static":
return "Would link libwasmvm statically but glibc dynamically as static glibc linking is not recommended. Potentially interesting for Osmosis."
if os == "Linux (musl)" and build_type == "shared":
return "Possible but not needed"
if os == "macOS" and build_type == "shared":
return "Fat/universal library with multiple archs ([#294])"
if os == "macOS" and build_type == "static":
return "Fat/universal library with multiple archs ([#407])"
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
[#407]: https://github.com/CosmWasm/wasmvm/issues/407
"""
print("<!-- AUTO GENERATED BY libwasmvm_builds.py START -->")
print("| OS family | Arch | Linking | Supported | Note |")
print("| --------------- | ------- | ------- | ----------------------------- | ------- |")
for os in oss:
for cpu in cpus:
for build_type in build_types:
s = wasmer22_supported(os, cpu, build_type)
note = get_note(os, cpu, build_type)
print(
"| {:<15} | {:<7} | {:<7} | {:<29} | {} |".format(
os, cpu, build_type, s, note
)
)
print(get_links())
print("<!-- AUTO GENERATED BY libwasmvm_builds.py END -->")