MarsRaw / mars-raw-utils

Utilities for working with publicly available raw MSL & Mars2020 images
MIT License
45 stars 10 forks source link

Build with cargo failing because of vicar-rs #47

Closed sschmaus closed 1 year ago

sschmaus commented 1 year ago

I'm trying to build the kmgill_develop branch of MRU on WSL2 with Ubuntu 22, but I'm running into the following error with the vicar-rs package.

   Compiling vicar v0.1.0 (https://github.com/MarsRaw/vicar-rs.git#7809b34b)
error[E0308]: mismatched types
   --> /home/user/.cargo/git/checkouts/vicar-rs-0180baf7fc99d93d/7809b34/src/lib.rs:593:37
    |
593 |             PixelFormat::Real => Ok(self.reader.read_f32_with_endiness(start, Endian::BigEndian)),
    |                                  -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f32`, found enum `Result`
    |                                  |
    |                                  arguments to this enum variant are incorrect
    |
    = note: expected type `f32`
               found enum `Result<f32, anyhow::Error>`
note: tuple variant defined here

error[E0605]: non-primitive cast: `Result<u8, anyhow::Error>` as `f32`
   --> /home/user/.cargo/git/checkouts/vicar-rs-0180baf7fc99d93d/7809b34/src/lib.rs:586:37
    |
586 |             PixelFormat::Byte => Ok(self.reader.read_u8(start) as f32),
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0605]: non-primitive cast: `Result<i16, anyhow::Error>` as `f32`
   --> /home/user/.cargo/git/checkouts/vicar-rs-0180baf7fc99d93d/7809b34/src/lib.rs:588:20
    |
588 |                 Ok(self.reader.read_i16_with_endiness(start, Endian::BigEndian) as f32)
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0605]: non-primitive cast: `Result<i32, anyhow::Error>` as `f32`
   --> /home/user/.cargo/git/checkouts/vicar-rs-0180baf7fc99d93d/7809b34/src/lib.rs:591:20
    |
591 |                 Ok(self.reader.read_i32_with_endiness(start, Endian::BigEndian) as f32)
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

error[E0605]: non-primitive cast: `Result<i64, anyhow::Error>` as `f32`
   --> /home/user/.cargo/git/checkouts/vicar-rs-0180baf7fc99d93d/7809b34/src/lib.rs:595:20
    |
595 |                 Ok(self.reader.read_i64_with_endiness(start, Endian::BigEndian) as f32)
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

Some errors have detailed explanations: E0308, E0605.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `vicar` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `mars_raw_utils v0.7.0 (/home/user/mars-raw-utils)`, intermediate artifacts can be found at `/home/user/mars-raw-utils/target`
kmgill commented 1 year ago

OK, I made some changes to the binfilereader in support of solar_ha_processing (SolHAT) and haven't yet updated the other projects. I'll do that shortly. (I need to get better about versioning, branching with these)

kmgill commented 1 year ago

And while I'm at it, I'm probably going to merge pvl into vicar-rs

kmgill commented 1 year ago

The project has been updated. Run a cargo update then build

sschmaus commented 1 year ago

Thanks, build ran through as expected.

kmgill commented 1 year ago

Hmmm, thought I fixed that. Did you do a git pull also?

sschmaus commented 1 year ago

yes that is exactly what happened. It really is working now for me.