From dec23e81f3732b579f5d911479124f7ab6cbf409 Mon Sep 17 00:00:00 2001 From: Dave Cramer Date: Mon, 23 Mar 2026 06:23:46 -0400 Subject: [PATCH 1/2] undo erroneous removal of check for STDBOOL --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d97ff23b..af07877a 100644 --- a/configure.ac +++ b/configure.ac @@ -28,9 +28,11 @@ AC_CHECK_SIZEOF([bool], [], #include #endif]) +AC_CHECK_HEADER_STDBOOL() + dnl We use if we have it and it declares type bool as having dnl size 1. Otherwise, c.h will fall back to declaring bool as unsigned char. -if test "$ac_cv_header_stdbool_h" = yes -a "$ac_cv_sizeof_bool" = 1; then +if test "$ac_cv_header_stdbool_h" = yes && test -a "$ac_cv_sizeof_bool" = 1; then AC_DEFINE([PG_USE_STDBOOL], 1, [Define to 1 to use to define type bool.]) fi From d173102f7f052219d1c0750dc2efe8468bbb7baa Mon Sep 17 00:00:00 2001 From: Dave Cramer Date: Mon, 23 Mar 2026 06:43:20 -0400 Subject: [PATCH 2/2] add build and test on linux add debian postgres headers and debug logging for fedora --- .github/workflows/linux.yml | 100 ++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- 2 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..04e9a4ae --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,100 @@ +name: Linux Build +run-name: psql ODBC Linux CI - ${{ github.event.head_commit.message }} + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +permissions: + contents: read + +jobs: + build-and-test: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + name: Debian (Ubuntu) + - os: ubuntu-latest + name: Red Hat (Fedora) + container: fedora:latest + + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + container: ${{ matrix.container || '' }} + + steps: + - name: Install dependencies (Debian) + if: matrix.container == '' + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential autoconf automake libtool \ + libpq-dev unixodbc-dev unixodbc \ + postgresql postgresql-client + if ! command -v odbc_config >/dev/null 2>&1; then + sudo tee /usr/local/bin/odbc_config > /dev/null <<'EOF' + #!/bin/sh + case $1 in + --include-prefix) echo "/usr/include" ;; + --lib-prefix) echo "/usr/lib" ;; + --libs) echo "-lodbc" ;; + *) echo "$0: unknown argument '$1'"; exit 1 ;; + esac + EOF + sudo chmod +x /usr/local/bin/odbc_config + fi + + - name: Install dependencies (Fedora) + if: matrix.container == 'fedora:latest' + run: | + dnf install -y \ + gcc make autoconf automake libtool \ + libpq-devel unixODBC-devel postgresql-server postgresql \ + diffutils git + + - name: Checkout + uses: actions/checkout@v4 + + - name: Bootstrap + run: autoreconf -fi + + - name: Configure + run: | + PG_CONFIG=$(find /usr -name pg_config -type f 2>/dev/null | head -1) + if [ -n "$PG_CONFIG" ]; then + export PATH="$(dirname $PG_CONFIG):$PATH" + fi + ./configure + + - name: Build + run: make -j$(nproc) + + - name: Start PostgreSQL (Debian) + if: matrix.container == '' + run: | + sudo mkdir -p /var/run/postgresql + sudo chown postgres:postgres /var/run/postgresql + sudo pg_ctlcluster $(pg_lsclusters -h | head -1 | awk '{print $1, $2}') start + sudo -u postgres createuser -s runner + sudo -u postgres createdb contrib_regression + + - name: Start PostgreSQL (Fedora) + if: matrix.container == 'fedora:latest' + run: | + mkdir -p /var/lib/pgsql/data /var/run/postgresql + chown postgres:postgres /var/lib/pgsql/data /var/run/postgresql + su postgres -c 'initdb -D /var/lib/pgsql/data' || { echo "initdb failed"; exit 1; } + su postgres -c "sed -i 's/^logging_collector = on/logging_collector = off/' /var/lib/pgsql/data/postgresql.conf" + su postgres -c 'pg_ctl -D /var/lib/pgsql/data -l /tmp/pg.log -t 30 start' || { cat /tmp/pg.log; exit 1; } + su postgres -c 'createuser -s root' + createdb contrib_regression + + - name: Test + run: | + cd test + make installcheck diff --git a/configure.ac b/configure.ac index af07877a..cb48df4d 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ AC_CHECK_HEADER_STDBOOL() dnl We use if we have it and it declares type bool as having dnl size 1. Otherwise, c.h will fall back to declaring bool as unsigned char. -if test "$ac_cv_header_stdbool_h" = yes && test -a "$ac_cv_sizeof_bool" = 1; then +if test "$ac_cv_header_stdbool_h" = yes && test "$ac_cv_sizeof_bool" = 1; then AC_DEFINE([PG_USE_STDBOOL], 1, [Define to 1 to use to define type bool.]) fi