Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bindgen issue upgrading to 0.11.x in MacOS Postgres.app installation #1697

Open
joaohaas opened this issue May 7, 2024 · 1 comment
Open

Comments

@joaohaas
Copy link

joaohaas commented May 7, 2024

Hey, at work we're trying to upgrade our pgrx version from 0.10.2 to 0.11.4, but we're running into issues when compiling pgrx-pg-sys. We're able to compile 0.10.x just fine, and the issue appears in all 0.11.x versions.

Based off the logs, I think it's failing to get all of my include paths, so maybe it's an issue with another package or my local env? I found this old post with a similar issue, but I do not have LLVM installed through brew.

For reference, I'm running the Postgres.app installation, which I know has caused issues in the past due to changes from the 'official' release, but I'm not sure if that's the case this time. I'm also running MacOS 13.3, but my coworker is running Sonoma and is also facing this issue.

Here's the log, lmk if you need any additional information/testing:

   Compiling pgrx-pg-sys v0.11.4
error: failed to run custom build command for `pgrx-pg-sys v0.11.4`

Caused by:
  process didn't exit successfully: `/Users/<user>/<project>/target/debug/build/pgrx-pg-sys-ef78b9fc3b27284f/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=PGRX_BUILD_VERBOSE
  cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
  cargo:rustc-cfg=nightly
  cargo:rerun-if-env-changed=PGRX_PG_CONFIG_PATH
  cargo:rerun-if-env-changed=PGRX_PG_CONFIG_AS_ENV
  cargo:rerun-if-env-changed=LLVM_CONFIG_PATH
  cargo:rerun-if-env-changed=LIBCLANG_PATH
  cargo:rerun-if-env-changed=LIBCLANG_STATIC_PATH
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64-apple-darwin
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64_apple_darwin
  cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
  cargo:rerun-if-changed=include
  cargo:rerun-if-changed=cshim
  cargo:rerun-if-changed=/Users/<user>/.pgrx/config.toml
  cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG15_aarch64-apple-darwin
  cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG15
  cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES_aarch64-apple-darwin
  cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES
  cargo:rerun-if-env-changed=PGRX_INCLUDEDIR_SERVER_PG15_aarch64-apple-darwin
  cargo:rerun-if-env-changed=PGRX_INCLUDEDIR_SERVER_PG15
  cargo:rerun-if-env-changed=PGRX_INCLUDEDIR_SERVER_aarch64-apple-darwin
  cargo:rerun-if-env-changed=PGRX_INCLUDEDIR_SERVER

  --- stderr
  build_paths=BuildPaths { manifest_dir: "/Users/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pgrx-pg-sys-0.11.4", out_dir: "/Users/<user>/<project>/target/debug/build/pgrx-pg-sys-56adcb0b1e596b17/out", src_dir: "/Users/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pgrx-pg-sys-0.11.4/src/include", shim_src: "/Users/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pgrx-pg-sys-0.11.4/cshim", shim_dst: "/Users/<user>/<project>/target/debug/build/pgrx-pg-sys-56adcb0b1e596b17/out/cshim" }
  Generating bindings for pg15
  pg_config --configure CLANG = None
  Bindgen found Apple clang version 14.0.3 (clang-1403.0.22.14.1)
  found libclang at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib
  Found include dirs ["/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.3/include"]
  /Applications/Postgres.app/Contents/Versions/15/include/postgresql/server/c.h:59:10: fatal error: 'stdio.h' file not found
  Error: bindgen failed for pg15

  Caused by:
     0: Unable to generate bindings for pg15
     1: clang diagnosed error: /Applications/Postgres.app/Contents/Versions/15/include/postgresql/server/c.h:59:10: fatal error: 'stdio.h' file not found


  Location:
      /Users/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pgrx-pg-sys-0.11.4/build.rs:736:10
@workingjubilee
Copy link
Member

This is likely breaking on #1325

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants