Baezon / pof-tools

Program for manipulating the Freespace model format .pof
3 stars 8 forks source link

pof crate nalgebra versions causes conflicts #124

Closed qazwsxal closed 1 year ago

qazwsxal commented 1 year ago

Using the pof crate in my own project produced the following error message on compilation:

error[E0308]: mismatched types
    --> pof\src\parse.rs:1325:9
     |
1324 |     fn transform(&self) -> Mat4x4 {
     |                            ------ expected `nalgebra::Matrix<f32, nalgebra::Const<4>, nalgebra::Const<4>, ArrayStorage<f32, 4, 4>>` because of return type
1325 |         self.transform_as_matrix()
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `nalgebra::Matrix`, found struct `nalgebra::base::matrix::Matrix`
     |
     = note: struct `nalgebra::base::matrix::Matrix` and struct `nalgebra::Matrix` have similar names, but are actually distinct types
note: struct `nalgebra::base::matrix::Matrix` is defined in crate `nalgebra`
    --> C:\Users\thepe\.cargo\registry\src\github.com-1ecc6299db9ec823\nalgebra-0.31.4\src\base\matrix.rs:162:1
     |
162  | pub struct Matrix<T, R, C, S> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: struct `nalgebra::Matrix` is defined in crate `nalgebra`
    --> C:\Users\thepe\.cargo\registry\src\github.com-1ecc6299db9ec823\nalgebra-0.30.1\src\base\matrix.rs:162:1
     |
162  | pub struct Matrix<T, R, C, S> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = note: perhaps two different versions of crate `nalgebra` are being used?

Reproduction: Make a new cargo project, copy over the pof folder, and add pof = { path = "pof" } to the dependencies.

qazwsxal commented 1 year ago

This appears to be caused by a dae-parser version bump (0.8.7->0.8.8) with a bump in nalgebra version. Unfortunately nalgebra 0.30 and 0.31 types appear to be incompatible. https://github.com/digama0/dae-parser/commit/4bae1bac311979acac90af470f7cdbfa737adf1f

Bumping the nalgebra versions and pinning dae-parser to 0.8.8 seems to fix this issue.

Baezon commented 1 year ago

Ah, pof only specifies 0.8 for dae-parser so I haven't actually gotten this update. I'll update the versions