|
| 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