Skip to content
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
28 changes: 20 additions & 8 deletions .github/workflows/indigo-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
static_analysis:
runs-on: ubuntu-latest
container: epmlsop/indigo-tester:latest
if: ${{ startsWith(github.ref, 'refs/tags/indigo-') }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -35,6 +36,7 @@ jobs:

set_matrix:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/indigo-') }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
matrix-aarch64: ${{ steps.set-matrix.outputs.matrix-aarch64 }}
Expand Down Expand Up @@ -1090,9 +1092,10 @@ jobs:
strategy:
fail-fast: false
matrix:
postgres_major_version: [ 14, 15, 16, 17 ]
# postgres_major_version: [ 14, 15, 16, 17, 18 ]
postgres_major_version: [ 18 ]
runs-on: ubuntu-latest
needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64]
# needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -1165,9 +1168,10 @@ jobs:
strategy:
fail-fast: false
matrix:
postgres_major_version: [ "14", "15", "16" ]
# postgres_major_version: [ "14", "15", "16", "17", "18" ]
postgres_major_version: [ "17", "18" ]
runs-on: windows-latest
needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64]
# needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -1180,11 +1184,19 @@ jobs:
git fetch --tags -f
- name: Setup Postgres
run: |
$pg_version = switch(${{ matrix.postgres_major_version }}) { "17" { "17.5" } "16" { "16.9" } "15" { "15.13" } "14" { "14.18" } }
$pg_version = switch(${{ matrix.postgres_major_version }}) { "18" { "18.3" } "17" { "17.9" } "16" { "16.13" } "15" { "15.17" } "14" { "14.22" } }
curl -O https://get.enterprisedb.com/postgresql/postgresql-${pg_version}-1-windows-x64-binaries.zip
Expand-Archive postgresql-${pg_version}-1-windows-x64-binaries.zip
mv postgresql-${pg_version}-1-windows-x64-binaries/pgsql pgsql
cp bingo/postgres/patches/generic-msvc.h pgsql/include/server/port/atomics/generic-msvc.h
- name: Apply patch
if: ${{ matrix.postgres_major_version < 18 }}
run: cp bingo/postgres/patches/generic-msvc.h pgsql/include/server/port/atomics/generic-msvc.h
- name: Apply patch 18
if: ${{ matrix.postgres_major_version >= 18 }}
run: cp bingo/postgres/patches/generic-msvc-18.h pgsql/include/server/port/atomics/generic-msvc.h
- name: Apply patch 17
if: ${{ matrix.postgres_major_version >= 17 }}
run: cp bingo/postgres/patches/port.h pgsql/include/server/port.h
- name: Build bingo-postgres
run: |
mkdir build
Expand All @@ -1202,7 +1214,7 @@ jobs:
strategy:
fail-fast: false
matrix:
postgres_major_version: [ 14, 15, 16, 17 ]
postgres_major_version: [ 14, 15, 16, 17, 18 ]
runs-on: macos-15
needs: [build_indigo_windows_mingw_x86_64, build_indigo_ketcher_cjk, build_bingo_oracle_linux_x86_64, build_bingo_oracle_windows_mingw_x86_64, build_bingo_oracle_windows_msvc_x86_64]
steps:
Expand All @@ -1217,7 +1229,7 @@ jobs:
git fetch --tags -f
- name: Setup Postgres
run: |
case ${{ matrix.postgres_major_version }} in 17) pg_version=17.5;; 16) pg_version=16.9;; 15) pg_version=15.13;; 14) pg_version=14.18;; esac;
case ${{ matrix.postgres_major_version }} in 18) pg_version=18.3;; 17) pg_version=17.9;; 16) pg_version=16.13;; 15) pg_version=15.17;; 14) pg_version=14.22;; esac;
curl -O https://get.enterprisedb.com/postgresql/postgresql-${pg_version}-1-osx-binaries.zip
unzip postgresql-${pg_version}-1-osx-binaries.zip
mv pgsql/include/zlib.h pgsql/include/zlib.h.bck
Expand Down
5 changes: 4 additions & 1 deletion bingo/postgres/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ else()
list(GET PostgreSQL_VERSION_LIST 0 PostgreSQL_VERSION_MAJOR)
list(GET PostgreSQL_VERSION_LIST 1 PostgreSQL_VERSION_MINOR)


file(GLOB ${PROJECT_NAME}_SOURCES CONFIGURE_DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/src/pg_am/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/pg_am/*.c
Expand All @@ -40,6 +39,10 @@ else()
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/pg_core)

if (WIN32)
if (PostgreSQL_VERSION_MAJOR GREATER 16)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
endif()

string(REPLACE "libpq.lib" "postgres.lib" PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARIES})
if (MSVC)
target_include_directories(${PROJECT_NAME}
Expand Down
92 changes: 92 additions & 0 deletions bingo/postgres/patches/generic-msvc-18.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*-------------------------------------------------------------------------
*
* generic-msvc.h
* Atomic operations support when using MSVC
*
* Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES:
*
* Documentation:
* * Interlocked Variable Access
* http://msdn.microsoft.com/en-us/library/ms684122%28VS.85%29.aspx
*
* src/include/port/atomics/generic-msvc.h
*
*-------------------------------------------------------------------------
*/
#include <intrin.h>
#include <windows.h>

/* intentionally no include guards, should only be included by atomics.h */
#ifndef INSIDE_ATOMICS_H
#error "should be included via atomics.h"
#endif

/* Should work on both MSVC and Borland. */
#pragma intrinsic(_ReadWriteBarrier)
#define pg_compiler_barrier_impl() _ReadWriteBarrier()

#ifndef pg_memory_barrier_impl
#define pg_memory_barrier_impl() MemoryBarrier()
#endif

#define PG_HAVE_ATOMIC_U32_SUPPORT
typedef struct pg_atomic_uint32
{
volatile uint32 value;
} pg_atomic_uint32;

#define PG_HAVE_ATOMIC_U64_SUPPORT
typedef struct __declspec(align(8)) pg_atomic_uint64
{
volatile uint64 value;
} pg_atomic_uint64;

#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32
static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32* ptr, uint32* expected, uint32 newval)
{
bool ret;
uint32 current;
current = InterlockedCompareExchange(&ptr->value, newval, *expected);
ret = current == *expected;
*expected = current;
return ret;
}

#define PG_HAVE_ATOMIC_FETCH_ADD_U32
static inline uint32 pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32* ptr, int32 add_)
{
return InterlockedExchangeAdd(&ptr->value, add_);
}

/*
* The non-intrinsics versions are only available in vista upwards, so use the
* intrinsic version. Only supported on >486, but we require XP as a minimum
* baseline, which doesn't support the 486, so we don't need to add checks for
* that case.
*/
#pragma intrinsic(_InterlockedCompareExchange64)

#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64
static inline bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64* ptr, uint64* expected, uint64 newval)
{
bool ret;
uint64 current;
current = _InterlockedCompareExchange64((volatile LONG64*)&ptr->value, newval, *expected);
ret = current == *expected;
*expected = current;
return ret;
}

/* Only implemented on itanium and 64bit builds */
#ifdef _WIN64
#pragma intrinsic(_InterlockedExchangeAdd64)

#define PG_HAVE_ATOMIC_FETCH_ADD_U64
static inline uint64 pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64* ptr, int64 add_)
{
return _InterlockedExchangeAdd64((volatile LONG64*)&ptr->value, add_);
}
#endif /* _WIN64 */
Loading
Loading