Closed sksat closed 2 years ago
状況からして,たぶんCIが通ってしまっているのがおかしい
今めっちゃ疑っているのはgcc(というかlibc++か)のバージョン差異です
ubuntu:focal
だとExtLibrariesのビルドにコケまくるが,これはCMakeのバージョンによるものか...?(3.16.3)
ubuntu:focal
で,(ExtLibrariesがコケたところは手動でどうにかしたけど)同じ操作でビルド成功(ビルドCIの再現ができた).
ということで,問題は
3.22.1
, 3.23.1
では大丈夫)
.c/.h
が入ってない<map>
から紆余曲折あってなぜか<cstddef>
が読まれてる?(or GCC拡張?)ubuntu-latest
はまだfocal
なのでGCC 9系が入るの2つ
なので,やるべきこととしては
<cstddef>
を適切にincludeするようにするあとCIで諸々の使ってるやつのバージョン表示する,とかもかな
あっActionsのCMakeはWinもUbuntuも3.23.0なのか
@sksat こちら、v5.0.0更新前に修正したほうが良いと思っていますが、私ができる範囲であればやるので遠慮なく申し付けてください。私の環境ではビルドエラーは出ていませんが、GCCのバージョンを更新したほうが良いですよね?
あ,そうですね.やるだけなのでやります.
focalだと素直にはgcc-10
までしかないか.まあ試してみよう.
結局gcc-11
になりました.とりあえず実用上は #111 で問題ないです.
clangとCMakeの話はここで出たというだけで別問題なので別Issueとします.
ありがとうございます。こちらは次のような理解で良いのでしょうか?
いや,コンパイラ(正確には標準ライブラリ)の実装が適当でないことによって適当でないコードのコンパイルが通っていた,ということが問題なので,ユーザ・開発者がgccのバージョンを意識する必要はあまりないです.
今回のように手元でエラー出ていなくても、CIがエラー出すからその時に気づいて修正すれば良いって感じですかね。
そういうことです.基本的にCIが最大限エラー・ワーニングを出せればよい(その意味で最新のコンパイラを使うとワーニングが増えていたりしてよいがち),という考えです. 準拠すべきなのは各々のコンパイラやバージョンによる差異ではなくC++の規格(のバージョン)であって,複数のコンパイラ実装でビルドCIを組むことでその差異に気付けるようにしたい,というかんじです.なので,コンパイラのバージョンを気にするとしてもCI側で複数バージョンのコンパイラでビルドするようにしたいですかね(が,これははあまり必要ないと思います).
わかりました。ありがとうございます。
Overview
Build failed on some Linux environment because of lack of include
cstddef
.Details
Description
Some files use
size_t
type without includecstdef
.src/Interface/SpacecraftInOut/Ports/I2CPort.h
Conditions of occurrence
ubuntu:latest
(Docker Image)build-essential, git, cmake, gcc-11-multilib, g++-11-multilib
Additional information
Build log
Task
cstddef
Scope of influence
Some Linux environment.
Supplement
Write additional comments if you need.
Note
priority
label if possible.