Skip to content

WASM builds fail on bindings generated by bindgen 0.70.0 or later #156

@ajrcarey

Description

@ajrcarey

During import of pdfium_6666 bindings as part of #137, upgraded bindgen dependency to latest 0.70.1 and regenerated bindings using command

cargo build --features "bindings"

WASM builds fail to build with errors:

error[E0080]: evaluation of constant value failed
|    --> /pdfium/src/bindgen/pdfium_6666.rs:652:28
|     |
| 652 |     ["Size of FPDF_BSTR_"][::std::mem::size_of::<FPDF_BSTR_>() - 16usize];
|     |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 16_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|    --> /pdfium/src/bindgen/pdfium_6666.rs:809:38
|     |
| 809 |     ["Size of FPDF_LIBRARY_CONFIG_"][::std::mem::size_of::<FPDF_LIBRARY_CONFIG_>() - 48usize];
|     |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `24_usize - 48_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|    --> /pdfium/src/bindgen/pdfium_6666.rs:882:33
|     |
| 882 |     ["Size of FPDF_FILEACCESS"][::std::mem::size_of::<FPDF_FILEACCESS>() - 24usize];
|     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `12_usize - 24_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|    --> /pdfium/src/bindgen/pdfium_6666.rs:936:35
|     |
| 936 |     ["Size of FPDF_FILEHANDLER_"][::std::mem::size_of::<FPDF_FILEHANDLER_>() - 56usize];
|     |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `28_usize - 56_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:1053:35
|      |
| 1053 |     ["Size of FPDF_COLORSCHEME_"][::std::mem::size_of::<FPDF_COLORSCHEME_>() - 32usize];
|      |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `16_usize - 32_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:1624:20
|      |
| 1624 |     ["Size of tm"][::std::mem::size_of::<tm>() - 56usize];
|      |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `44_usize - 56_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:1649:26
|      |
| 1649 |     ["Size of timespec"][::std::mem::size_of::<timespec>() - 16usize];
|      |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 16_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:1667:28
|      |
| 1667 |     ["Size of itimerspec"][::std::mem::size_of::<itimerspec>() - 32usize];
|      |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `16_usize - 32_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:1695:33
|      |
| 1695 |     ["Size of __locale_struct"][::std::mem::size_of::<__locale_struct>() - 232usize];
|      |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `116_usize - 232_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:1898:33
|      |
| 1898 |     ["Size of _UNSUPPORT_INFO"][::std::mem::size_of::<_UNSUPPORT_INFO>() - 16usize];
|      |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 16_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:1939:30
|      |
| 1939 |     ["Size of _IFSDK_PAUSE"][::std::mem::size_of::<_IFSDK_PAUSE>() - 24usize];
|      |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `12_usize - 24_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:2514:34
|      |
| 2514 |     ["Size of _IPDF_JsPlatform"][::std::mem::size_of::<_IPDF_JsPlatform>() - 104usize];
|      |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `52_usize - 104_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:2850:36
|      |
| 2850 |     ["Size of _FPDF_FORMFILLINFO"][::std::mem::size_of::<_FPDF_FORMFILLINFO>() - 280usize];
|      |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `140_usize - 280_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:3675:33
|      |
| 3675 |     ["Size of FPDF_FILEWRITE_"][::std::mem::size_of::<FPDF_FILEWRITE_>() - 16usize];
|      |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 16_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:3853:31
|      |
| 3853 |     ["Size of _FX_FILEAVAIL"][::std::mem::size_of::<_FX_FILEAVAIL>() - 16usize];
|      |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 16_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:3886:35
|      |
| 3886 |     ["Size of _FX_DOWNLOADHINTS"][::std::mem::size_of::<_FX_DOWNLOADHINTS>() - 16usize];
|      |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 16_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:4315:35
|      |
| 4315 |     ["Size of _FPDF_SYSFONTINFO"][::std::mem::size_of::<_FPDF_SYSFONTINFO>() - 72usize];
|      |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `36_usize - 72_usize`, which would overflow
| 
| error[E0080]: evaluation of constant value failed
|     --> /pdfium/src/bindgen/pdfium_6666.rs:4349:38
|      |
| 4349 |     ["Size of FPDF_CharsetFontMap_"][::std::mem::size_of::<FPDF_CharsetFontMap_>() - 16usize];
|      |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 16_usize`, which would overflow

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions