Update cargo config file for Alpine.

This commit is contained in:
jcamiel 2023-03-10 17:44:34 +01:00
parent d2eceb20ae
commit 05c54e92bc
No known key found for this signature in database
GPG Key ID: 07FF11CFD55356CC
2 changed files with 11 additions and 6 deletions

View File

@ -3,3 +3,8 @@
# in order to produce a valid binary (mainly because of curl crate)
[target.'cfg(target_env = "musl")']
rustflags = ["-Ctarget-feature=-crt-static"]
# Desactivate static linking for `cargo test --doc`
# Should be only activated for Alpine but I don't know how to set it...
[build]
rustdocflags = ["-Ctarget-feature=-crt-static"]

View File

@ -347,13 +347,13 @@ impl Client {
};
if verbose {
// FIXME: the cast to u64 seems not necessary.
// If we dont cast from u128 and try to format! or println!
// we have a segfault on Alpine Docker images and Rust 1.68.0, whereas it was
// ok with Rust >= 1.67.0.
let duration = duration.as_millis() as u64;
logger.debug_important(
format!(
"Response: (received {} bytes in {} ms)",
length,
duration.as_millis()
)
.as_str(),
format!("Response: (received {length} bytes in {duration} ms)").as_str(),
);
logger.debug("");