Enable the semantic version mechanism for WAMR (#1374)
Use the semantic versioning (https://semver.org) to replace the current date versioning system, which is more general and is requested by some developers, e.g. issue #1357. There are three parts in the new version string: - major. Any incompatible modification on ABIs and APIs will lead to an increment in the value of major, which mainly includes: AOT calling conventions, AOT file format, wasm_export.h, wasm_c_api.h, and so on. - minor. It represents new features, including MVP/POST-MVP features, libraries, WAMR private ones, and so one. - patch. It represents patches. The new version will start from 1.0.0. Update the help info and version showing for iwasm and wamrc.
This commit is contained in:
@ -44,6 +44,7 @@ typedef enum EcallCmd {
|
||||
CMD_DESTROY_RUNTIME, /* wasm_runtime_destroy() */
|
||||
CMD_SET_WASI_ARGS, /* wasm_runtime_set_wasi_args() */
|
||||
CMD_SET_LOG_LEVEL, /* bh_log_set_verbose_level() */
|
||||
CMD_GET_VERSION, /* wasm_runtime_get_version() */
|
||||
} EcallCmd;
|
||||
|
||||
typedef struct EnclaveModule {
|
||||
@ -522,6 +523,18 @@ handle_cmd_set_wasi_args(uint64 *args, int32 argc)
|
||||
}
|
||||
#endif /* end of SGX_DISABLE_WASI */
|
||||
|
||||
static void
|
||||
handle_cmd_get_version(uint64 *args, uint32 argc)
|
||||
{
|
||||
uint32 major, minor, patch;
|
||||
bh_assert(argc == 3);
|
||||
|
||||
wasm_runtime_get_version(&major, &minor, &patch);
|
||||
args[0] = major;
|
||||
args[1] = minor;
|
||||
args[2] = patch;
|
||||
}
|
||||
|
||||
void
|
||||
ecall_handle_command(unsigned cmd, unsigned char *cmd_buf,
|
||||
unsigned cmd_buf_size)
|
||||
@ -569,6 +582,9 @@ ecall_handle_command(unsigned cmd, unsigned char *cmd_buf,
|
||||
case CMD_SET_LOG_LEVEL:
|
||||
handle_cmd_set_log_level(args, argc);
|
||||
break;
|
||||
case CMD_GET_VERSION:
|
||||
handle_cmd_get_version(args, argc);
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("Unknown command %d\n", cmd);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user