From 7cc17fdd7a7f6b89135fc1223e3591a9c1783aa3 Mon Sep 17 00:00:00 2001 From: ekoby <7406535+ekoby@users.noreply.github.com> Date: Thu, 30 May 2024 10:36:35 -0400 Subject: [PATCH 1/4] update tlsuv@v0.29.3 (#654) fixes crash on proxy connect timeout --- deps/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 853ccad0..7590d6ad 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -8,7 +8,7 @@ else () FetchContent_Declare(tlsuv GIT_REPOSITORY https://github.com/openziti/tlsuv.git - GIT_TAG v0.29.2 + GIT_TAG v0.29.3 ) FetchContent_MakeAvailable(tlsuv) From 7e0ef97d5bf8399b637df085203dba2b8cf71827 Mon Sep 17 00:00:00 2001 From: eugene Date: Fri, 31 May 2024 11:58:15 -0400 Subject: [PATCH 2/4] make sure we can build with pre-release (or any) tags such as 2.0.0-alpha1, 2.0.0-rc4, etc --- CMakeLists.txt | 11 ++++---- cmake/version.cmake | 65 +++++++++++++++++++++++---------------------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ac6de92..ec274725 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,15 @@ cmake_minimum_required(VERSION 3.22) include(cmake/version.cmake) -get_version(${CMAKE_CURRENT_LIST_DIR}/version.txt ver GIT_BRANCH GIT_COMMIT_HASH) +get_version(${CMAKE_CURRENT_LIST_DIR}/version.txt GIT_VERSION GIT_BRANCH GIT_COMMIT_HASH) -set(CMAKE_C_STANDARD 99) project(ziti-sdk - VERSION ${ver} + DESCRIPTION "OpenZiti C SDK" + HOMEPAGE_URL "https://github.com/openziti/ziti-sdk-c" LANGUAGES C CXX - ) +) + +set(PROJECT_VERSION ${GIT_VERSION}) include(cmake/project-is-top-level.cmake) include(cmake/variables.cmake) @@ -19,7 +21,6 @@ message("project version: ${PROJECT_VERSION}") message("git info:") message(" branch : ${GIT_BRANCH}") message(" hash : ${GIT_COMMIT_HASH}") -message(" date : ${BUILD_DATE}") message("") message("using ${CMAKE_GENERATOR}") diff --git a/cmake/version.cmake b/cmake/version.cmake index c5dc60a4..ae977d48 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -1,48 +1,49 @@ - -function(get_version version_file version_var branch_var commit_var) +macro(do_git out_var err_var) execute_process( - COMMAND git describe --tags --match=[0-9]* HEAD + COMMAND "git" ${ARGN} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE GIT_INFO + OUTPUT_VARIABLE git_out OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE git_error + ERROR_VARIABLE git_err + ECHO_ERROR_VARIABLE ) - - if (NOT git_error) - execute_process( - COMMAND git rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE branch - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - # Get the latest abbreviated commit hash of the working branch - execute_process( - COMMAND git log -1 --format=%h - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE commit - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - + if (git_err) + set(${err_var} ${git_err}) + unset(${out_var}) + else () + set(${out_var} "${git_out}") + unset(${err_var}) endif () +endmacro(do_git) - if (git_error) +function(get_version version_file version_var branch_var commit_var) + do_git(GIT_INFO GIT_ERROR describe --always) + if (GIT_ERROR) unset(GIT_INFO) - message("getting version from ${version_file}") + message(NOTICE "getting version from ${version_file}") file(STRINGS ${version_file} ver_info) list(LENGTH ver_info ver_info_len) list(GET ver_info 0 GIT_INFO) - list(GET ver_info 1 branch) - list(GET ver_info 2 commit) + list(GET ver_info 1 _branch) + list(GET ver_info 2 _commit) + set(${version_var} ${GIT_INFO} PARENT_SCOPE) + set(${branch_var} ${_branch} PARENT_SCOPE) + set(${commit_var} ${_commit} PARENT_SCOPE) + return() endif () - if (${GIT_INFO} MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)$") - set(_ver ${CMAKE_MATCH_1}) - elseif (${GIT_INFO} MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-[^-]*") - string(JOIN "." _ver ${CMAKE_MATCH_1} ${CMAKE_MATCH_2}) + do_git(_branch GIT_ERROR rev-parse --abbrev-ref HEAD) + do_git(GIT_INFO GIT_ERROR describe --tags --long --first-parent HEAD) + if (${GIT_INFO} MATCHES "^(.*)-([0-9]+)-([^-]*)") # -- + set(_commit ${CMAKE_MATCH_3}) + if (${CMAKE_MATCH_2} EQUAL "0") #exact tag + set(_ver ${CMAKE_MATCH_1}) + else () + string(JOIN "." _ver ${CMAKE_MATCH_1} ${CMAKE_MATCH_2}) + endif () endif () set(${version_var} ${_ver} PARENT_SCOPE) - set(${branch_var} ${branch} PARENT_SCOPE) - set(${commit_var} ${commit} PARENT_SCOPE) + set(${branch_var} ${_branch} PARENT_SCOPE) + set(${commit_var} ${_commit} PARENT_SCOPE) endfunction() \ No newline at end of file From 57c73a8f344954fc4f6d4cf99fdcbc3face3d4c4 Mon Sep 17 00:00:00 2001 From: eugene Date: Fri, 31 May 2024 11:59:10 -0400 Subject: [PATCH 3/4] cleanup -- no need for subprojects --- programs/host-proxy/CMakeLists.txt | 2 -- programs/sample-bridge/CMakeLists.txt | 2 -- programs/sample-host/CMakeLists.txt | 2 -- programs/sample_enroll/CMakeLists.txt | 2 -- programs/sample_http_link/CMakeLists.txt | 2 -- programs/sample_wttr/CMakeLists.txt | 2 -- programs/wzcat/CMakeLists.txt | 2 -- programs/ziti-prox-c/CMakeLists.txt | 4 ---- 8 files changed, 18 deletions(-) diff --git a/programs/host-proxy/CMakeLists.txt b/programs/host-proxy/CMakeLists.txt index 46aaa8e5..4365738d 100644 --- a/programs/host-proxy/CMakeLists.txt +++ b/programs/host-proxy/CMakeLists.txt @@ -1,4 +1,2 @@ -project(host-proxy) - add_executable(host-proxy host-proxy.c) target_link_libraries(host-proxy PRIVATE ziti) \ No newline at end of file diff --git a/programs/sample-bridge/CMakeLists.txt b/programs/sample-bridge/CMakeLists.txt index 4bea2f5f..b3b56fc5 100644 --- a/programs/sample-bridge/CMakeLists.txt +++ b/programs/sample-bridge/CMakeLists.txt @@ -1,5 +1,3 @@ -project(sample-socket) - add_executable(ziti-ncat ziti-ncat.c) target_link_libraries(ziti-ncat PUBLIC ziti) diff --git a/programs/sample-host/CMakeLists.txt b/programs/sample-host/CMakeLists.txt index 4863c069..743a083a 100644 --- a/programs/sample-host/CMakeLists.txt +++ b/programs/sample-host/CMakeLists.txt @@ -1,4 +1,2 @@ -project(sample-host) - add_executable(sample-host sample-host.c) target_link_libraries(sample-host PUBLIC ziti) \ No newline at end of file diff --git a/programs/sample_enroll/CMakeLists.txt b/programs/sample_enroll/CMakeLists.txt index 75b27d78..fba872e1 100644 --- a/programs/sample_enroll/CMakeLists.txt +++ b/programs/sample_enroll/CMakeLists.txt @@ -1,4 +1,2 @@ -project(sample_enroll) - add_executable(sample_enroll sample_enroll.c) target_link_libraries(sample_enroll PUBLIC ziti) diff --git a/programs/sample_http_link/CMakeLists.txt b/programs/sample_http_link/CMakeLists.txt index 11390417..f8974eda 100644 --- a/programs/sample_http_link/CMakeLists.txt +++ b/programs/sample_http_link/CMakeLists.txt @@ -1,4 +1,2 @@ -project(sample_http_link) - add_executable(sample_http_link sample_http_link.c) target_link_libraries(sample_http_link PUBLIC ziti) diff --git a/programs/sample_wttr/CMakeLists.txt b/programs/sample_wttr/CMakeLists.txt index b84ee3a5..f74dbdd8 100644 --- a/programs/sample_wttr/CMakeLists.txt +++ b/programs/sample_wttr/CMakeLists.txt @@ -1,4 +1,2 @@ -project(sample_wttr) - add_executable(sample_wttr sample_wttr.c) target_link_libraries(sample_wttr PUBLIC ziti) diff --git a/programs/wzcat/CMakeLists.txt b/programs/wzcat/CMakeLists.txt index a0e62549..59fb33fc 100644 --- a/programs/wzcat/CMakeLists.txt +++ b/programs/wzcat/CMakeLists.txt @@ -1,4 +1,2 @@ -project(wzcat) - add_executable(wzcat ziti_ws.c) target_link_libraries(wzcat PUBLIC ziti) diff --git a/programs/ziti-prox-c/CMakeLists.txt b/programs/ziti-prox-c/CMakeLists.txt index f79d9a8a..8a3feb12 100644 --- a/programs/ziti-prox-c/CMakeLists.txt +++ b/programs/ziti-prox-c/CMakeLists.txt @@ -1,8 +1,4 @@ -project(ziti-prox-c - VERSION ${CMAKE_PROJECT_VERSION} - LANGUAGES C CXX - ) add_executable(ziti-prox-c proxy.c) if(WIN32) From da3f8e048b4710bc5054062dcd3b6a9d6ec5e290 Mon Sep 17 00:00:00 2001 From: eugene Date: Fri, 31 May 2024 12:10:22 -0400 Subject: [PATCH 4/4] try release drafter on for release branch --- .github/workflows/draft-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index c3eb58fa..f510261f 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - release-1.x jobs: update_release_draft: