奇怪的libgcov分析错误:版本不匹配
我正在使用Docker容器构建具有G ++和代码覆盖的C ++应用程序(见下文)。一切都很好,直到这里为止。
但是,当我在同一容器中执行程序
docker运行-IT ... Image /bin /bash -c'cd build&& Unbuffer -P ./test_runner&& ./collect_gcov.sh'
我总是会出现一个错误:
libgcov proporling错误: .gcda:版本不匹配 - 预期9.4(reparter)9.4(a94 )获得9.3(a94 )(版本)(A93 )*
重点是我使用的是一个自我构建docker容器,该容器仅包括G ++ -9版本9.4.0。 GCC和GCOV也是如此。
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
COPY assets/* /
RUN mv /sources.list /etc/apt/ && \
mv /localtime /etc && \
apt update && apt install -y \
sudo \
build-essential \
gcovr \
lcov \
cmake \
git \
python3
RUN useradd -d /home/jenkins -u 1000 -ms /bin/bash -g root -G sudo -p jenkins jenkins && \
echo "jenkins ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/jenkins
USER jenkins
ENV HOME /home/jenkins
ENTRYPOINT ["/entrypoint.sh"]
我检查了不同的编译器版本等。但是仍然不知道为什么会发生这种情况。以前有人有类似的问题吗?
最好的问候
马尔特
I'm building a C++ application with g++ and code coverage using a docker container (see below). Everthing is fine until here.
But when I execute the program in the same container
docker run -it ... image /bin/bash -c 'cd build && unbuffer -p ./test_runner && ./collect_gcov.sh'
I always get an error:
libgcov profiling error: .gcda:Version mismatch - expected 9.4 (release) (A94) got 9.3 (release) (A93)*
The point is I'm using a self build docker container which only includes the g++-9 with version 9.4.0. Same for gcc and gcov.
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
COPY assets/* /
RUN mv /sources.list /etc/apt/ && \
mv /localtime /etc && \
apt update && apt install -y \
sudo \
build-essential \
gcovr \
lcov \
cmake \
git \
python3
RUN useradd -d /home/jenkins -u 1000 -ms /bin/bash -g root -G sudo -p jenkins jenkins && \
echo "jenkins ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/jenkins
USER jenkins
ENV HOME /home/jenkins
ENTRYPOINT ["/entrypoint.sh"]
I checked different compiler version etc. But still no clue why this happens. Does anybody had a similar problem before?
Best regards
Malte
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论