-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bab52e
commit 2106284
Showing
3 changed files
with
135 additions
and
33 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
|
||
|
||
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 is_supported(os, cpu, build_type): | ||
if cpu == "aarch64": | ||
return UNSUPPORTED | ||
if os == "Windows (mingw)": | ||
if cpu == "x86_64" and build_type == "shared": | ||
return UNDER_CONSTRUCTION + "wasmvm.dll" | ||
else: | ||
return UNSUPPORTED | ||
if os == "macOS" and build_type == "static": | ||
return UNSUPPORTED | ||
if os == "macOS" and build_type == "shared": | ||
return SUPPORTED + "libwasmvm.dylib" | ||
if os == "Linux (musl)": | ||
if build_type == "static": | ||
return SUPPORTED + "libwasmvm_muslc.a" | ||
if build_type == "shared": | ||
return UNSUPPORTED | ||
if os == "Linux (glibc)": | ||
if build_type == "static": | ||
return UNSUPPORTED | ||
if build_type == "shared": | ||
return SUPPORTED + "libwasmvm.so" | ||
return UNKNOWN | ||
|
||
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" and build_type == "static": | ||
return UNSUPPORTED | ||
if os == "macOS" and build_type == "shared": | ||
return SUPPORTED + "libwasmvm.dylib" | ||
if os == "Linux (musl)": | ||
if build_type == "static": | ||
if cpu == "x86_64": | ||
return SUPPORTED + "libwasmvm_muslc.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.so" | ||
elif cpu == "aarch64": | ||
return SUPPORTED + "libwasmvm.aarch64.so" | ||
return UNKNOWN | ||
|
||
def get_note(os, cpu, build_type): | ||
if os == "Windows (mingw)" and cpu == "x86_64" and build_type == "shared": | ||
return "See #288" | ||
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)" | ||
return "" | ||
|
||
print("<!-- AUTO GENERATED BY libwasmvm_builds.py START -->") | ||
print("| OS family | Arch | Linking | Supported | Wasmer 2.2+ | Note |") | ||
print("| --------------- | ------- | ------- | ------------------- | ----------------------------- | ------- |") | ||
|
||
for os in oss: | ||
for cpu in cpus: | ||
for build_type in build_types: | ||
s1 = is_supported(os, cpu, build_type) | ||
s2 = wasmer22_supported(os, cpu, build_type) | ||
note = get_note(os, cpu, build_type) | ||
print( | ||
"| {:<15} | {:<7} | {:<7} | {:<19} | {:<29} | {} |".format( | ||
os, cpu, build_type, s1, s2, note | ||
) | ||
) | ||
print("<!-- AUTO GENERATED BY libwasmvm_builds.py END -->") |