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

Fix c_char type #285

Merged
merged 2 commits into from
Feb 27, 2023
Merged

Fix c_char type #285

merged 2 commits into from
Feb 27, 2023

Conversation

ods
Copy link
Contributor

@ods ods commented Feb 27, 2023

libpg_query::PgQueryError::message is declared as c_char, not i8. This causes error when building squawk on platforms where c_char is u8:

   Compiling squawk-parser v0.0.0 (/src/origin/parser)
error[E0308]: mismatched types======>  ] 280/292: openssl-sys(build), squawk-parser
  --> parser/src/parse.rs:12:38
   |
12 |         unsafe { Some(CStr::from_ptr(str_ptr).to_string_lossy().into()) }
   |                       -------------- ^^^^^^^ expected `u8`, found `i8`
   |                       |
   |                       arguments to this function are incorrect
   |
   = note: expected raw pointer `*const u8`
              found raw pointer `*mut i8`
note: associated function defined here
  --> /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ffi/c_str.rs:256:25


error[E0308]: mismatched types======>  ] 280/292: openssl-sys(build), squawk-parser
  --> parser/src/parse.rs:26:69
   |
26 |             return Err(PgQueryError::PgParseError(parse_str_or_none(err.message)));
   |                                                   ----------------- ^^^^^^^^^^^ expected `i8`, found `u8`
   |                                                   |
   |                                                   arguments to this function are incorrect
   |
   = note: expected raw pointer `*mut i8`
              found raw pointer `*mut u8`
note: function defined here
  --> parser/src/parse.rs:8:4
   |
8  | fn parse_str_or_none(str_ptr: *mut i8) -> Option<String> {
   |    ^^^^^^^^^^^^^^^^^ ----------------


error: aborting due to 2 previous errors 280/292: openssl-sys(build), squawk-parser


For more information about this error, try `rustc --explain E0308`.

error: could not compile `squawk-parser` due to 3 previous errors

@netlify
Copy link

netlify bot commented Feb 27, 2023

👷 Deploy request for squawkhq pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c9fc6a2

@sbdchd
Copy link
Owner

sbdchd commented Feb 27, 2023

Ty!

@sbdchd sbdchd added the automerge automerge with kodiak label Feb 27, 2023
@kodiakhq kodiakhq bot merged commit f00296f into sbdchd:master Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge automerge with kodiak
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants