python / python/cpython

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

Offen
#149,021 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

build OS-unsupported type-bug
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Das Issue verweist auf das Makefile und weist darauf hin, dass -e durch #100220 hinzugefügt wurde; beginne dort und vergleiche die Behandlung von SHELL durch AIX make mit dem zitierten POSIX-Verhalten. Reproduziere den Fehler auf AIX oder untersuche die verlinkte Arbeit gh-149022; der Abschluss ist angezeigt, wenn das Makefile keinen ungültigen Shell-Pfad mehr an AIX make übergibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, shell
Bereich
build-system, operating-systems
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.