Skip to content

Commit be5b98b

Browse files
committed
Test glibc version for strcat
1 parent a8caf7f commit be5b98b

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,30 @@ jobs:
1818
os: [ubuntu-latest]
1919
build-options: ["-Dssl=None -Ddisable-zlib -Ddisable-zstd", "-Dssl=OpenSSL", "-Dssl=LibreSSL"]
2020
include:
21+
# Test for users that want stability and use older kernel, glibc and zig versions
2122
- zig-version: "0.14.1"
22-
os: ubuntu-latest
23+
os: ubuntu-22.04 # GLIBC 2.35
2324
build-options: "-Dssl=LibreSSL"
2425
- zig-version: "0.15.2"
2526
os: ubuntu-latest
2627
build-options: "-Dssl=None"
2728
- zig-version: "master"
28-
os: macos-latest # Apple Silicon (M1)
29-
build-options: "-Dssl=None"
29+
os: macos-latest # Apple Silicon
30+
build-options: "-Dssl=LibreSSL"
31+
- zig-version: "master"
32+
os: macos-latest-intel
33+
build-options: "-Dssl=LibreSSL"
3034

3135
runs-on: ${{ matrix.os }}
3236

3337
steps:
3438
- name: Check out repository
35-
uses: actions/checkout@v4
39+
uses: actions/checkout@v6
3640

3741
- name: Set up Zig
3842
uses: mlugg/setup-zig@v2
3943
with:
4044
version: ${{ matrix.zig-version }}
41-
use-cache: false
4245

4346
- name: Run `build`
4447
run: zig build ${{ matrix.build-options }} --summary all

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 contributors
3+
Copyright (c) 2024-2025 contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ Provides a package to be used by the zig package manager for C programs.
44

55
## Status
66

7-
| Architecture \ OS | Linux | MacOS |
8-
|:------------------|:-----------|-------|
9-
| x86_64 |||
10-
| arm 64 | (untested) |* |
7+
| Architecture \ OS | Linux | MacOS |
8+
|:------------------|:-----------|-----------------------|
9+
| x86_64 || |
10+
| arm 64 | (untested) | (not with OpenSSL) |
1111

1212
| Refname | PostgreSQL version | Zig `0.16.x` | Zig `0.15.x` | Zig `0.14.x` | Zig `0.13.x` |
1313
|------------|--------------------|--------------|--------------|--------------|--------------|
14+
| `5.18.1` | `REL_18_1` |||||
1415
| `5.16.4+5` | `REL_16_4` |||||
1516
| `5.16.4+3` | `REL_16_4` |||||
1617
| `5.16.4+2` | `REL_16_4` |||||
1718

18-
*: Will not work with OpenSSL
1919

2020
## Use
2121

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub fn build(b: *std.Build) !void {
154154
.USE_ZSTD = use_zstd,
155155
});
156156

157-
const have_strlcat: bool = target.result.os.tag == .macos; // or linux with glibc >= 2.38, how can I test that ?
157+
const have_strlcat: bool = target.result.os.tag == .macos or (target.result.os.tag == .linux and target.result.os.versionRange().gnuLibCVersion().?.order(.{ .major = 2, .minor = 38, .patch = 0 }) == .gt);
158158
if (!have_strlcat) {
159159
lib.addCSourceFiles(.{
160160
.root = upstream.path("src/port"),

0 commit comments

Comments
 (0)