Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add versioning support and update CMake configuration #3933

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

Expand All @@ -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 ()

Expand All @@ -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)
3 changes: 3 additions & 0 deletions build-scripts/config_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
28 changes: 28 additions & 0 deletions build-scripts/version.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

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)
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()
11 changes: 0 additions & 11 deletions core/version.h

This file was deleted.

22 changes: 22 additions & 0 deletions core/version.h.in
Original file line number Diff line number Diff line change
@@ -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
21 changes: 0 additions & 21 deletions doc/semantic_version.md

This file was deleted.

28 changes: 28 additions & 0 deletions doc/stability_release.md
Original file line number Diff line number Diff line change
@@ -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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frequent release cycle would strain customers' testing resources

Not sure if I agree with that; customers can still choose to stick to a particular version or keep moving to the latest one. In fact, for some of the usecases it more frequent releases are better as it helps narrowing down any potential regressions which can only be seen when running WAMR at scale.

and add extra deployment work

Agree with that, we should probably discuss automating the process within TSC as much as we can to streamline the releases.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you proposing that we should streamline the release process (reduce manual work compared to the current method) and issue releases on a regular schedule, such as monthly?


- 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*.
3 changes: 3 additions & 0 deletions product-mini/platforms/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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/"
Expand Down
5 changes: 5 additions & 0 deletions product-mini/platforms/cosmopolitan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions product-mini/platforms/darwin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

5 changes: 5 additions & 0 deletions product-mini/platforms/freebsd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions product-mini/platforms/ios/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
1 change: 1 addition & 0 deletions product-mini/platforms/linux-sgx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions product-mini/platforms/linux-sgx/CMakeLists_minimal.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions product-mini/platforms/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -170,6 +171,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)

target_link_libraries(iwasm
Expand All @@ -185,6 +188,8 @@ install (TARGETS iwasm DESTINATION bin)

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)
Expand Down
2 changes: 2 additions & 0 deletions product-mini/platforms/riot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 5 additions & 0 deletions product-mini/platforms/vxworks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions product-mini/platforms/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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})
Expand All @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions wamr-compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,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)
Expand Down Expand Up @@ -369,6 +370,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)
Expand Down
Loading