Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Missing C++ Standard Library Headers When Building Wheels On Mac

オープン
#409 コメント 5 件 リアクション 0 件 担当者 1 名 GitHub で見る

@thomasrockhu-codecov がすでに取り組んでいます。

2024年10月10日 から。

評価

この issue はまだ評価されていません。

説明

Area: Report Upload bug codecov/codecov-cli Low

Description

I've encountered a build failure on MacOS when attempting to pip install codecov-cli, which compiles these C++ components due to the lack of a pre-built wheel: https://github.com/codecov/codecov-cli/blob/v0.5.0/setup.py#L34-L54

The specific error indicates that the <vector> header file from the C++ Standard Library cannot be found, along with other C++ specific dependencies.

Error Details

The error message received during the wheel build process is as follows:

fatal error: 'vector' file not found
#include <vector>
         ^~~~~~~~

This suggests that the build environment is not correctly configured to locate the C++ standard library headers required for compilation.

Environment

OS: MacOS

This setup seems to work:

 $ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Here's an example of a broken setup (no mention of c++):

 $ gcc --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Steps to Reproduce

  1. pip install codecov-cli from a machine without a version of CommandLineTools that includes the required C++ dependencies .
  2. Observe the failure during the wheel-building step with the error message indicating the missing <vector> header.

Resolution Steps

I performed the following steps to resolve the issue:

  1. Completely removed the existing Command Line Tools using the command:

    sudo rm -rf /Library/Developer/CommandLineTools
    
  2. Reinstalled the Command Line Tools by invoking:

    xcode-select --install
    

The fresh installation of the Command Line Tools seems to include the necessary C++ compiler and standard library headers.

Question

Is there any easier way to prevent this issue without requiring a reinstall of xcode Command Line Tools?

Do I need to start enforcing a minimum version of xcode on developer machines? Or is there work in progress to get a working wheel file?

In setup.py, should the language='c++' be set for the Extension to explicitly require a working C++ compiler?

主要言語
Python
スター
89
フォーク
64
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codecov/codecov-cli のほかの issue

codecov/codecov-cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。