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

cargo pgx run pg13 error:failed to run custom build command for pgx-pg-sys v0.5.0 #767

Closed
wonb168 opened this issue Oct 17, 2022 · 7 comments

Comments

@wonb168
Copy link

wonb168 commented Oct 17, 2022

cargo pgx run pg13 RUST_BACKTRACE=1
Building extension with features
Running command "cargo" "build" "--message-format=json-render-diagnostics"
Compiling pgx-pg-sys v0.5.0
error: failed to run custom build command for pgx-pg-sys v0.5.0

Caused by:
process didn't exit successfully: /home/wcz/my_extension/target/debug/build/pgx-pg-sys-1e887851a3333d08/build-script-build (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=PGX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
cargo:rerun-if-changed=/home/wcz/.pgx/config.toml
cargo:rerun-if-changed=include
cargo:rerun-if-changed=cshim

--- stderr
manifest_dir=/home/wcz/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/pgx-pg-sys-0.5.0
shim_src=/home/wcz/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/pgx-pg-sys-0.5.0/cshim
shim_dst=/home/wcz/my_extension/target/debug/build/pgx-pg-sys-50de33e08bc7839b/out/cshim
Generating bindings for pg13
/usr/include/bits/time.h:30:8: error: redefinition of 'timeval'
/usr/include/time.h:15:8: note: previous definition is here
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/port.h:176:70: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/port.h:178:55: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/port.h:180:58: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/port.h:182:43: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:157:40: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:158:49: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:161:56: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:161:30: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:163:43: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:164:52: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:166:47: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:170:57: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:170:31: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:173:56: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:173:30: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:175:41: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:189:48: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:221:54: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/elog.h:437:47: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/palloc.h:133:44: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/utils/palloc.h:134:80: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/lib/stringinfo.h:96:67: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/lib/stringinfo.h:107:78: warning: format attribute argument not supported: gnu_printf [-Wignored-attributes]
/usr/include/asm/signal.h:15:23: error: typedef redefinition with different types ('unsigned long' vs '__sigset_t')
/usr/include/sys/select.h:37:20: note: previous definition is here
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/miscadmin.h:90:29: error: unknown type name 'sig_atomic_t'
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/miscadmin.h:91:29: error: unknown type name 'sig_atomic_t'
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/miscadmin.h:92:29: error: unknown type name 'sig_atomic_t'
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/miscadmin.h:93:29: error: unknown type name 'sig_atomic_t'
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/miscadmin.h:94:29: error: unknown type name 'sig_atomic_t'
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/miscadmin.h:96:29: error: unknown type name 'sig_atomic_t'
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/storage/latch.h:112:2: error: unknown type name 'sig_atomic_t'
/home/wcz/.pgx/13.8/pgx-install/include/postgresql/server/storage/sinval.h:128:17: error: unknown type name 'sig_atomic_t'
thread 'main' panicked at 'libclang function not loaded: clang_getTranslationUnitTargetInfo. This crate requires that libclang 3.9 or later be installed on your system. For more information on how to accomplish this, see here: https://rust-lang.github.io/rust-bindgen/requirements.html#installing-clang-39', /home/wcz/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/clang-sys-1.4.0/src/lib.rs:1731:1
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

@workingjubilee
Copy link
Member

Likely related to #761

@workingjubilee
Copy link
Member

Bindgen requires a clang of v5.0 or greater, and pgx v0.5.0 requires a gcc of v7.0 or greater. Please refer to our README: https://github.com/tcdi/pgx#system-requirements

@workingjubilee workingjubilee closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2022
@wonb168
Copy link
Author

wonb168 commented Oct 18, 2022

clang -v #5.0.1
gcc -v #7.3.0
pgx : newest
when cargo pgx run pg13:

thread 'main' panicked at 'Unable to generate bindings for pg13: ClangDiagnostic("/usr/include/stdarg.h:32:10: fatal error: 'tr1/cstdarg' file not found\n")', /home/wcz/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/pgx-pg-sys-0.5.0/build.rs:563:13

@workingjubilee
Copy link
Member

Okay, that sure is different! Going to try to look into this soon.

@wonb168
Copy link
Author

wonb168 commented Oct 20, 2022

/usr/include/stdarg.h:32:10: fatal error: 'tr1/cstdarg' file not found。

wcz@ovf72-1511:~/my_extension$ cargo pgx run pg10
    Building extension with features pg10
     Running command "cargo" "build" "--features" "pg10" "--no-default-features" "--message-format=json-render-diagnostics"
   Compiling pgx-pg-sys v0.5.0
error: failed to run custom build command for `pgx-pg-sys v0.5.0`

Caused by:
  process didn't exit successfully: `/home/wcz/my_extension/target/debug/build/pgx-pg-sys-6ddcba8a0c67d23f/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=PGX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
  cargo:rerun-if-changed=/home/wcz/.pgx/config.toml
  cargo:rerun-if-changed=include
  cargo:rerun-if-changed=cshim

  --- stderr
  manifest_dir=/home/wcz/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/pgx-pg-sys-0.5.0
  shim_src=/home/wcz/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/pgx-pg-sys-0.5.0/cshim
  shim_dst=/home/wcz/my_extension/target/debug/build/pgx-pg-sys-f6b1c4b18a1ca620/out/cshim
  Generating bindings for pg10
  warning: to: 'linker' input unused [-Wunused-command-line-argument]
  warning: missing: 'linker' input unused [-Wunused-command-line-argument]
  warning: header: 'linker' input unused [-Wunused-command-line-argument]
  warning: files: 'linker' input unused [-Wunused-command-line-argument]
  /usr/include/stdarg.h:32:10: fatal error: 'tr1/cstdarg' file not found
  clang diag: warning: to: 'linker' input unused [-Wunused-command-line-argument]
  clang diag: warning: missing: 'linker' input unused [-Wunused-command-line-argument]
  clang diag: warning: header: 'linker' input unused [-Wunused-command-line-argument]
  clang diag: warning: files: 'linker' input unused [-Wunused-command-line-argument]
  thread 'main' panicked at 'Unable to generate bindings for pg10: ClangDiagnostic("/usr/include/stdarg.h:32:10: fatal error: 'tr1/cstdarg' file not found\n")', /home/wcz/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/pgx-pg-sys-0.5.0/build.rs:563:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@workingjubilee
Copy link
Member

workingjubilee commented Oct 20, 2022

Please try

pgx = "0.5.4"

in your Cargo.toml and confirm if this is fixed or still broken?
You probably will also need to cargo install --locked cargo-pgx.
Thank you!

@workingjubilee
Copy link
Member

In #778 this was reported as fixed.

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