Garage v0.9.0 fails to build on MacOS (available space estimation) #653

Closed
opened 2023-10-15 13:31:30 +00:00 by baptiste · 0 comments
Owner

Reported on Matrix, and tested on cfarm104 with rustc 1.70 from homebrew.

$ cargo build -p garage_rpc
   Compiling garage_rpc v0.9.0 (/Users/baptiste/garage/src/rpc)
error[E0308]: mismatched types
   --> src/rpc/system.rs:902:40
    |
902 |                 let avail = x.blocks_available() * x.fragment_size() as u64;
    |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`

error[E0277]: cannot multiply `u32` by `u64`
   --> src/rpc/system.rs:902:38
    |
902 |                 let avail = x.blocks_available() * x.fragment_size() as u64;
    |                                                  ^ no implementation for `u32 * u64`
    |
    = help: the trait `Mul<u64>` is not implemented for `u32`
    = help: the following other types implement trait `Mul<Rhs>`:
              <&'a u32 as Mul<u32>>
              <&u32 as Mul<&u32>>
              <u32 as Mul<&u32>>
              <u32 as Mul<ByteSize>>
              <u32 as Mul<Duration>>
              <u32 as Mul>

error[E0308]: mismatched types
   --> src/rpc/system.rs:903:30
    |
903 |                 let total = x.blocks() * x.fragment_size() as u64;
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`

error[E0277]: cannot multiply `u32` by `u64`
   --> src/rpc/system.rs:903:28
    |
903 |                 let total = x.blocks() * x.fragment_size() as u64;
    |                                        ^ no implementation for `u32 * u64`
    |
    = help: the trait `Mul<u64>` is not implemented for `u32`
    = help: the following other types implement trait `Mul<Rhs>`:
              <&'a u32 as Mul<u32>>
              <&u32 as Mul<&u32>>
              <u32 as Mul<&u32>>
              <u32 as Mul<ByteSize>>
              <u32 as Mul<Duration>>
              <u32 as Mul>

error[E0308]: mismatched types
   --> src/rpc/system.rs:909:26
    |
909 |         self.meta_disk_avail = mount_avail(meta_dir).map(|(_, a, t)| (a, t));
    |         --------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<(u64, u64)>`, found `Option<(u32, u32)>`
    |         |
    |         expected due to the type of this binding
    |
    = note: expected enum `std::option::Option<(u64, u64)>`
               found enum `std::option::Option<(u32, u32)>`

error[E0308]: mismatched types
   --> src/rpc/system.rs:911:32
    |
911 |             DataDirEnum::Single(dir) => mount_avail(dir).map(|(_, a, t)| (a, t)),
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<(u64, u64)>`, found `Option<(u32, u32)>`
    |
    = note: expected enum `std::option::Option<(u64, u64)>`
               found enum `std::option::Option<(u32, u32)>`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `garage_rpc` (lib) due to 6 previous errors
Reported on Matrix, and tested on [cfarm104](https://portal.cfarm.net/machines/list/) with rustc 1.70 from homebrew. ``` $ cargo build -p garage_rpc Compiling garage_rpc v0.9.0 (/Users/baptiste/garage/src/rpc) error[E0308]: mismatched types --> src/rpc/system.rs:902:40 | 902 | let avail = x.blocks_available() * x.fragment_size() as u64; | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64` error[E0277]: cannot multiply `u32` by `u64` --> src/rpc/system.rs:902:38 | 902 | let avail = x.blocks_available() * x.fragment_size() as u64; | ^ no implementation for `u32 * u64` | = help: the trait `Mul<u64>` is not implemented for `u32` = help: the following other types implement trait `Mul<Rhs>`: <&'a u32 as Mul<u32>> <&u32 as Mul<&u32>> <u32 as Mul<&u32>> <u32 as Mul<ByteSize>> <u32 as Mul<Duration>> <u32 as Mul> error[E0308]: mismatched types --> src/rpc/system.rs:903:30 | 903 | let total = x.blocks() * x.fragment_size() as u64; | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64` error[E0277]: cannot multiply `u32` by `u64` --> src/rpc/system.rs:903:28 | 903 | let total = x.blocks() * x.fragment_size() as u64; | ^ no implementation for `u32 * u64` | = help: the trait `Mul<u64>` is not implemented for `u32` = help: the following other types implement trait `Mul<Rhs>`: <&'a u32 as Mul<u32>> <&u32 as Mul<&u32>> <u32 as Mul<&u32>> <u32 as Mul<ByteSize>> <u32 as Mul<Duration>> <u32 as Mul> error[E0308]: mismatched types --> src/rpc/system.rs:909:26 | 909 | self.meta_disk_avail = mount_avail(meta_dir).map(|(_, a, t)| (a, t)); | -------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<(u64, u64)>`, found `Option<(u32, u32)>` | | | expected due to the type of this binding | = note: expected enum `std::option::Option<(u64, u64)>` found enum `std::option::Option<(u32, u32)>` error[E0308]: mismatched types --> src/rpc/system.rs:911:32 | 911 | DataDirEnum::Single(dir) => mount_avail(dir).map(|(_, a, t)| (a, t)), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Option<(u64, u64)>`, found `Option<(u32, u32)>` | = note: expected enum `std::option::Option<(u64, u64)>` found enum `std::option::Option<(u32, u32)>` Some errors have detailed explanations: E0277, E0308. For more information about an error, try `rustc --explain E0277`. error: could not compile `garage_rpc` (lib) due to 6 previous errors ```
lx closed this issue 2023-10-16 09:33:34 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#653
No description provided.