Skip to content

Commit c7795a7

Browse files
maltesanderclaude
andcommitted
ci: install unixodbc-dev where the build links
odbc-sys links against libodbc/libodbcinst, so any job that links a binary (cargo test, the cargo-fuzz targets, the cargo-test pre-commit hook) needs the unixODBC dev libraries present. Restore the apt install in the unit-tests, fuzz, and pre-commit jobs; Miri is unaffected because it interprets rather than links. Also document the link-time dependency in README.md and AGENTS.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b3e537c commit c7795a7

4 files changed

Lines changed: 36 additions & 1 deletion

File tree

‎.github/workflows/build.yaml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ jobs:
2020
name: Unit Tests
2121
runs-on: ubuntu-latest
2222
steps:
23+
# odbc-sys links against libodbc/libodbcinst, so the unixODBC dev
24+
# libraries must be present to link the test binaries (no running Driver
25+
# Manager is needed — only the libraries).
26+
- name: Install host dependencies
27+
uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 # v1.6.0
28+
with:
29+
packages: unixodbc-dev
30+
version: ubuntu-latest
31+
2332
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2433
with:
2534
persist-credentials: false
@@ -81,6 +90,13 @@ jobs:
8190
runs-on: ubuntu-latest
8291
needs: [unit-tests]
8392
steps:
93+
# The fuzz binaries link stackable-odbc-core, which links libodbc.
94+
- name: Install host dependencies
95+
uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 # v1.6.0
96+
with:
97+
packages: unixodbc-dev
98+
version: ubuntu-latest
99+
84100
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
85101
with:
86102
persist-credentials: false

‎.github/workflows/pr_pre-commit.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ jobs:
1313
pre-commit:
1414
runs-on: ubuntu-latest
1515
steps:
16+
# The cargo-test pre-commit hook links libodbc via odbc-sys.
17+
- name: Install host dependencies
18+
uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 # v1.6.0
19+
with:
20+
packages: unixodbc-dev
21+
version: ubuntu-latest
22+
1623
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1724
with:
1825
persist-credentials: false

‎AGENTS.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ framework itself and, where relevant, how a downstream driver crate consumes it.
2727
- `tracing` for logging (not `println!` or `log`)
2828
- `#[repr(C)]` on all handle structs (required for tag-based validation)
2929
- `extern "system"` on all FFI exports (resolves to correct ABI on both Windows and Linux)
30+
- `odbc-sys` links against `libodbc`/`libodbcinst`, so building or testing needs
31+
the unixODBC dev libraries installed (`unixodbc-dev` on Debian/Ubuntu). No DSN
32+
or running Driver Manager is required. Miri is the exception — it interprets
33+
rather than links, so it needs no system libraries.
3034

3135
### Changelog
3236

‎README.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,18 @@ When adding a new ODBC function to the framework later, add one entry to
5555
## Testing
5656

5757
```bash
58-
cargo test # unit tests (pure Rust, no Driver Manager needed)
58+
cargo test # unit tests (no running Driver Manager needed)
5959
cargo bench # Criterion fetch-throughput benchmark
6060
```
6161

62+
`stackable-odbc-core` links against unixODBC through
63+
[odbc-sys](https://github.com/pacman82/odbc-sys), so the dev libraries must be
64+
installed to build and test (no DSN or running Driver Manager is required):
65+
66+
```bash
67+
sudo apt-get install unixodbc-dev # Debian/Ubuntu
68+
```
69+
6270
`stackable-odbc-core` holds all the raw-pointer marshalling, so it is checked by
6371
Miri (undefined behaviour + leaks) and cargo-fuzz (AddressSanitizer) on every PR:
6472

0 commit comments

Comments
 (0)