From 395de2e5d0295095a74c1b8c3d6a8095dcef602d Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 10 Jul 2025 08:04:16 -0700 Subject: [PATCH 1/6] Debug --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 2 ++ include/pgvector/pqxx.hpp | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42c04d4..3eba22c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: build on: [push, pull_request] jobs: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: ankane/setup-postgres@v1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f5e98a..28e3f04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,8 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) option(BUILD_TESTING "" OFF) if(BUILD_TESTING) + option(BUILD_SHARED_LIBS "" ON) + include(FetchContent) FetchContent_Declare(libpqxx GIT_REPOSITORY https://github.com/jtv/libpqxx.git GIT_TAG 7.10.1) diff --git a/include/pgvector/pqxx.hpp b/include/pgvector/pqxx.hpp index 8c0812e..ed1bc62 100644 --- a/include/pgvector/pqxx.hpp +++ b/include/pgvector/pqxx.hpp @@ -21,7 +21,7 @@ /// @cond namespace pqxx { -template <> std::string const type_name{"vector"}; +template <> inline std::string const type_name{"vector"}; template <> struct nullness : pqxx::no_null {}; @@ -66,7 +66,7 @@ template <> struct string_traits { } }; -template <> std::string const type_name{"halfvec"}; +template <> inline std::string const type_name{"halfvec"}; template <> struct nullness : pqxx::no_null {}; @@ -111,7 +111,7 @@ template <> struct string_traits { } }; -template <> std::string const type_name{"sparsevec"}; +template <> inline std::string const type_name{"sparsevec"}; template <> struct nullness : pqxx::no_null {}; From ed43ed552c271802491905443bf60735c3bc4fe4 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 10 Jul 2025 08:13:58 -0700 Subject: [PATCH 2/6] Debug --- .github/workflows/build.yml | 2 ++ CMakeLists.txt | 7 +------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3eba22c..2af8a71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,8 @@ jobs: make sudo make install + - run: sudo apt-get install libpqxx-dev + - run: cmake -S . -B build -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=17 - run: cmake --build build - run: build/test diff --git a/CMakeLists.txt b/CMakeLists.txt index 28e3f04..4e3beb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,12 +24,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) option(BUILD_TESTING "" OFF) if(BUILD_TESTING) - option(BUILD_SHARED_LIBS "" ON) - - include(FetchContent) - - FetchContent_Declare(libpqxx GIT_REPOSITORY https://github.com/jtv/libpqxx.git GIT_TAG 7.10.1) - FetchContent_MakeAvailable(libpqxx) + find_package(libpqxx REQUIRED) add_executable(test test/halfvec_test.cpp test/main.cpp test/pqxx_test.cpp test/sparsevec_test.cpp test/vector_test.cpp) target_link_libraries(test PRIVATE libpqxx::pqxx pgvector::pgvector) From c428dcda3e7cb06207ae0b0231498927e8be3b4e Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 10 Jul 2025 08:17:14 -0700 Subject: [PATCH 3/6] Debug --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2af8a71..4a9f732 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,11 @@ jobs: make sudo make install - - run: sudo apt-get install libpqxx-dev + - run: | + git clone --branch 7.10.0 https://github.com/jtv/libpqxx.git + cd libpqxx + cmake --build . + cmake --install . - run: cmake -S . -B build -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=17 - run: cmake --build build From b2b52a67782062ebc8208bb87c7e2ce89c419914 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 10 Jul 2025 08:19:03 -0700 Subject: [PATCH 4/6] Debug --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a9f732..21a72f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ jobs: - run: | git clone --branch 7.10.0 https://github.com/jtv/libpqxx.git cd libpqxx + cmake . cmake --build . cmake --install . From 96a2d0b6681e708f89c7e8c12fdfd4d06811206b Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 10 Jul 2025 08:21:17 -0700 Subject: [PATCH 5/6] Debug --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21a72f7..4536ab3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: sudo make install - run: | - git clone --branch 7.10.0 https://github.com/jtv/libpqxx.git + git clone --branch 7.10.1 https://github.com/jtv/libpqxx.git cd libpqxx cmake . cmake --build . From dc75270859e8ca52c6501e4ae4ebd93d49c95e9b Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Thu, 10 Jul 2025 08:23:48 -0700 Subject: [PATCH 6/6] Debug --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4536ab3..4408b3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: cd libpqxx cmake . cmake --build . - cmake --install . + sudo cmake --install . - run: cmake -S . -B build -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=17 - run: cmake --build build