Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

pgrx-based extensions do not work on macOS due to linker failure #10

Open
thoughtpolice opened this issue Aug 14, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@thoughtpolice
Copy link
Collaborator

See NixOS/nixpkgs#246803, which is a PR to add pg_jsonschema upstream. It currently doesn't work, and neither does pg_graphql, due to linker errors. See https://logs.ofborg.org/?key=nixos/nixpkgs.246803&attempt_id=97965248-99ee-408b-aeb9-af6aee96b4f0 for logs, copied here for safe keeping:

   Compiling bytecount v0.6.3
   Compiling jsonschema v0.16.1
   Compiling pgrx v0.9.8
   Compiling pg_jsonschema v0.1.4 (/private/tmp/nix-build-pg_jsonschema-unstable-2023-07-23.drv-0/source)
error: linking with `/nix/store/kvizl23z3fng88n4j8knapn186bxw70f-clang-wrapper-11.1.0/bin/cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/nix/store/iq9s4j1lm3zzhzwjwnmfajaslcwxqjqn-rustc-1.70.0/lib/rustlib/x86_64-apple-darwin/bin:/nix/store/8l4qxi1i81j8crspch8z8hfz8c50rx0y-cargo-1.70.0/bin:/nix/store/590z5rcnhx7fwg0x21b6swq08lps5n93-cargo-auditable-0.6.1/bin:/nix/store/fxp7lhj5fspzcgn0kqwfkd0v4l73c4y2-cargo-pgrx-0.9.8/bin:/nix/store/x56ysrq5hh24a3v187s2ndmz2zgznc4s-postgresql-14.8/bin:/nix/store/hsn305fagbccl1gq9vyvf45ylhi8ls2z-pkg-config-wrapper-0.29.2/bin:/nix/store/4yhkg3zqqzg03rrhvrdciczijv1mf6kw-rustfmt/bin:/nix/store/47vdlf47y1p31zik2svz42vbvjj2xpfk-auditable-cargo-1.70.0/bin:/nix/store/8l4qxi1i81j8crspch8z8hfz8c50rx0y-cargo-1.70.0/bin:/nix/store/iq9s4j1lm3zzhzwjwnmfajaslcwxqjqn-rustc-1.70.0/bin:/nix/store/kvizl23z3fng88n4j8knapn186bxw70f-clang-wrapper-11.1.0/bin:/nix/store/5j3zwxjziy6hcpaf9wlcj7qqq0w78wfi-clang-11.1.0/bin:/nix/store/vjjplvzy60qz3nznrff6s8zvb80m3bif-coreutils-9.3/bin:/nix/store/9w74lb0d7q1vvl88v5gzjyyx3312rz75-cctools-binutils-darwin-wrapper-11.1.0-973.0.1/bin:/nix/store/snxjdcdka4p7af454n3v7mdc4yh1lywn-cctools-binutils-darwin-11.1.0-973.0.1/bin:/nix/store/vjjplvzy60qz3nznrff6s8zvb80m3bif-coreutils-9.3/bin:/nix/store/k5abm4s2pgs0xg64lligwfprzafg8cdf-findutils-4.9.0/bin:/nix/store/hmscngdly85w04lb5cn32jcfqyg61kfq-diffutils-3.10/bin:/nix/store/3c0v61mw26d766jfdqg2bqmb32pcl40n-gnused-4.9/bin:/nix/store/hdq4m97ma7rk9srn8f0myfhhlh2inzm5-gnugrep-3.11/bin:/nix/store/8cmmw5frzhs5nzpkvfhdih6d7b3g7zqw-gawk-5.2.2/bin:/nix/store/q2csqxdlnjinz6fsvg751wryhxbnk9sw-gnutar-1.34/bin:/nix/store/397iphc81akvp54z9lsrfqly4fj56d08-gzip-1.12/bin:/nix/store/p742p1s409j1yvb0ywvk258fjipzsqd9-bzip2-1.0.8-bin/bin:/nix/store/ch57psmgq8rg5f0i0cvp07d0zfndjf8x-gnumake-4.4.1/bin:/nix/store/xx5s0rkx3aav3f850ig4afadg6ms7lq9-bash-5.2-p15/bin:/nix/store/psxc626ll2zkjkalyybkyzcxvkgr6nbx-patch-2.7.6/bin:/nix/store/5ym0a90mnlw4gi81wpraa370wi32r075-xz-5.4.3-bin/bin:/nix/store/rxr4dqbh16y2v2c7fchcnlsfqkdr8bw9-file-5.44/bin" VSLANG="1033" ZERO_AR_DATE="1" "/nix/store/kvizl23z3fng88n4j8knapn186bxw70f-clang-wrapper-11.1.0/bin/cc" "-Wl,-exported_symbols_list,/private/tmp/nix-build-pg_jsonschema-unstable-2023-07-23.drv-0/rustcuJWqc2/list" "-arch" "x86_64" "-m64" "/private/tmp/nix-build-pg_jsonschema-unstable-2023-07-23.drv-0/rustcuJWqc2/symbols.o" "/private/tmp/nix-build-pg_jsonschema-unstable-2023-07-23.drv-0/source/target/release/deps/pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o" "-L" "/private/tmp/nix-build-pg_jsonschema-unstable-2023-07-23.drv-0/source/target/release/deps" "-L" "/private/tmp/nix-build-pg_jsonschema-unstable-2023-07-23.drv-0/source/target/release/build/pgrx-pg-sys-55d890bc8c08227a/out/cshim" "-L" "/nix/store/iq9s4j1lm3zzhzwjwnmfajaslcwxqjqn-rustc-1.70.0/lib/rustlib/x86_64-apple-darwin/lib" "/private/tmp/nix-build-pg_jsonschema-unstable-2023-07-23.drv-0/rustcuJWqc2/libpgrx_pg_sys-56fd5a7be13bf3ff.rlib" "/nix/store/iq9s4j1lm3zzhzwjwnmfajaslcwxqjqn-rustc-1.70.0/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-5a85a42de0691646.rlib" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/nix/store/iq9s4j1lm3zzhzwjwnmfajaslcwxqjqn-rustc-1.70.0/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/private/tmp/nix-build-pg_jsonschema-unstable-2023-07-23.drv-0/source/target/release/deps/libpg_jsonschema.dylib" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs"
  = note: Undefined symbols for architecture x86_64:
            "_pfree", referenced from:
                pgrx_pg_sys::pg14::pfree::hd7f99e5af3b1e237 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_errcode", referenced from:
                pgrx_pg_sys::submodules::panic::do_ereport::h76239cb772b10c07 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_errstart", referenced from:
                pgrx_pg_sys::submodules::panic::do_ereport::h76239cb772b10c07 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_errmsg", referenced from:
                pgrx_pg_sys::submodules::panic::do_ereport::h76239cb772b10c07 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_palloc0", referenced from:
                pgrx_pg_sys::pg14::palloc0::h29dfa4594968dac2 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_errdetail", referenced from:
                pgrx_pg_sys::submodules::panic::do_ereport::h76239cb772b10c07 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_errfinish", referenced from:
                pgrx_pg_sys::submodules::panic::do_ereport::h76239cb772b10c07 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_error_context_stack", referenced from:
                pgrx_pg_sys::submodules::panic::run_guarded::h9bde80271f11e9f4 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::submodules::panic::run_guarded::hf3cbed520dc96b8b in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx::fcinfo::pg_12_13_14_15::pg_getarg::hf467340e66472a8c in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::pg14::palloc0::h29dfa4594968dac2 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::pg14::pfree::hd7f99e5af3b1e237 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::pg14::CopyErrorData::h2621d2943cb0700d in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::pg14::FreeErrorData::h89392aca3a387abe in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                ...
            "_pg_detoast_datum", referenced from:
                pgrx::fcinfo::pg_12_13_14_15::pg_getarg::hf467340e66472a8c in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_palloc", referenced from:
                pgrx_pg_sys::pg14::palloc::h425edd95cb2454cb in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_FreeErrorData", referenced from:
                pgrx_pg_sys::pg14::FreeErrorData::h89392aca3a387abe in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_pg_detoast_datum_packed", referenced from:
                pgrx_pg_sys::submodules::panic::run_guarded::hf3cbed520dc96b8b in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_jsonb_out", referenced from:
                pgrx_pg_sys::submodules::panic::run_guarded::hf3cbed520dc96b8b in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_initArrayResult", referenced from:
                pgrx_pg_sys::submodules::panic::run_guarded::h9bde80271f11e9f4 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_accumArrayResult", referenced from:
                pgrx_pg_sys::submodules::panic::run_guarded::h9bde80271f11e9f4 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_ErrorContext", referenced from:
                _json_matches_schema_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _jsonb_matches_schema_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _jsonschema_is_valid_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _jsonschema_validation_errors_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::submodules::panic::do_ereport::h76239cb772b10c07 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_errhint", referenced from:
                pgrx_pg_sys::submodules::panic::do_ereport::h76239cb772b10c07 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_makeArrayResult", referenced from:
                pgrx_pg_sys::submodules::panic::run_guarded::h9bde80271f11e9f4 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_CurrentMemoryContext", referenced from:
                pgrx_pg_sys::submodules::panic::run_guarded::h9bde80271f11e9f4 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::submodules::panic::run_guarded::hf3cbed520dc96b8b in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx::fcinfo::pg_12_13_14_15::pg_getarg::hf467340e66472a8c in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _json_matches_schema_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _jsonb_matches_schema_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _jsonschema_is_valid_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _jsonschema_validation_errors_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                ...
            "_CopyErrorData", referenced from:
                pgrx_pg_sys::pg14::CopyErrorData::h2621d2943cb0700d in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
            "_PG_exception_stack", referenced from:
                pgrx_pg_sys::submodules::panic::run_guarded::h9bde80271f11e9f4 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::submodules::panic::run_guarded::hf3cbed520dc96b8b in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx::fcinfo::pg_12_13_14_15::pg_getarg::hf467340e66472a8c in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::pg14::palloc0::h29dfa4594968dac2 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::pg14::pfree::hd7f99e5af3b1e237 in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::pg14::CopyErrorData::h2621d2943cb0700d in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                pgrx_pg_sys::pg14::FreeErrorData::h89392aca3a387abe in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                ...
            "_pg_re_throw", referenced from:
                _json_matches_schema_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _jsonb_matches_schema_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _jsonschema_is_valid_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
                _jsonschema_validation_errors_wrapper in pg_jsonschema.pg_jsonschema.7b17d81a-cgu.0.rcgu.o
          ld: symbol(s) not found for architecture x86_64
          clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

I don't know why this is yet, and hitting it with a hammer hasn't yet revealed anything.

@thoughtpolice thoughtpolice added the bug Something isn't working label Aug 14, 2023
@steve-chavez
Copy link
Member

Maybe we can disable pgrx extensions for MacOS users, this will at least make it possible for them to try nix-postgres

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants