supabase / wrappers

Postgres Foreign Data Wrapper development framework in Rust.
http://fdw.dev
Apache License 2.0
546 stars 53 forks source link

Compilation error - mismatched types #318

Closed glib-0 closed 1 month ago

glib-0 commented 2 months ago

Bug report

I'm trying to compile the mssql_fdw wrapper on a Raspberry Pi 4 and encountering an issue when the compiler gets to supabase-wrappers.

Describe the bug

error[E0308]: mismatched types
    --> supabase-wrappers/src/import_foreign_schema.rs:84:18
      |
      |             ret.push(command.as_pg_cstr());
      |                 ---- ^^^^^^^^^^^^^^^^^^^^ expected `*mut i8`, found `*mut u8`
      |                 |
      |                 arguments to this method are incorrect
      |
      = note: expected raw pointer `*mut i8`
                 found raw pointer `*mut u8`

To Reproduce

  1. Install Postgres 15
  2. Install pgrx-0.11.3
  3. Run cargo pgrx install --no-default-features --features pg15,mssql_fdw --release in ~/wrappers/wrappers

Expected behavior

Build completes

Screenshots

N/A

System information

Additional context

remilapeyre commented 1 month ago

The return type of as_pg_cstr() changes based on the platform. I thought I had fixed that. The previous line should be let mut ret: PgList<ffi::c_char> = PgList::new();