(args, compat)
| 924 | |
| 925 | |
| 926 | def install_plugins(args, compat): |
| 927 | global CONST_lib_dir |
| 928 | url_root = "https://github.com/WasmEdge/WasmEdge/releases/download/" |
| 929 | url_root += "$VERSION$/WasmEdge-plugin-$PLUGIN_NAME$-$VERSION$-$DIST$_$ARCH$.tar.gz" |
| 930 | |
| 931 | if len(args.plugins) >= 1: |
| 932 | for plugin_name in args.plugins: |
| 933 | # Reset the url_root, due to the wasi-nn-ggml plugin with the build number will change the url |
| 934 | url_root = "https://github.com/WasmEdge/WasmEdge/releases/download/" |
| 935 | url_root += ( |
| 936 | "$VERSION$/WasmEdge-plugin-$PLUGIN_NAME$-$VERSION$-$DIST$_$ARCH$.tar.gz" |
| 937 | ) |
| 938 | plugin_version_supplied = None |
| 939 | plugin_wasi_nn_ggml_bypass_check = False |
| 940 | if plugin_name.find(":") != -1: |
| 941 | plugin_name, plugin_version_supplied = plugin_name.split(":") |
| 942 | |
| 943 | # Deprecated rustls after 0.14.0 |
| 944 | # Only allow users to install rustls with 0.13.5 |
| 945 | if ( |
| 946 | plugin_name.startswith(WASMEDGE_RUSTLS) |
| 947 | and compat.version.compare("0.13.5") != 0 |
| 948 | ): |
| 949 | logging.warning("WasmEdge Rustls plugin is only available in 0.13.5") |
| 950 | logging.warning("Please use -v 0.13.5 as a workaround") |
| 951 | logging.warning("Skip installing WasmEdge Rustls plugin") |
| 952 | continue |
| 953 | |
| 954 | # Deprecated wasi-logging after 0.14.1-rc.1 |
| 955 | if ( |
| 956 | plugin_name.startswith(WASI_LOGGING) |
| 957 | and compat.version.compare("0.14.1-rc.1") != -1 |
| 958 | ): |
| 959 | logging.warning( |
| 960 | "WASI-Logging plugin is bundled into libwasmedge in 0.14.1-rc.1" |
| 961 | ) |
| 962 | logging.warning("No need to install the WASI-Logging plugin") |
| 963 | continue |
| 964 | |
| 965 | # Split the WASI-NN-GGML plugin and the others |
| 966 | if plugin_name.startswith(WASI_NN_GGML): |
| 967 | # Re-write the plugin name if the build number is supplied |
| 968 | # E.g. wasi_nn-ggml-b2330, wasi_nn-ggml-cuda-b2330, wasi_nn-ggml-cuda-11-b2330 |
| 969 | # "https://github.com/second-state/WASI-NN-GGML-PLUGIN-REGISTRY/raw/main/" |
| 970 | # "$VERSION$/" |
| 971 | # "$BUILD_NUMBER$/" |
| 972 | # "WasmEdge-plugin" |
| 973 | # "-$PLUGIN_NAME$" |
| 974 | # "-$VERSION$" |
| 975 | # "-$DIST$" |
| 976 | # "_$ARCH$" # ".tar.gz" |
| 977 | # If the build number is supplied, bypass the checks |
| 978 | plugin_wasi_nn_ggml_bypass_check = True |
| 979 | if plugin_name.startswith(WASI_NN_GGML) and "-b" in plugin_name: |
| 980 | [plugin_name, plugin_build_number] = plugin_name.split("-b") |
| 981 | url_root = "https://github.com/second-state/WASI-NN-GGML-PLUGIN-REGISTRY/releases/download/" |
| 982 | url_root += "b$BUILD_NUMBER$/WasmEdge-plugin-$PLUGIN_NAME$-$VERSION$-$DIST$_$ARCH$.tar.gz" |
| 983 | url_root = url_root.replace("$BUILD_NUMBER$", plugin_build_number) |
no test coverage detected