informationsea / xlsxwriter-rs

Excel file writer for Rust
https://crates.io/crates/xlsxwriter
Apache License 2.0
265 stars 44 forks source link

Compilation failure with outdated `libxlsxwriter_sys` #51

Open rikhuijzer opened 1 year ago

rikhuijzer commented 1 year ago

Compilation of xlsxwriter v0.5.0 failed for me with the following error:

   Compiling xlsxwriter v0.5.0
error[E0412]: cannot find type `size_t` in crate `libxlsxwriter_sys`
Error:     --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/xlsxwriter-0.5.0/src/worksheet/mod.rs:1351:52
     |
1351 |                 buffer.len() as libxlsxwriter_sys::size_t,
     |                                                    ^^^^^^ help: a type alias with a similar name exists: `time_t`
     |
    ::: /home/runner/work/qe/qe/target/debug/build/libxlsxwriter-sys-daf207466914eb99/out/bindings.rs:361:1
     |
361  | pub type time_t = __time_t;
     | --------------- similarly named type alias `time_t` defined here

error[E0412]: cannot find type `size_t` in crate `libxlsxwriter_sys`
Error:     --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/xlsxwriter-0.5.0/src/worksheet/mod.rs:1375:52
     |
1375 |                 buffer.len() as libxlsxwriter_sys::size_t,
     |                                                    ^^^^^^ help: a type alias with a similar name exists: `time_t`
     |
    ::: /home/runner/work/qe/qe/target/debug/build/libxlsxwriter-sys-daf207466914eb99/out/bindings.rs:361:1
     |
361  | pub type time_t = __time_t;
     | --------------- similarly named type alias `time_t` defined here

error[E0063]: missing fields `output_buffer` and `output_buffer_size` in initializer of `lxw_workbook_options`
Error:    --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/xlsxwriter-0.5.0/src/workbook.rs:103:40
    |
103 |             let mut workbook_options = libxlsxwriter_sys::lxw_workbook_options {
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `output_buffer` and `output_buffer_size`

This is due to the fact that libxlsxwriter-sys was tagged as a non-breaking release:

    Updating libxlsxwriter-sys v1.1.4 -> v1.1.5

Whereas this appears to be breaking.

For now, I could fix this by switching over to xlsxwriter v0.6.0. I just thought it was good to report this breakage because xlsxwriter v0.5.0 is currently broken.

RainyCityCoder commented 9 months ago

v0.6.0 now having this issue.

ryanmcgrath commented 6 months ago

The issue here is that systems that default to Clang-15 are going to run up against these warnings as it enforces certain cases that'll be problematic for newer C.

@informationsea the upstream repository has already fixed this on their side. How much effort is it to cut an updated release of this repository? I understand you're unable to devote full time support to this library, but this will be effectively broken moving forward unless fixed... any thoughts?