From f534daeed20df5d5a8c0715d3e49150812ad9989 Mon Sep 17 00:00:00 2001 From: Joachim Rosskopf Date: Sat, 25 May 2024 18:04:38 +0200 Subject: [PATCH] Make compile for v.10.2 and v.10.3 --- .../workflows/MainDistributionPipeline.yml | 22 +++++++++++++++++++ bics | 2 +- odp | 2 +- rfc/CMakeLists.txt | 2 +- rfc/src/sap_rfc.cpp | 8 ++++++- scripts/functions.cmake | 9 +++++++- trampoline/CMakeLists.txt | 1 + 7 files changed, 41 insertions(+), 5 deletions(-) diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index 3a764a6..c5f5b8c 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -59,3 +59,25 @@ jobs: deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' }} deploy_versioned: ${{ !(startsWith(github.ref, 'refs/tags/v')) && !(github.ref == 'refs/heads/master') }} + duckdb-stable-build-v0103: + name: Build v.0.10.3 extension binaries + uses: ./.github/workflows/_extension_build.yml + with: + duckdb_version: v0.10.3 + extension_name: erpl + exclude_archs: osx_amd64;osx_arm64;linux_arm64;windows_amd64_rtools;wasm_mvp;wasm_eh;wasm_threads + vcpkg_commit: 9edb1b8e590cc086563301d735cae4b6e732d2d2 + secrets: inherit + + duckdb-stable-deploy-v0103: + name: Deploy extension binaries + needs: duckdb-stable-build-v0103 + uses: ./.github/workflows/_extension_deploy.yml + secrets: inherit + with: + duckdb_version: v0.10.3 + extension_name: erpl + exclude_archs: osx_amd64;osx_arm64;linux_arm64;windows_amd64_rtools;wasm_mvp;wasm_eh;wasm_threads + deploy_latest: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' }} + deploy_versioned: ${{ !(startsWith(github.ref, 'refs/tags/v')) && !(github.ref == 'refs/heads/master') }} + diff --git a/bics b/bics index 4a328bb..0f307e5 160000 --- a/bics +++ b/bics @@ -1 +1 @@ -Subproject commit 4a328bb88c891acb4aef61c3cf79070f6f2e7b1e +Subproject commit 0f307e5b07415cff85894e2d2e4c7d11d9a13665 diff --git a/odp b/odp index 6da5bcd..7ed99fc 160000 --- a/odp +++ b/odp @@ -1 +1 @@ -Subproject commit 6da5bcd84929ba02188873e1b32d8abe53f08c75 +Subproject commit 7ed99fca005c571adf2080ff12bb14bdd5458780 diff --git a/rfc/CMakeLists.txt b/rfc/CMakeLists.txt index 47ababf..d950968 100644 --- a/rfc/CMakeLists.txt +++ b/rfc/CMakeLists.txt @@ -11,6 +11,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) project(${TARGET_NAME}) include(../scripts/functions.cmake) +add_duckdb_version_definition() if(WIN32) default_win32_libraries() @@ -27,7 +28,6 @@ include_directories(src/include ${SAPNWRFC_HOME}/include ${OPENSSL_INCLUDE_DIR}) - add_yyjson_from_duckdb() set(EXTENSION_SOURCES diff --git a/rfc/src/sap_rfc.cpp b/rfc/src/sap_rfc.cpp index 9348b1b..4ed5495 100644 --- a/rfc/src/sap_rfc.cpp +++ b/rfc/src/sap_rfc.cpp @@ -495,7 +495,13 @@ namespace duckdb duckdb::shared_ptr RfcReadColumnStateMachine::CreateTaskForNextStep(ClientContext &client_context, duckdb::Vector &column_output) { std::lock_guard t(thread_lock); - auto task = make_shared_ptr(this, client_context, column_output); + + #if ((DUCKDB_MAJOR_VERSION>0) || (DUCKDB_MAJOR_VERSION==0 && DUCKDB_MINOR_VERSION>10) || (DUCKDB_MAJOR_VERSION==0 && DUCKDB_MINOR_VERSION==10 && DUCKDB_PATCH_VERSION>=3)) + auto task = duckdb::make_shared_ptr(this, client_context, column_output); + #else + auto task = duckdb::make_shared(this, client_context, column_output); + #endif + return task; } diff --git a/scripts/functions.cmake b/scripts/functions.cmake index 5e2b00b..17a47fa 100644 --- a/scripts/functions.cmake +++ b/scripts/functions.cmake @@ -173,7 +173,6 @@ function(add_yyjson_from_duckdb) get_filename_component(yyjson_ext "${PROJECT_SOURCE_DIR}/../duckdb/extension/json/yyjson" REALPATH) if(EXISTS "${yyjson_ext}") include_directories(../duckdb/extension/json/yyjson/include/) - add_subdirectory(../duckdb/extension/json/yyjson/) message (NOTICE "-- Using yyjson extension from ${yyjson_ext}") endif() @@ -183,4 +182,12 @@ function(add_yyjson_from_duckdb) add_compile_definitions(DUCKDB_YYJSON_THIRDPARTY) message(NOTICE "-- Using yyjson third party from ${yyjson_thirdparty}") endif() +endfunction() + +#--------------------------------------------------------------------------------------- + +function(add_duckdb_version_definition) + add_compile_definitions(DUCKDB_MAJOR_VERSION=${DUCKDB_MAJOR_VERSION}) + add_compile_definitions(DUCKDB_MINOR_VERSION=${DUCKDB_MINOR_VERSION}) + add_compile_definitions(DUCKDB_PATCH_VERSION=${DUCKDB_PATCH_VERSION}) endfunction() \ No newline at end of file diff --git a/trampoline/CMakeLists.txt b/trampoline/CMakeLists.txt index c48f1fd..5bead17 100644 --- a/trampoline/CMakeLists.txt +++ b/trampoline/CMakeLists.txt @@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) project(${TARGET_NAME}) include(../scripts/functions.cmake) +add_duckdb_version_definition() if(WIN32) # Attach the erpl_rfc.duckdb_extension file as a resource to the trampoline file