pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.71k stars 249 forks source link

Upgrading to 0.12.5 and pg17 error #1902

Closed FreeGIS closed 1 month ago

FreeGIS commented 1 month ago

System environment:

  1. centos7 x86_64
  2. pg17 image

When i run install:

 cargo pgrx install -c /home/postgres/pg17/bin/pg_config

i got the error:

 --- stderr
  build_paths=BuildPaths { manifest_dir: "/root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/pgrx-pg-sys-0.12.5", out_dir: "/opt/my_extension/target/debug/build/pgrx-pg-sys-8b21f429bc05a3d9/out", src_dir: "/root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/pgrx-pg-sys-0.12.5/src/include", shim_src: "/root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/pgrx-pg-sys-0.12.5/pgrx-cshim.c", shim_dst: "/opt/my_extension/target/debug/build/pgrx-pg-sys-8b21f429bc05a3d9/out/pgrx-cshim.c" }
  Generating bindings for pg17
  pg_config --configure CLANG = None
  Bindgen found clang version 11.0.0
  found libclang at /usr/local/clang/lib/libclang.so.11
  Found include dirs ["/usr/local/clang/lib/clang/11.0.0/include"]
  clang diag: /home/postgres/pg17/include/server/port.h:211:81: warning: 'format' attribute argument not supported: gnu_printf [-Wignored-attributes]
  clang diag: /home/postgres/pg17/include/server/port.h:212:70: warning: 'format' attribute argument not supported: gnu_printf [-Wignored-attributes]
  clang diag: /home/postgres/pg17/include/server/port.h:213:66: warning: 'format' attribute argument not supported: gnu_printf [-Wignored-attributes]
  clang diag: /home/postgres/pg17/include/server/port.h:214:55: warning: 'format' attribute argument not supported: gnu_printf [-Wignored-attributes]
  clang diag: /home/postgres/pg17/include/server/port.h:215:69: warning: 'format' attribute argument not supported: gnu_printf [-Wignored-attributes]
  clang diag: /home/postgres/pg17/include/server/port.h:216:58: warning: 'format' attribute argument not supported: gnu_printf [-Wignored-attributes]
  clang diag: /home/postgres/pg17/include/server/port.h:217:54: warning: 'format' attribute argument not supported: gnu_printf [-Wignored-attributes]
  clang diag: /home/postgres/pg17/include/server/port.h:218:43: warning: 'format' attribute argument not supported: gnu_printf [-Wignored-attributes]

Who can tell me why?

FreeGIS commented 1 month ago

The problem has been resolved。

  1. uninstall old versions of clang11
  2. Compile a newer version of clang18 with source code image

I have found that this type of error is caused by the clang version. I suggest compiling a newer version of the source code。

I still find that when compiling PostgreSQL -- with LLVM, the clang and LLVM versions should be consistent with when compiling the cargo pgrx extension, otherwise errors will still occur.