python / python/cpython

`__builtin_os_log_format_buffer_size` is missing for Catalina+GCC

オープン
#132,182 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

build OS-mac pending type-bug
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Bug report

Bug description:

Build fails on macOS with gcc.

/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/preconfig.o Python/preconfig.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/pyarena.o Python/pyarena.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/pyctype.o Python/pyctype.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/pyfpe.o Python/pyfpe.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/pyhash.o Python/pyhash.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/pylifecycle.o Python/pylifecycle.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/pymath.o Python/pymath.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/pystate.o Python/pystate.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/pythonrun.o Python/pythonrun.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/pytime.o Python/pytime.c
In file included from Python/pylifecycle.c:64:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/os/log.h:17:2: error: #error using os/log.h requires Xcode 8 or later
   17 | #error using os/log.h requires Xcode 8 or later
      |  ^~~~~
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64   -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk   -DPy_BUILD_CORE -o Python/qsbr.o Python/qsbr.c
Python/pytime.c: In function 'py_get_system_clock':
Python/pytime.c:940:20: warning: unused variable 'tv' [-Wunused-variable]
  940 |     struct timeval tv;
      |                    ^~
Python/pylifecycle.c: In function 'apple_log_write_impl':
Python/pylifecycle.c:2973: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
 2973 |     os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
Python/pylifecycle.c:2973: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
Python/pylifecycle.c:2973: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
Python/pylifecycle.c:2973:5: warning: 'internal_linkage' attribute directive ignored [-Wattributes]
 2973 |     os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
      |     ^~~~~~~~~~~~~~~~
In file included from /opt/local/lib/gcc14/gcc/x86_64-apple-darwin19/14.2.0/include-fixed/os/trace.h:17,
                 from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/os/log.h:14:
Python/pylifecycle.c:2973:5: error: implicit declaration of function '__builtin_os_log_format_buffer_size' [-Wimplicit-function-declaration]
 2973 |     os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
      |     ^~~~~~~~~~~~~~~~
Python/pylifecycle.c:2973:5: error: implicit declaration of function '__builtin_os_log_format'; did you mean '__builtin_isnormal'? [-Wimplicit-function-declaration]
 2973 |     os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
      |     ^~~~~~~~~~~~~~~~
Python/pylifecycle.c:2973: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
 2973 |     os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
make: *** [Python/pylifecycle.o] Error 1

Catalina has Xcode 12 though:

% /usr/bin/xcodebuild -version
Xcode 12.4
Build version 12D4e

Is this Apple bug?

CPython versions tested on:

3.13

Operating systems tested on:

macOS

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

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

はじめの一歩

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

調査の方向性

Python/pylifecycle.c の apple_log_write_impl から始め、GCC 14、macOS 10.15 SDK、および示されているコンパイラフラグを使って、報告された Catalina のビルドを再現します。SDK の os/log.h と関連するヘッダーを調べて、不足している builtins を理解します。CPython のビルドが暗黙的な宣言のエラーなしに完了すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, python
領域
build-system, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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