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

Second invocation of cargo pgx run pg13 after building libplsci fails with "Symbol not found: _eval_string" #4

Open
borkdude opened this issue Jan 12, 2021 · 2 comments

Comments

@borkdude
Copy link
Owner

The first time after building libplsci I can successfully run cargo pgx run:

installing extension
     Copying control file to `/Users/borkdude/.pgx/13.0/pgx-install/share/postgresql/extension/plsci.control`
     Copying shared library to `/Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so`
     Writing extension schema to `/Users/borkdude/.pgx/13.0/pgx-install/share/postgresql/extension/plsci--1.0.sql`
    Finished installing plsci
    Starting Postgres v13 on port 28813
    Re-using existing database plsci
psql (13.0)
Type "help" for help.

plsci=# select * from plsci('(+ 1 2 3)');
 plsci
-------
 6
(1 row)

plsci=# ^D\q

However, the second time, I get:

$ cargo pgx run pg13
    Stopping Postgres v13
building extension with features `pg13`
"cargo" "build" "--features" "pg13" "--no-default-features"
   Compiling plsci v0.0.0 (/Users/borkdude/Dropbox/dev/clojure/plsci)
    Finished dev [unoptimized + debuginfo] target(s) in 2.83s

installing extension
     Copying control file to `/Users/borkdude/.pgx/13.0/pgx-install/share/postgresql/extension/plsci.control`
     Copying shared library to `/Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so`
     Writing extension schema to `/Users/borkdude/.pgx/13.0/pgx-install/share/postgresql/extension/plsci--1.0.sql`
    Finished installing plsci
    Starting Postgres v13 on port 28813
    Re-using existing database plsci
psql (13.0)
Type "help" for help.

plsci=# select * from plsci('(+ 1 2 3)');
ERROR:  could not load library "/Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so": dlopen(/Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so, 10): Symbol not found: _eval_string
  Referenced from: /Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so
  Expected in: flat namespace
 in /Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so
plsci=#
@borkdude
Copy link
Owner Author

borkdude commented Jan 12, 2021

@eeeebbbbrrrr any ideas maybe? it seems related to a build cache in target. Only when I remove target, then it works again, but not the second time.

@borkdude
Copy link
Owner Author

This is what I'm seeing with otool the first and second time:

$ otool -hV /Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64  X86_64        ALL  0x00       DYLIB    15       2136   NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS MH_HAS_TLV_DESCRIPTORS
$ otool -hV /Users/borkdude/.pgx/13.0/pgx-install/lib/postgresql/plsci.so
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64  X86_64        ALL  0x00       DYLIB    15       2152   NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS MH_HAS_TLV_DESCRIPTORS

It seems that sizeofcmds has grown (I'm not sure what this means).

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

1 participant