From cf1bad5024a80e3999587e08945b3f40d5e77dd0 Mon Sep 17 00:00:00 2001 From: "liang.he@intel.com" Date: Tue, 26 Nov 2024 03:39:03 +0000 Subject: [PATCH 1/7] Add versioning support and update CMake configuration --- CMakeLists.txt | 3 +++ build-scripts/config_common.cmake | 3 +++ build-scripts/version.cmake | 25 +++++++++++++++++++++ core/version.h | 11 +++++++++ core/version.h.in | 22 ++++++++++++++++++ product-mini/platforms/linux/CMakeLists.txt | 3 +++ 6 files changed, 67 insertions(+) create mode 100644 build-scripts/version.cmake create mode 100644 core/version.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index a637c3643c..6362d0e56e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,6 +174,7 @@ if (WAMR_BUILD_STATIC) target_link_libraries(iwasm_static PRIVATE ntdll) endif() + set_version_info (iwasm_static) install (TARGETS iwasm_static ARCHIVE DESTINATION lib) endif () @@ -196,6 +197,7 @@ if (WAMR_BUILD_SHARED) target_link_libraries(iwasm_shared PRIVATE ntdll) endif() + set_version_info (iwasm_shared) install (TARGETS iwasm_shared LIBRARY DESTINATION lib) endif () @@ -204,4 +206,5 @@ install (FILES ${WAMR_ROOT_DIR}/core/iwasm/include/wasm_c_api.h ${WAMR_ROOT_DIR}/core/iwasm/include/wasm_export.h ${WAMR_ROOT_DIR}/core/iwasm/include/lib_export.h + ${WAMR_ROOT_DIR}/core/version.h DESTINATION include) diff --git a/build-scripts/config_common.cmake b/build-scripts/config_common.cmake index 6a30bfb7b7..e77800ba4d 100644 --- a/build-scripts/config_common.cmake +++ b/build-scripts/config_common.cmake @@ -131,6 +131,9 @@ else () unset (LLVM_AVAILABLE_LIBS) endif () +# Version +include (${WAMR_ROOT_DIR}/build-scripts/version.cmake) + # Sanitizers if (NOT DEFINED WAMR_BUILD_SANITIZER) diff --git a/build-scripts/version.cmake b/build-scripts/version.cmake new file mode 100644 index 0000000000..d5304bcd00 --- /dev/null +++ b/build-scripts/version.cmake @@ -0,0 +1,25 @@ +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +# BE AWARE: This file depends on ${WAMR_ROOT_DIR} + +set(WAMR_VERSION_MAJOR 2) +set(WAMR_VERSION_MINOR 2) +set(WAMR_VERSION_PATCH 0) + +message("-- WAMR version: ${WAMR_VERSION_MAJOR}.${WAMR_VERSION_MINOR}.${WAMR_VERSION_PATCH}") + +# Configure the version header file +configure_file( + ${WAMR_ROOT_DIR}/core/version.h.in + ${WAMR_ROOT_DIR}/core/version.h +) + +# Set the library version and SOVERSION +function(set_version_info target) + set_target_properties(${target} + PROPERTIES + VERSION ${WAMR_VERSION_MAJOR}.${WAMR_VERSION_MINOR}.${WAMR_VERSION_PATCH} + SOVERSION ${WAMR_VERSION_MAJOR} +) +endfunction() diff --git a/core/version.h b/core/version.h index 4fe37e2d76..43ce5b96aa 100644 --- a/core/version.h +++ b/core/version.h @@ -3,9 +3,20 @@ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ +/* + * version.h.in is a template file. version.h is a generated file. + * Please do not edit both files directly. + * + * Any changes to the version should be done in the version.cmake file. + */ + #ifndef _WAMR_VERSION_H_ #define _WAMR_VERSION_H_ + +/* clang-format off */ #define WAMR_VERSION_MAJOR 2 #define WAMR_VERSION_MINOR 2 #define WAMR_VERSION_PATCH 0 +/* clang-format on */ + #endif diff --git a/core/version.h.in b/core/version.h.in new file mode 100644 index 0000000000..495b8d3b69 --- /dev/null +++ b/core/version.h.in @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ + +/* + * version.h.in is a template file. version.h is a generated file. + * Please do not edit both files directly. + * + * Any changes to the version should be done in the version.cmake file. + */ + +#ifndef _WAMR_VERSION_H_ +#define _WAMR_VERSION_H_ + +/* clang-format off */ +#define WAMR_VERSION_MAJOR @WAMR_VERSION_MAJOR@ +#define WAMR_VERSION_MINOR @WAMR_VERSION_MINOR@ +#define WAMR_VERSION_PATCH @WAMR_VERSION_PATCH@ +/* clang-format on */ + +#endif diff --git a/product-mini/platforms/linux/CMakeLists.txt b/product-mini/platforms/linux/CMakeLists.txt index 321c4a955b..c3d02da6ba 100644 --- a/product-mini/platforms/linux/CMakeLists.txt +++ b/product-mini/platforms/linux/CMakeLists.txt @@ -142,6 +142,7 @@ include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) check_pie_supported() add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE}) set_target_properties (vmlib PROPERTIES POSITION_INDEPENDENT_CODE ON) +set_version_info (vmlib) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") @@ -169,6 +170,7 @@ endif () include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) add_executable (iwasm main.c ${UNCOMMON_SHARED_SOURCE}) +set_version_info (iwasm) set_target_properties (iwasm PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -184,6 +186,7 @@ target_link_libraries(iwasm install (TARGETS iwasm DESTINATION bin) add_library (libiwasm SHARED ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (libiwasm) install (TARGETS libiwasm DESTINATION lib) From 6b06c1b0bf07e15d57402944115cf12719c6221b Mon Sep 17 00:00:00 2001 From: "liang.he@intel.com" Date: Tue, 24 Dec 2024 02:01:18 +0000 Subject: [PATCH 2/7] Add versioning information for libraries and executables across multiple platforms --- product-mini/platforms/android/CMakeLists.txt | 3 +++ product-mini/platforms/cosmopolitan/CMakeLists.txt | 5 +++++ product-mini/platforms/darwin/CMakeLists.txt | 5 +++++ product-mini/platforms/freebsd/CMakeLists.txt | 5 +++++ product-mini/platforms/ios/CMakeLists.txt | 1 + product-mini/platforms/linux-sgx/CMakeLists.txt | 1 + product-mini/platforms/linux-sgx/CMakeLists_minimal.txt | 1 + product-mini/platforms/linux/CMakeLists.txt | 2 ++ product-mini/platforms/riot/CMakeLists.txt | 2 ++ product-mini/platforms/vxworks/CMakeLists.txt | 5 +++++ product-mini/platforms/windows/CMakeLists.txt | 5 +++++ wamr-compiler/CMakeLists.txt | 1 + 12 files changed, 36 insertions(+) diff --git a/product-mini/platforms/android/CMakeLists.txt b/product-mini/platforms/android/CMakeLists.txt index 5c05259176..19bc1b11e7 100644 --- a/product-mini/platforms/android/CMakeLists.txt +++ b/product-mini/platforms/android/CMakeLists.txt @@ -107,6 +107,8 @@ include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (vmlib) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -pie -fPIE") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security") @@ -135,6 +137,7 @@ endif() set (distribution_DIR ${CMAKE_BINARY_DIR}/distribution) set_target_properties (iwasm PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${distribution_DIR}/wasm/lib") +set_version_info (iwasm) add_custom_command (TARGET iwasm POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_directory "${WAMR_ROOT_DIR}/core/iwasm/include" "${distribution_DIR}/wasm/include/" diff --git a/product-mini/platforms/cosmopolitan/CMakeLists.txt b/product-mini/platforms/cosmopolitan/CMakeLists.txt index 8533ea68ce..7676ea6fb8 100644 --- a/product-mini/platforms/cosmopolitan/CMakeLists.txt +++ b/product-mini/platforms/cosmopolitan/CMakeLists.txt @@ -132,6 +132,7 @@ include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) check_pie_supported() add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE}) set_target_properties (vmlib PROPERTIES POSITION_INDEPENDENT_CODE ON) +set_version_info (vmlib) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") @@ -160,6 +161,8 @@ include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) add_executable (iwasm main.c ${UNCOMMON_SHARED_SOURCE}) +set_version_info (iwasm) + set_target_properties (iwasm PROPERTIES POSITION_INDEPENDENT_CODE ON) install (TARGETS iwasm DESTINATION bin) @@ -168,6 +171,8 @@ target_link_libraries (iwasm vmlib ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} ${WASI_NN add_library (libiwasm STATIC ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (libiwasm) + install (TARGETS libiwasm DESTINATION lib) set_target_properties (libiwasm PROPERTIES OUTPUT_NAME iwasm) diff --git a/product-mini/platforms/darwin/CMakeLists.txt b/product-mini/platforms/darwin/CMakeLists.txt index 12ed8052fe..1f955a10b7 100644 --- a/product-mini/platforms/darwin/CMakeLists.txt +++ b/product-mini/platforms/darwin/CMakeLists.txt @@ -116,11 +116,14 @@ set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (vmlib) include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) add_executable (iwasm main.c ${UNCOMMON_SHARED_SOURCE}) +set_version_info (iwasm) + install (TARGETS iwasm DESTINATION bin) target_link_libraries (iwasm vmlib ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) @@ -131,5 +134,7 @@ install (TARGETS libiwasm DESTINATION lib) set_target_properties (libiwasm PROPERTIES OUTPUT_NAME iwasm) +set_version_info (libiwasm) + target_link_libraries (libiwasm ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) diff --git a/product-mini/platforms/freebsd/CMakeLists.txt b/product-mini/platforms/freebsd/CMakeLists.txt index dd1bbc41a5..5640a384a0 100644 --- a/product-mini/platforms/freebsd/CMakeLists.txt +++ b/product-mini/platforms/freebsd/CMakeLists.txt @@ -113,17 +113,22 @@ set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (vmlib) include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) add_executable (iwasm main.c ${UNCOMMON_SHARED_SOURCE}) +set_version_info (iwasm) + install (TARGETS iwasm DESTINATION bin) target_link_libraries (iwasm vmlib ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS} -lm -ldl -lpthread) add_library (libiwasm SHARED ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (libiwasm) + install (TARGETS libiwasm DESTINATION lib) set_target_properties (libiwasm PROPERTIES OUTPUT_NAME iwasm) diff --git a/product-mini/platforms/ios/CMakeLists.txt b/product-mini/platforms/ios/CMakeLists.txt index ea5a4f4b9d..ca54aa1556 100644 --- a/product-mini/platforms/ios/CMakeLists.txt +++ b/product-mini/platforms/ios/CMakeLists.txt @@ -139,6 +139,7 @@ endif() set (distribution_DIR ${CMAKE_BINARY_DIR}/distribution) set_target_properties (iwasm PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${distribution_DIR}/wasm/lib") +set_version_info (iwasm) add_custom_command (TARGET iwasm POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_directory "${WAMR_ROOT_DIR}/core/iwasm/include" "${distribution_DIR}/wasm/include/" diff --git a/product-mini/platforms/linux-sgx/CMakeLists.txt b/product-mini/platforms/linux-sgx/CMakeLists.txt index 20b3fdfac1..927e6f4592 100644 --- a/product-mini/platforms/linux-sgx/CMakeLists.txt +++ b/product-mini/platforms/linux-sgx/CMakeLists.txt @@ -107,6 +107,7 @@ set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (vmlib) add_custom_command ( OUTPUT libvmlib_untrusted.a diff --git a/product-mini/platforms/linux-sgx/CMakeLists_minimal.txt b/product-mini/platforms/linux-sgx/CMakeLists_minimal.txt index aa3de6dacb..a29dbd69c1 100644 --- a/product-mini/platforms/linux-sgx/CMakeLists_minimal.txt +++ b/product-mini/platforms/linux-sgx/CMakeLists_minimal.txt @@ -78,6 +78,7 @@ set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (vmlib) add_custom_command ( OUTPUT libvmlib_untrusted.a diff --git a/product-mini/platforms/linux/CMakeLists.txt b/product-mini/platforms/linux/CMakeLists.txt index c3d02da6ba..527d18035f 100644 --- a/product-mini/platforms/linux/CMakeLists.txt +++ b/product-mini/platforms/linux/CMakeLists.txt @@ -170,6 +170,7 @@ endif () include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) add_executable (iwasm main.c ${UNCOMMON_SHARED_SOURCE}) + set_version_info (iwasm) set_target_properties (iwasm PROPERTIES POSITION_INDEPENDENT_CODE ON) @@ -186,6 +187,7 @@ target_link_libraries(iwasm install (TARGETS iwasm DESTINATION bin) add_library (libiwasm SHARED ${WAMR_RUNTIME_LIB_SOURCE}) + set_version_info (libiwasm) install (TARGETS libiwasm DESTINATION lib) diff --git a/product-mini/platforms/riot/CMakeLists.txt b/product-mini/platforms/riot/CMakeLists.txt index 0032832627..c32a0b9777 100644 --- a/product-mini/platforms/riot/CMakeLists.txt +++ b/product-mini/platforms/riot/CMakeLists.txt @@ -62,3 +62,5 @@ include_directories(SYSTEM ${RIOT_INCLUDES_LIST}) # executable linking is done by RIOT build system add_library( wamr ${WAMR_RUNTIME_LIB_SOURCE}) + +set_version_info (wamr) diff --git a/product-mini/platforms/vxworks/CMakeLists.txt b/product-mini/platforms/vxworks/CMakeLists.txt index 0dc5d96999..dd03cb356f 100644 --- a/product-mini/platforms/vxworks/CMakeLists.txt +++ b/product-mini/platforms/vxworks/CMakeLists.txt @@ -78,17 +78,22 @@ set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (vmlib) include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) add_executable (iwasm main.c ${UNCOMMON_SHARED_SOURCE}) +set_version_info (iwasm) + install (TARGETS iwasm DESTINATION bin) target_link_libraries (iwasm vmlib ${LLVM_AVAILABLE_LIBS} -lm -ldl -lunix) add_library (libiwasm SHARED ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (libiwasm) + install (TARGETS libiwasm DESTINATION lib) set_target_properties (libiwasm PROPERTIES OUTPUT_NAME iwasm) diff --git a/product-mini/platforms/windows/CMakeLists.txt b/product-mini/platforms/windows/CMakeLists.txt index 40e925b16a..ff438ee8c1 100644 --- a/product-mini/platforms/windows/CMakeLists.txt +++ b/product-mini/platforms/windows/CMakeLists.txt @@ -106,6 +106,7 @@ set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info(vmlib) #set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN") if (NOT MINGW) @@ -134,6 +135,8 @@ include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake) add_executable (iwasm main.c ${UNCOMMON_SHARED_SOURCE}) +set_version_info (iwasm) + install (TARGETS iwasm DESTINATION bin) target_link_libraries (iwasm vmlib ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS}) @@ -144,6 +147,8 @@ endif () add_library (libiwasm SHARED ${WAMR_RUNTIME_LIB_SOURCE}) +set_version_info (libiwasm) + install (TARGETS libiwasm DESTINATION lib) set_target_properties (libiwasm PROPERTIES OUTPUT_NAME libiwasm) diff --git a/wamr-compiler/CMakeLists.txt b/wamr-compiler/CMakeLists.txt index bc56f40308..5eefc17ba1 100644 --- a/wamr-compiler/CMakeLists.txt +++ b/wamr-compiler/CMakeLists.txt @@ -375,6 +375,7 @@ add_library (aotclib ${IWASM_COMPL_SOURCE}) add_executable (wamrc main.c) check_pie_supported() set_target_properties (wamrc PROPERTIES POSITION_INDEPENDENT_CODE ON) +set_version_info (wamrc) if (LLVM_LINK_LLVM_DYLIB) set(WAMRC_LINK_LLVM_LIBS LLVM) From 8ed56eecaeccfaeaf330cef28966c1872cd45c91 Mon Sep 17 00:00:00 2001 From: "liang.he@intel.com" Date: Thu, 26 Dec 2024 00:56:22 +0000 Subject: [PATCH 3/7] Refactor versioning documentation and adopt semantic versioning guidelines --- build-scripts/version.cmake | 5 ++++- doc/semantic_version.md | 21 --------------------- doc/stability_release.md | 28 ++++++++++++++++++++++++++++ wamr-compiler/CMakeLists.txt | 1 + 4 files changed, 33 insertions(+), 22 deletions(-) delete mode 100644 doc/semantic_version.md create mode 100644 doc/stability_release.md diff --git a/build-scripts/version.cmake b/build-scripts/version.cmake index d5304bcd00..04c4e1ccb0 100644 --- a/build-scripts/version.cmake +++ b/build-scripts/version.cmake @@ -1,7 +1,10 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# BE AWARE: This file depends on ${WAMR_ROOT_DIR} +if(NOT WAMR_ROOT_DIR) + # if from wamr-compiler + set(WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) +endif() set(WAMR_VERSION_MAJOR 2) set(WAMR_VERSION_MINOR 2) diff --git a/doc/semantic_version.md b/doc/semantic_version.md deleted file mode 100644 index 9fdd65d605..0000000000 --- a/doc/semantic_version.md +++ /dev/null @@ -1,21 +0,0 @@ -# WAMR uses semantic versioning - -WAMR uses the _semantic versioning_ to replace the current _date versioning_ system. - -There are three parts in the new version string: - -- _major_. Any incompatible modification, on both ABI and APIs, will lead an increment - in the value of _major_. APIs includes: `wasm_export.h`, `wasm_c_api.h`, - _sections in AOT files_, and so on. -- _minor_. It represents new features. It includes not just MVP or POST-MVP features - but also WASI features and WAMR private ones. -- _patch_. It represents patches. - -## Legacy versions - -All legacy versions(tags) will keep their current status. No existing release names -and links will be changed. - -## Reference - -- [Semantic Versioning 2.0.0](https://semver.org/) diff --git a/doc/stability_release.md b/doc/stability_release.md new file mode 100644 index 0000000000..a08040c22f --- /dev/null +++ b/doc/stability_release.md @@ -0,0 +1,28 @@ +# Semantic Versioning + +WAMR has adopted [semantic versioning](https://semver.org/) to replace the former *date versioning system*. The new version string consists of three parts: + +- *major*: Any change that is not compatible with previous versions, affecting either the ABI or APIs, will result in an increase in the major version number. APIs include: wasm_export.h, wasm_c_api.h, sections in AOT files, among others. +- *minor*: This number increases with the addition of new features. This encompasses not only MVP (Minimum Viable Product) or POST-MVP features but also WebAssembly System Interface (WASI) features and WAMR-specific features. +- *patch*: This number is incremented for patches. + +## Legacy releases + +All previous versions (tags) will retain their current status. There will be no changes to existing release names and links. + +# Release Process + +WAMR has been deployed across various devices. A frequent release cycle would strain customers' testing resources and add extra deployment work. Two factors can trigger a new WAMR release: + +- Community requests, particularly following the integration of significant and new features. +- Security vulnerabilities and critical bug fixes that ensure correctness. + +Patch releases will be made only to address security vulnerabilities and critical issues related to default behavior in prior releases. + +Once a release decision has been made: + +- Create a PR that: + 1. Modifies *build-scripts/version.cmake*. + 2. Updates *RELEASE.md*. +- Once the PR is merged, create a new tag. +- Initiate the release process by triggering *the binary release processes* in *Actions*. diff --git a/wamr-compiler/CMakeLists.txt b/wamr-compiler/CMakeLists.txt index 5eefc17ba1..73b1522489 100644 --- a/wamr-compiler/CMakeLists.txt +++ b/wamr-compiler/CMakeLists.txt @@ -284,6 +284,7 @@ include (${IWASM_DIR}/common/gc/iwasm_gc.cmake) include (${IWASM_DIR}/interpreter/iwasm_interp.cmake) include (${IWASM_DIR}/aot/iwasm_aot.cmake) include (${IWASM_DIR}/compilation/iwasm_compl.cmake) +include (${PROJECT_SOURCE_DIR}/../build-scripts/version.cmake) if (WAMR_BUILD_LIBC_BUILTIN EQUAL 1) include (${IWASM_DIR}/libraries/libc-builtin/libc_builtin.cmake) From b52a91fdd87ff5f5492afe2776bbaef2def3c084 Mon Sep 17 00:00:00 2001 From: "liang.he@intel.com" Date: Fri, 10 Jan 2025 08:03:32 +0000 Subject: [PATCH 4/7] Remove deprecated version.h file and update versioning documentation --- core/version.h | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 core/version.h diff --git a/core/version.h b/core/version.h deleted file mode 100644 index 43ce5b96aa..0000000000 --- a/core/version.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - */ - -/* - * version.h.in is a template file. version.h is a generated file. - * Please do not edit both files directly. - * - * Any changes to the version should be done in the version.cmake file. - */ - -#ifndef _WAMR_VERSION_H_ -#define _WAMR_VERSION_H_ - -/* clang-format off */ -#define WAMR_VERSION_MAJOR 2 -#define WAMR_VERSION_MINOR 2 -#define WAMR_VERSION_PATCH 0 -/* clang-format on */ - -#endif From f9cc6c5d268336ab7065c68417ce5e15d2acf61c Mon Sep 17 00:00:00 2001 From: "liang.he@intel.com" Date: Fri, 17 Jan 2025 04:05:05 +0000 Subject: [PATCH 5/7] Add version.h and update versioning documentation for embedded platforms --- core/version.h | 24 ++++++++++++++++++++++++ core/version.h.in | 4 +++- doc/stability_release.md | 7 ++++++- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 core/version.h diff --git a/core/version.h b/core/version.h new file mode 100644 index 0000000000..d1becac61f --- /dev/null +++ b/core/version.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ + +/* + * version.h.in is a template file. version.h is a generated file. + * Please do not edit both files directly. + * + * Any changes to the version should be done in build-scripts/version.cmake. + * + * Continue to maintain the version.h for certain embedded platforms. + */ + +#ifndef _WAMR_VERSION_H_ +#define _WAMR_VERSION_H_ + +/* clang-format off */ +#define WAMR_VERSION_MAJOR 2 +#define WAMR_VERSION_MINOR 2 +#define WAMR_VERSION_PATCH 0 +/* clang-format on */ + +#endif diff --git a/core/version.h.in b/core/version.h.in index 495b8d3b69..e28df65ce4 100644 --- a/core/version.h.in +++ b/core/version.h.in @@ -7,7 +7,9 @@ * version.h.in is a template file. version.h is a generated file. * Please do not edit both files directly. * - * Any changes to the version should be done in the version.cmake file. + * Any changes to the version should be done in build-scripts/version.cmake. + * + * Continue to maintain the version.h for certain embedded platforms. */ #ifndef _WAMR_VERSION_H_ diff --git a/doc/stability_release.md b/doc/stability_release.md index a08040c22f..78e034a3df 100644 --- a/doc/stability_release.md +++ b/doc/stability_release.md @@ -23,6 +23,11 @@ Once a release decision has been made: - Create a PR that: 1. Modifies *build-scripts/version.cmake*. - 2. Updates *RELEASE.md*. + 2. Executes cmake configuration to update the version. + 3. Updates *RELEASE_NOTES.md*. +- A checklist of the PR includes + - [ ] *build-scripts/version.cmake* + - [ ] *core/version.h* + - [ ] *RELEASE_NOTES.md* - Once the PR is merged, create a new tag. - Initiate the release process by triggering *the binary release processes* in *Actions*. From 4e97498f209f9e62b27726b3b5623a6d78b2f9d1 Mon Sep 17 00:00:00 2001 From: "liang.he@intel.com" Date: Mon, 20 Jan 2025 03:16:10 +0000 Subject: [PATCH 6/7] Add workflow to confirm version.h is in sync and integrate it into Android compilation workflow --- .github/workflows/check_version_h.yml | 34 +++++++++++++++++++ .../compilation_on_android_ubuntu.yml | 6 ++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/check_version_h.yml diff --git a/.github/workflows/check_version_h.yml b/.github/workflows/check_version_h.yml new file mode 100644 index 0000000000..7d82dddc6c --- /dev/null +++ b/.github/workflows/check_version_h.yml @@ -0,0 +1,34 @@ +# Copyright (C) 2019 Intel Corporation. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +name: confirm version.h stay in sync + +on: + workflow_call: + +permissions: + contents: read + +jobs: + confirm_version: + runs-on: ubuntu-latest + outputs: + key: ${{ steps.create_version_h_cache_key.outputs.key}} + permissions: + contents: read + actions: write # for uploading cached artifact + + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: cmake execute to generate version.h + run: cmake -B build_version -S . + + - name: confirm version.h + run: | + if [ -z "$(git status --porcelain | grep version.h)" ]; then + echo "version.h is in sync" + else + echo "version.h is not in sync" + exit 1 + fi diff --git a/.github/workflows/compilation_on_android_ubuntu.yml b/.github/workflows/compilation_on_android_ubuntu.yml index 119c8b2d05..0709f5fd46 100644 --- a/.github/workflows/compilation_on_android_ubuntu.yml +++ b/.github/workflows/compilation_on_android_ubuntu.yml @@ -74,6 +74,12 @@ permissions: contents: read jobs: + check_version_h: + permissions: + contents: read + actions: write + uses: ./.github/workflows/check_version_h.yml + build_llvm_libraries_on_ubuntu_2204: permissions: contents: read From dc271055d0feaa1df6f4fb3e443c725fa194dd56 Mon Sep 17 00:00:00 2001 From: "liang.he@intel.com" Date: Tue, 21 Jan 2025 01:49:29 +0000 Subject: [PATCH 7/7] Cleanup check_version_h workflow by removing unnecessary outputs and permissions --- .github/workflows/check_version_h.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/check_version_h.yml b/.github/workflows/check_version_h.yml index 7d82dddc6c..ab23ecf9ed 100644 --- a/.github/workflows/check_version_h.yml +++ b/.github/workflows/check_version_h.yml @@ -11,11 +11,6 @@ permissions: jobs: confirm_version: runs-on: ubuntu-latest - outputs: - key: ${{ steps.create_version_h_cache_key.outputs.key}} - permissions: - contents: read - actions: write # for uploading cached artifact steps: - name: checkout