python / python/cpython

Invalid `SHELL` in `Makefile` for AIX builds?

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

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

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

説明

Bug report

Bug description:

When trying to build CPython on AIX, the make steps fails immediately with the following error message:

$ ./configure
[...]
$ make       
/bin/sh -e: not found

make: 1254-004 The error code from the last command is 1.


Stop.

AIX make(1) interprets whatever is assigned to the SHELL variable as a file path to the shell. It thus tries to use a shell named "/bin/sh -e":

execve("/bin/sh -e", 0x0000000110004D28, 0x0FFFFFFFFFFFFB90) Err#2  ENOENT

The -e was added by #100220, however I wonder if this is the right approach.

Going by POSIX I think -e should be the default unless it is explicitly disabled:

The execution line shall then be executed by a shell as if it were passed as the argument to the system() interface, except that if errors are not being ignored then the shell -e option shall also be in effect. If errors are being ignored for the command (as a result of the -i option, a '-' command prefix, or a .IGNORE special target), the shell -e option shall not be in effect.

I assume the -e was added for GNU make, which does not set -e unless it is set to POSIX-conforming mode (GNU make: Choosing the shell).

If the Makefile is defined to be a POSIX Makefile, wouldn't it be better to define .POSIX: in the makefile?

Quick test with GNU make:

$ cat Makefile
.POSIX:

SHELL = /bin/sh

test:
	false; echo after false
$ make --version
GNU Make 4.4.1
Built for powerpc64le-unknown-linux-musl
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ make test
false; echo after false
make: *** [Makefile:4: test] Error 1
CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs
  • gh-149022

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

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

はじめの一歩

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

調査の方向性

この issue は Makefile を指摘しており、-e が #100220 によって追加されたことを記している。まずそこから始め、AIX make の SHELL の扱いを、引用されている POSIX の動作と比較する。AIX で失敗を再現するか、リンクされている gh-149022 の作業を調査する。Makefile が無効なシェルパスを AIX make に渡さなくなった時点で、完了とみなされる。

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

評価

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

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

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