Closed alex-lavriv closed 1 year ago
Hmm, I can't reproduce the problem, can you retry a clean build by running cargo clean
before cargo build
?
If the error still occurs, please consider providing a minimal reproducible code.
It seems like a dependency issue
main.rs
use spdlog::Logger;
use spdlog::prelude::*;
use std::sync::Arc;
fn main() {
spdlog::init_log_crate_proxy()
.expect("users should only call `init_log_crate_proxy` function once");
let custom_logger: Arc<Logger> = spdlog::default_logger();
let proxy: &'static spdlog::LogCrateProxy = spdlog::log_crate_proxy();
proxy.set_logger(Some(custom_logger));
info!("Test");
}
Cargo.toml
[package]
name = "spdlog_min"
version = "0.1.0"
edition = "2021"
[dependencies]
log = "0.4.19"
spdlog-rs = {version = "0.3.9", features = ["source-location", "log"]}
Dockerfile
FROM phusion/baseimage:18.04-1.0.0
RUN apt update && apt install --no-install-recommends -y \
build-essential \
awscli \
curl \
gcc \
libssl-dev \
libsystemd-dev \
make \
pkg-config \
rsync \
&& ldconfig
COPY ./src ./src
COPY ./Cargo.toml .
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
RUN ls /home/
RUN ~/.cargo/bin/cargo --version
RUN ~/.cargo/bin/cargo build --release --verbose
ENTRYPOINT ["top", "-b"]
Run
docker build .
set
spdlog-rs = {version = "0.3.9", features = ["source-location", "log"]}
to
spdlog-rs = {version = "=0.3.8", features = ["source-location", "log"]}
To see it builds.
Thanks! I have reproduced the problem from the Dockerfile you give.
It's a bit strange, for Docker, the error only occurs on phusion/baseimage:18.04-1.0.0
but works fine on phusion/baseimage:jammy-1.0.1
(Ubuntu 22.04), I'm trying to figure out why.
The reason of this error is earlier glibc
versions (before v2.30) did not provide a wrapper for gettid
, and your environment still on Ubuntu 18.04, which is a little old.
I have replaced gettid()
with direct syscall(SYS_gettid)
in #32, the problem should be fixed now. We will release a new version after #33 gets merged or closed.
Thanks for your bug report again!
Hello, The build fails with the latest release
0.3.9
with the following error:OS ubuntu 18.04 Had to force cargo to work with the previous release: