From f6efc23a2bc128ddc4021d058216abb51680a6a7 Mon Sep 17 00:00:00 2001 From: Zadock Maloba <55388270+zadockmaloba@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:44:58 +0300 Subject: [PATCH 1/8] Resolve explicit_bzero link issues on macOS --- build.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index bb4326d..54a5e41 100644 --- a/build.zig +++ b/build.zig @@ -280,6 +280,7 @@ const libpq_sources = .{ }; const libport_sources = .{ + "explicit_bzero.c", "getpeereid.c", "pg_crc32c_sb8.c", "bsearch_arg.c", @@ -801,7 +802,7 @@ const autoconf_darwin = .{ .HAVE_LONG_LONG_INT_64 = null, .HAVE_MBARRIER_H = null, .HAVE_MBSTOWCS_L = null, - .HAVE_MEMSET_S = 1, + .HAVE_MEMSET_S = null, .HAVE_OSSP_UUID_H = null, .HAVE_PAM_PAM_APPL_H = null, .HAVE_PTHREAD_IS_THREADED_NP = null, @@ -837,7 +838,7 @@ const autoconf_darwin = .{ .USE_LDAP = null, .USE_LIBXML = null, .USE_LIBXSLT = null, - .USE_LLVM = null, + .USE_LLVM = 1, .USE_LZ4 = null, .USE_NAMED_POSIX_SEMAPHORES = null, .USE_PAM = null, From 7f56705fad4d2b3360ed22cde6d5b923ae08f206 Mon Sep 17 00:00:00 2001 From: Zadock Maloba <55388270+zadockmaloba@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:45:53 +0300 Subject: [PATCH 2/8] Make the example binaries run artifacts for easy testing --- build.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.zig b/build.zig index 54a5e41..3a0f217 100644 --- a/build.zig +++ b/build.zig @@ -258,8 +258,11 @@ pub fn build(b: *std.Build) !void { t.linkLibC(); for (libs) |lib| t.linkLibrary(lib); + t.linkLibC(); const install_test = b.addInstallArtifact(t, .{}); + const run_test = b.addRunArtifact(t); test_step.dependOn(&install_test.step); + test_step.dependOn(&run_test.step); } } From d0fd80f6f8e9345e161e3d2b5919d9d76147eacd Mon Sep 17 00:00:00 2001 From: Zadock Maloba <55388270+zadockmaloba@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:46:39 +0300 Subject: [PATCH 3/8] Inline iteration of tests since elements are known at comptime --- build.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 3a0f217..ee370a9 100644 --- a/build.zig +++ b/build.zig @@ -254,7 +254,7 @@ pub fn build(b: *std.Build) !void { test5.addCSourceFiles(.{ .root = upstream.path("src/test/examples"), .files = &.{"testlo.c"} }); const tests = [_]*std.Build.Step.Compile{ test1, test2, test3, test4, test5 }; - for (tests) |t| { + inline for (tests) |t| { t.linkLibC(); for (libs) |lib| t.linkLibrary(lib); From 0c3f21e51adbcfc5ff0a6298c33fb2cc97b22b29 Mon Sep 17 00:00:00 2001 From: Zadock Maloba <55388270+zadockmaloba@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:06:51 +0300 Subject: [PATCH 4/8] Add postgres service to workflow for running examples --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39b2376..07b521a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,23 @@ jobs: runs-on: ${{ matrix.os }} + services: + postgres: + image: postgres:15 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + ports: + - 5432:5432 + options: >- + --health-cmd="pg_isready" + --health-interval=10s + --health-timeout=5s + --health-retries=5 + # Give PostgreSQL some time to start + timeout-minutes: 5 + steps: - name: Check out repository uses: actions/checkout@v4 From 9359ea61bf9fe8ecccc724e79f06e1a36c3d6bff Mon Sep 17 00:00:00 2001 From: Zadock Maloba <55388270+zadockmaloba@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:10:01 +0300 Subject: [PATCH 5/8] Remove timeout-minutes from postgres service --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07b521a..8554596 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,9 +37,7 @@ jobs: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s - --health-retries=5 - # Give PostgreSQL some time to start - timeout-minutes: 5 + --health-retries=5 steps: - name: Check out repository From f62b8ae08958a157f292107422a2207e05de3a26 Mon Sep 17 00:00:00 2001 From: Zadock Maloba <55388270+zadockmaloba@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:12:55 +0300 Subject: [PATCH 6/8] Revert "Make the example binaries run artifacts for easy testing" This reverts commit 7f56705fad4d2b3360ed22cde6d5b923ae08f206. --- build.zig | 3 --- 1 file changed, 3 deletions(-) diff --git a/build.zig b/build.zig index ee370a9..bb4c677 100644 --- a/build.zig +++ b/build.zig @@ -258,11 +258,8 @@ pub fn build(b: *std.Build) !void { t.linkLibC(); for (libs) |lib| t.linkLibrary(lib); - t.linkLibC(); const install_test = b.addInstallArtifact(t, .{}); - const run_test = b.addRunArtifact(t); test_step.dependOn(&install_test.step); - test_step.dependOn(&run_test.step); } } From 98dc54a0e5c3bdb1c977effc719f53e56560eed6 Mon Sep 17 00:00:00 2001 From: Zadock Maloba <55388270+zadockmaloba@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:13:29 +0300 Subject: [PATCH 7/8] Revert "Remove timeout-minutes from postgres service" This reverts commit 9359ea61bf9fe8ecccc724e79f06e1a36c3d6bff. --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8554596..07b521a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,9 @@ jobs: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s - --health-retries=5 + --health-retries=5 + # Give PostgreSQL some time to start + timeout-minutes: 5 steps: - name: Check out repository From ed4232e19e12466e738e294424ec599324eb8f14 Mon Sep 17 00:00:00 2001 From: Zadock Maloba <55388270+zadockmaloba@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:13:39 +0300 Subject: [PATCH 8/8] Revert "Add postgres service to workflow for running examples" This reverts commit 0c3f21e51adbcfc5ff0a6298c33fb2cc97b22b29. --- .github/workflows/ci.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07b521a..39b2376 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,23 +24,6 @@ jobs: runs-on: ${{ matrix.os }} - services: - postgres: - image: postgres:15 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres - ports: - - 5432:5432 - options: >- - --health-cmd="pg_isready" - --health-interval=10s - --health-timeout=5s - --health-retries=5 - # Give PostgreSQL some time to start - timeout-minutes: 5 - steps: - name: Check out repository uses: actions/checkout@v4