pkolaczk / latte

Latency Tester for Apache Cassandra
Apache License 2.0
176 stars 19 forks source link

Unable to build latte on Ubuntu 22.04 #58

Closed drednout closed 11 months ago

drednout commented 11 months ago

Hello!

I tried to build latte from source using cargo and latest stable rust(1.73.0), however I received a build error:

$ cargo build
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
  --> /home/dr/.asdf/installs/rust/1.73.0/registry/src/index.crates.io-6f17d22bba15001f/rune-0.12.3/src/hash.rs:68:18
   |
68 |         unsafe { mem::transmute(type_id) }
   |                  ^^^^^^^^^^^^^^
   |
   = note: source type: `std::any::TypeId` (128 bits)
   = note: target type: `hash::Hash` (64 bits)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
  --> /home/dr/.asdf/installs/rust/1.73.0/registry/src/index.crates.io-6f17d22bba15001f/rune-0.12.3/src/modules/any.rs:15:14
   |
15 |     unsafe { std::mem::transmute(item.type_hash().expect("no type known for item!")) }
   |              ^^^^^^^^^^^^^^^^^^^
   |
   = note: source type: `hash::Hash` (64 bits)
   = note: target type: `modules::any::TypeId` (128 bits)

For more information about this error, try `rustc --explain E0512`.
error: could not compile `rune` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

Build env:

╰─$ rustc --version                                                                                                                                                                                                                   
rustc 1.73.0 (cc66ad468 2023-10-03)
╰─$ uname -a
Linux eniac-4 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
╰─$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:        22.04
Codename:       jammy

Could you fix the issue or suggest a workaround?

fruch commented 11 months ago

I can confirm I'm seeing the exact same failure

fruch commented 11 months ago

switching to rune 0.12.4, seems to fix the issue: https://github.com/rune-rs/rune/releases/tag/0.12.4

drednout commented 11 months ago

@fruch, big thanks! Now I can build latte from the main branch.