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

libsqlite3-sys fails to build on arm64: error[E0308]: mismatched types #1440

Open
yurivict opened this issue Jan 24, 2024 · 2 comments
Open

Comments

@yurivict
Copy link

2330 |         fn prepare(
     |            ^^^^^^^
2331 |             self,
2332 |             sql: *const i8,
     |             --------------
2333 |             tail: *mut *const i8,
     |             --------------------
2334 |             vm: &VirtualMachine,
     |             -------------------

error[E0308]: mismatched types
    --> stdlib/src/sqlite.rs:2203:33
     |
2203 |             let st = db.prepare(sql_cstr.as_ptr(), &mut tail, vm)?;
     |                         ------- ^^^^^^^^^^^^^^^^^ expected `*const i8`, found `*const u8`
     |                         |
     |                         arguments to this method are incorrect
     |
     = note: expected raw pointer `*const i8`
                found raw pointer `*const u8`
note: method defined here
    --> stdlib/src/sqlite.rs:2330:12
     |
2330 |         fn prepare(
     |            ^^^^^^^
2331 |             self,
2332 |             sql: *const i8,
     |             --------------

error[E0308]: mismatched types
    --> stdlib/src/sqlite.rs:2209:48
     |
2203 |             let st = db.prepare(sql_cstr.as_ptr(), &mut tail, vm)?;
     |                                                         ---- here the type of `tail` is inferred to be `*const i8`
...
2209 |             let tail = unsafe { CStr::from_ptr(tail) };
     |                                 -------------- ^^^^ expected `*const u8`, found `*const i8`
     |                                 |
     |                                 arguments to this function are incorrect
     |
     = note: expected raw pointer `*const u8`
                found raw pointer `*const i8`
note: associated function defined here
    --> /wrkdirs/usr/ports/lang/rust/work/rustc-1.75.0-src/library/core/src/ffi/c_str.rs:262:25

error[E0308]: mismatched types
    --> stdlib/src/sqlite.rs:2312:21
     |
2311 |                 sqlite3_open_v2(
     |                 --------------- arguments to this function are incorrect
2312 |                     path,
     |                     ^^^^ expected `*const u8`, found `*const i8`
     |
     = note: expected raw pointer `*const u8`
                found raw pointer `*const i8`
note: function defined here
    --> /wrkdirs/usr/ports/lang/rustpython/work/target/aarch64-unknown-freebsd/release/build/libsqlite3-sys-93b5049a37d78fdc/out/bindgen.rs:1919:12
     |
1919 |     pub fn sqlite3_open_v2(
     |            ^^^^^^^^^^^^^^^

error[E0308]: arguments to this function are incorrect
    --> stdlib/src/sqlite.rs:2337:32
     |
2337 |             let ret = unsafe { sqlite3_prepare_v2(self.db, sql, -1, &mut st, tail) };
     |                                ^^^^^^^^^^^^^^^^^^
     |
note: expected `*const u8`, found `*const i8`
    --> stdlib/src/sqlite.rs:2337:60
     |
2337 |             let ret = unsafe { sqlite3_prepare_v2(self.db, sql, -1, &mut st, tail) };
     |                                                            ^^^
     = note: expected raw pointer `*const u8`
                found raw pointer `*const i8`
note: expected `*mut *const u8`, found `*mut *const i8`
    --> stdlib/src/sqlite.rs:2337:78
     |
2337 |             let ret = unsafe { sqlite3_prepare_v2(self.db, sql, -1, &mut st, tail) };
     |                                                                              ^^^^
     = note: expected raw pointer `*mut *const u8`
                found raw pointer `*mut *const i8`
note: function defined here
    --> /wrkdirs/usr/ports/lang/rustpython/work/target/aarch64-unknown-freebsd/release/build/libsqlite3-sys-93b5049a37d78fdc/out/bindgen.rs:2022:12
     |
2022 |     pub fn sqlite3_prepare_v2(
     |            ^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
    --> stdlib/src/sqlite.rs:2440:30
     |
2439 |                 sqlite3_create_function_v2(
     |                 -------------------------- arguments to this function are incorrect
2440 |                     self.db, name, narg, flags, data, func, step, finalize, destroy,
     |                              ^^^^ expected `*const u8`, found `*const i8`
     |
     = note: expected raw pointer `*const u8`
                found raw pointer `*const i8`
note: function defined here
    --> /wrkdirs/usr/ports/lang/rustpython/work/target/aarch64-unknown-freebsd/release/build/libsqlite3-sys-93b5049a37d78fdc/out/bindgen.rs:2395:12
     |
2395 |     pub fn sqlite3_create_function_v2(
     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^

Revision: 93b5049a37d78fdc
Observed while building the FreeBSD package rustpython-0.2.0 from the port lang/rustpython.
FreeBSD 14.0

@gwenn
Copy link
Collaborator

gwenn commented Jan 24, 2024

Could you please try (if you don't have already) to force bindings generation with this features: buildtime_bindgen ?
Thanks.

@yurivict
Copy link
Author

Unfortunately I don't have access to the arm64 system.
The failures occur on the build servers, and I only see the fallout logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants