GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-149021: Fix AIX build by dropping `-e` from `SHELL` in Makefile by pratyush618 · Pull Request #149022 · python/cpython

Conversation

@pratyush618

@pratyush618 pratyush618 commented Apr 26, 2026

Copy link
Copy Markdown

On AIX, make(1) treats the value of SHELL as a literal executable
path rather than a command line. Since gh-100220 the top-level Makefile
sets SHELL = /bin/sh -e to make complex recipes fail-fast under GNU
make, but AIX then tries to execve("/bin/sh -e", ...) and the build
aborts immediately:

$ make
/bin/sh -e: not found
make: 1254-004 The error code from the last command is 1.

POSIX requires make to invoke the shell with -e by default; GNU
make does the same once a .POSIX: special target is declared (it sets
.SHELLFLAGS = -ec). This PR:

  • adds .POSIX: as the first non-comment line in Makefile.pre.in;
  • restores SHELL = /bin/sh so the value is a valid path on AIX;
  • keeps the original fail-fast guarantee from make sharedinstall does not return failure if install commands fail #100220 on both POSIX and
    GNU make.

Verified locally with GNU Make 4.3 that a multi-command recipe
(echo a; false; echo b) aborts after false with .POSIX: set,
matching the prior SHELL = /bin/sh -e behavior.

  • Issue: Invalid SHELL in Makefile for AIX builds? #149021

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pratyush618
gh-149021: Fix AIX build by dropping -e from SHELL
6163c92
AIX make treats `SHELL` as a literal executable path, so
`SHELL = /bin/sh -e` (added in gh-100220) failed with
`/bin/sh -e: not found`. Use `.POSIX:` instead, which makes both
POSIX make and GNU make invoke the shell with `-e`.
@pratyush618
pratyush618 requested review from AA-Turner, emmatyping and erlend-aasland as code owners April 26, 2026 18:01
@bedevere-app bedevere-app Bot added the awaiting review label Apr 26, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Apr 26, 2026
Invalid SHELL in Makefile for AIX builds? #149021
Open
@picnixz

picnixz commented Apr 26, 2026

Copy link
Copy Markdown
Member
  1. Not sure it's the best way to fix it, we shouldn't change the build for all platforms. It could done for AIX-only in some sense.
  2. We have AIX buildbots I think so it's surprising that this wasn't caught. I want to understand the failure more precisely.
  3. Don't use LLMs to generate PRs. Read https://devguide.python.org/getting-started/generative-ai/ first please.
  4. I'm not entirely sure we assume GNU Make. Maybe we should set .SHELLOPTIONS ourselves? or do some other tricks?

For those reasons, I'm closing the PR until we have a cleaner fix that doesn't mess with the entire build system.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz picnixz closed this Apr 26, 2026
@pratyush618
pratyush618 deleted the gh-149021-aix-makefile-shell branch April 26, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@pratyush618 @picnixz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.