Invalid `SHELL` in `Makefile` for AIX builds?
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
研究方向
該 issue 指向 Makefile,並指出 -e 由 #100220 新增;從那裡開始,將 AIX make 對 SHELL 的處理與所引用的 POSIX 行為進行比較。在 AIX 上重現該故障,或檢查連結的 gh-149022 工作;當 Makefile 不再向 AIX make 傳遞無效的 shell 路徑時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- 平均合併
- 1 天 9 小時
- 30 天內合併 PR
- 558
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/cpython 的其他 Issue
-
docs pending
難度 2/5 1-3 小時 新手友好度 78/100
-
stdlib type-feature
難度 2/5 1-3 小時 新手友好度 78/100
-
stdlib type-feature
難度 2/5 1-3 小時 新手友好度 72/100
-
build type-bug
難度 2/5 1-3 小時 新手友好度 76/100
-
stdlib topic-email type-feature
難度 2/5 1-3 小時 新手友好度 70/100
相似的 Issue
-
area/auth bug comp/agent P3 platform/discord type/security
難度 2/5 1-3 小時 新手友好度 88/100
NousResearch/hermes-agent#117848 ·
-
難度 2/5 1-3 小時 新手友好度 74/100
bancolombia/sentinel#23 ·
-
test md 未關閉CI
難度 2/5 1-3 小時 新手友好度 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
難度 2/5 1-3 小時 新手友好度 74/100
langchain-ai/deepagents#6450 ·
-
bug client
難度 2/5 1-3 小時 新手友好度 88/100