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

v0.4.0 fails to compile, possibly on arm-based (aarch64) mac #33

Closed
fursich opened this issue Aug 22, 2022 · 0 comments · Fixed by #34
Closed

v0.4.0 fails to compile, possibly on arm-based (aarch64) mac #33

fursich opened this issue Aug 22, 2022 · 0 comments · Fixed by #34

Comments

@fursich
Copy link

fursich commented Aug 22, 2022

First of all thank you very much for maintaining this awesome library!

problem

Our application (relying on xlsxwriter) fails to compile after updating to v0.4.0.
(I confirmed it compiles successfully upto the commit right before this update is getting merged)

Here's the message we got:

   Compiling xlsxwriter v0.4.0
error[E0308]: mismatched types
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/xlsxwriter-0.4.0/src/worksheet/table.rs:273:23
    |
273 |                 name: cstring_helper.add_opt(options.name.as_deref()) as *mut i8,
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*mut u8`
               found raw pointer `*mut i8`

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

The strange thing is that it did NOT happen to other environments - especially our CI is green, and the production app seems to be running just fine.

quick analysis

(sorry but I might be totally wrong - I'm very new to this language)

Here is the specific part the compiler is complaining on.

name: cstring_helper.add_opt(options.name.as_deref()) as *mut i8,

It looks like the above failed code is trying to cast c_char into i8, where as the official doc says that c_char could be interpreted as either i8 or u8 depending on the platform (which is also be seen around here).

Could it be the cause for this platform-depenedent issue maybe?

Anyway, it would be greatly appreciated if this can be fixed anytime soon!

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

Successfully merging a pull request may close this issue.

1 participant