-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Schema generation empty on alpine #340
Comments
This is quite curious! It seems that while the generated 0ab4bd9d41d7:~/test$ objdump -TC target/debug/libtest.so | grep __pgx_
0000000000016f00 g DF .text 000000000000012b Base __pgx_marker
0000000000017050 g DF .text 000000000000045e Base __pgx_internals_fn_hello_test
0ab4bd9d41d7:~/test$ nm -D target/debug/libtest.so | grep __pgx_
0000000000017050 T __pgx_internals_fn_hello_test
0000000000016f00 T __pgx_marker The 0ab4bd9d41d7:~/test$ objdump -TC target/debug/sql-generator | grep __pgx_
0ab4bd9d41d7:~/test$ nm -D target/debug/sql-generator | grep __pgx_ Where it's curious is that the schema command can see the marker: 0ab4bd9d41d7:~/test$ cargo pgx schema pg14 -f
Building SQL generator with features `pg14`
"cargo" "build" "--bin" "sql-generator" "--features" "pg14" "--no-default-features"
Finished dev [unoptimized + debuginfo] target(s) in 0.09s
Discovering SQL entities
Got object: Ok(Elf(ElfObject { code_id: None, debug_id: DebugId { uuid: "8cd3cea9-57bb-b530-c9f1-e5c0b48a5549", appendix: 0 }, arch: Amd64, kind: Library, load_address: 0x0, has_symbols: true, has_debug_info: true, has_unwind_info: true, is_malformed: false }))
Got marker: Symbol { name: "_ZN4test12__pgx_marker28_$u7b$$u7b$closure$u7d$$u7d$17hbeb91504364f6a32E", address: 0x777e40, size: 0xf }
Got marker: Symbol { name: "__pgx_marker", address: 0x7787b0, size: 0x12b }
Discovered 0 SQL entities: 0 schemas (0 unique), 0 functions, 0 types, 0 enums, 0 sqls, 0 ords, 0 hashes
running SQL generator with features `pg14`
"cargo" "run" "--bin" "sql-generator" "--features" "pg14" "--no-default-features" "--" "--sql" "sql/test-1.0.sql"
Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Running `target/debug/sql-generator --sql sql/test-1.0.sql` I wonder if Alpine will require special linker script hacking... |
So I managed to get to the bottom of this. The issue is that the |
I did look into the possibility of adding all targets, however it wasn't possible. I would have preferred that for sure. |
Alpine uses musl libc, which is identified as a different compilation target by the Rust compiler. This target was not configured to use pgx's magical linker script, so the symbols which the schema generator expects to be present were not present. Fixes #340
My change fixed this, so I'm closing it. |
Thanks!!! |
I'm hitting an issue where the generated schema file is empty on alpine linux.
The most minimal case that I have for reproduction at the moment is the following
Dockerfile
Creating that Dockerfile and then running:
The text was updated successfully, but these errors were encountered: