Open jkhall opened 11 months ago
I think that's from a missing system dependency. brew install cmake
might fix it.
Once you do get it working, feel free to open a PR to update the documentation!
Will do! For what it's worth, I already had cmake installed. I even uninstalled and reinstalled and it didn't seem to fix anything. That said pg_query = "0.7"
in Cargo.toml does build successfully, so I'm trying track down what the difference is.
Hi, I got a quite similar error, when building this crate:
error: failed to run custom build command for `pg_query v5.1.0`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
process didn't exit successfully: `/home/steve/Documents/workspace/rust/target/debug/build/pg_query-0af8deb85cd56b05/build-script-build` (exit status: 1)
--- stdout
cargo:rustc-link-search=native=/home/steve/Documents/workspace/rust/target/debug/build/pg_query-ea3135317016c144/out
cargo:rustc-link-lib=static=pg_query
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-unknown-linux-gnu")
cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
CC_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
CC_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_CC
HOST_CC = None
cargo:rerun-if-env-changed=CC
CC = None
cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
CFLAGS_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
CFLAGS_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=AR_x86_64-unknown-linux-gnu
AR_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=AR_x86_64_unknown_linux_gnu
AR_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_AR
HOST_AR = None
cargo:rerun-if-env-changed=AR
AR = None
cargo:rerun-if-env-changed=ARFLAGS_x86_64-unknown-linux-gnu
ARFLAGS_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=ARFLAGS_x86_64_unknown_linux_gnu
ARFLAGS_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_ARFLAGS
HOST_ARFLAGS = None
cargo:rerun-if-env-changed=ARFLAGS
ARFLAGS = None
cargo:rustc-link-lib=static=pg_query
cargo:rustc-link-search=native=/home/steve/Documents/workspace/rust/target/debug/build/pg_query-ea3135317016c144/out
--- stderr
/usr/include/sys/types.h:144:10: fatal error: 'stddef.h' file not found
Error: "Unable to generate bindings"
Environments
$ uname -a
Linux fedora 6.2.9-300.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 30 22:32:58 UTC 2023 x86_64 GNU/Linux
$ postgres -V
postgres (PostgreSQL) 17beta1
$ rustc --version
rustc 1.79.0 (129f3b996 2024-06-10)
$ rg pg Cargo.toml
29:pg_query = "5.1.0"
Same problem here
Hello. I'm trying to get set up on an M1 mac with the Getting started snippet. On running
cargo build
I get the error:/Projects/simple_pgquery/pgquerytest/target/debug/build/pg_query-8200207fd30b02f3/out/pg_query.h:5:10: fatal error: 'sys/types.h' file not found
Wanted to ask if this was a known issue with a workaround. If not, I will assume it's an issue on my machine and keep trying to fix it. Thanks.