Build failure on GCC/MinGW (MXE): std::ifstream constructor mismatch with Platform::filenameToUTF()
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- cpp
- 領域
- build-system
調査の方向性
src/OpenColorIO/transforms/FileTransform.cpp から始め、Platform::filenameToUTF(filepath) を使用した std::ifstream の構築を調査します。GCC/MinGW-w64 または MXE で OpenColorIO をビルドして std::wstring オーバーロードの失敗を再現し、その後、影響を受ける構成全体でパス処理がコンパイルでき、動作することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Description
OpenColorIO 2.5.1 fails to compile under GCC / MinGW-w64 (including MXE cross builds) due to inconsistent file path type handling in Platform::filenameToUTF() when used with std::ifstream in FileTransform.cpp.
The failure occurs when constructing a std::ifstream from the result of Platform::filenameToUTF(filepath), where the returned type may vary between std::string and std::wstring depending on build configuration (_WIN32 && UNICODE).
This leads to template overload resolution failures under GCC/libstdc++ when a std::wstring is involved in std::ifstream construction.
Error observed (GCC / libstdc++)
error: no matching function for call to
std::basic_ifstream<char>::basic_ifstream(const std::wstring, std::ios_base::openmode)
Affected code src/OpenColorIO/transforms/FileTransform.cpp:
std::ifstream(Platform::filenameToUTF(filepath), mode)
Root cause
Platform::filenameToUTF()is conditionally typed:std::wstringon _WIN32 && UNICODEstd::stringotherwisestd::ifstreamconstruction fromstd::wstringis not consistently supported across standard library implementations- GCC/libstdc++ rejects this usage, while MSVC may accept it depending on STL implementation details
- This creates a portability issue in file I/O path handling
Impact
- Breaks MXE / MinGW-w64 cross compilation
- Causes divergence between MSVC and GCC builds
- Introduces non-portable file path handling in core I/O utilities
Suggested fix
Avoid passing platform-dependent string types directly into std::ifstream construction.
This is the C++17-compatible solution that worked:
auto path = Platform::filenameToUTF(filepath);
return std::make_unique<std::ifstream>(path.c_str(), mode);
- 主要言語
- C++
- スター
- 2.1k
- フォーク
- 502
- 平均マージ
- 6日 3時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
AcademySoftwareFoundation/OpenColorIO のほかの issue
-
Inconsistent run-time library usage for locale handling breaks GPU code generation on some systems.オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
AcademySoftwareFoundation/OpenColorIO#2351 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
AcademySoftwareFoundation/OpenColorIO#2340 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
AcademySoftwareFoundation/OpenColorIO#2329 ·
メンテナーはふだん 1 日以内に返信
-
Documentation
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
AcademySoftwareFoundation/OpenColorIO#2280 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AcademySoftwareFoundation/OpenColorIO#2277 ·
メンテナーはふだん 1 日以内に返信
AcademySoftwareFoundation/OpenColorIO の issue をすべて見る
似ている issue
-
llvm.memcpy with destination align but no source align asserts "Missed Source alignment!"対応中かも @pvelesko が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
KhronosGroup/SPIRV-LLVM-Translator#4093 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
SIMQ silently truncates multi-query batch search to the first query対応中かも @LHT129 が今日担当しました。 オープンkind/bug module/index needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
antgroup/vsag#3080 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
[Bug] Title-bar audio controls shift horizontally when the TX timer appears and disappears対応中かも @w5jwp が今日担当しました。 オープンbug GUI maintainer-review
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aethersdr/AetherSDR#6455 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信