Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing hash extension from cargo dylib naming

Cargo.toml

[lib]
name = "faceblaster-engine"
crate_type = ["dylib"]

Whenever I execute cargo build my dylib is named:

libfaceblaster-engine-f09635dc7c9bd155.so.

Is there anyway to add something to the .toml file to remove the hash being placed on the end?

Thanks in advance for any help!

like image 251
nathansizemore Avatar asked Oct 20 '25 14:10

nathansizemore


1 Answers

This hash is the result of a bunch of metadata, which, IIRC, includes the version of the Rust compiler used to make it. Because Rust does not have a defined ABI, you can only use this library with the exact same SHA of the compiler which was used to make it. Erasing this data would erase your ability to know if you can actually successfully use it or not.

like image 126
Steve Klabnik Avatar answered Oct 23 '25 04:10

Steve Klabnik