mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 08:52:56 +00:00
This commit does two things of note:
1. Bumps the bindgen dependency from `0.59.1` to `0.60.1`. This gets us
an actual error type from bindgen, so we can display what's wrong.
2. Adds `anyhow` as a build dependency, so our error message can be
prettier. It's already used heavily elsewhere in the crates in this
repo, so I figured the fact it's a build dependency doesn't matter
much.
I ran into this from running `cargo <cmd>` without running `make` first.
Here's a comparison of the compiler output in those two cases.
Before this commit:
```
error: failed to run custom build command for `postgres_ffi v0.1.0 ($repo_path/libs/postgres_ffi)`
Caused by:
process didn't exit successfully: `$repo_path/target/debug/build/postgres_ffi-2f7253b3ad3ca840/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=bindgen_deps.h
--- stderr
bindgen_deps.h:7:10: fatal error: 'c.h' file not found
bindgen_deps.h:7:10: fatal error: 'c.h' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', libs/postgres_ffi/build.rs:135:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
After this commit:
```
error: failed to run custom build command for `postgres_ffi v0.1.0 ($repo_path/libs/postgres_ffi)`
Caused by:
process didn't exit successfully: `$repo_path/target/debug/build/postgres_ffi-e01fb59602596748/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-changed=bindgen_deps.h
--- stderr
bindgen_deps.h:7:10: fatal error: 'c.h' file not found
Error: Unable to generate bindings
Caused by:
clang diagnosed error: bindgen_deps.h:7:10: fatal error: 'c.h' file not found
```
30 lines
670 B
TOML
30 lines
670 B
TOML
[package]
|
|
name = "postgres_ffi"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
rand = "0.8.3"
|
|
regex = "1.4.5"
|
|
bytes = "1.0.1"
|
|
byteorder = "1.4.3"
|
|
anyhow = "1.0"
|
|
crc32c = "0.6.0"
|
|
hex = "0.4.3"
|
|
once_cell = "1.13.0"
|
|
log = "0.4.14"
|
|
memoffset = "0.6.2"
|
|
thiserror = "1.0"
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
utils = { path = "../utils" }
|
|
workspace_hack = { version = "0.1", path = "../../workspace_hack" }
|
|
|
|
[dev-dependencies]
|
|
env_logger = "0.9"
|
|
postgres = { git = "https://github.com/neondatabase/rust-postgres.git", rev="d052ee8b86fff9897c77b0fe89ea9daba0e1fa38" }
|
|
wal_craft = { path = "wal_craft" }
|
|
|
|
[build-dependencies]
|
|
anyhow = "1.0"
|
|
bindgen = "0.60.1"
|