Skip to content

setup-python fails on self-hosted macOS: newer darwin Python assets require interactive sudo (installer -pkg) #1388

Open

Description

@dahai80

Problem

On a self-hosted macOS runner, actions/setup-python@v7 fails for Python versions whose darwin asset installs via sudo installer -pkg (e.g. 3.12.10):

Version 3.12 was not found in the local cache
Download from .../python-3.12.10-darwin-arm64.tar.gz
Execute installation script
Check if Python hostedtoolcache folder exist...
Install Python binaries from prebuilt package
##[error]sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

The asset's setup.sh (generated from actions/python-versions installers/macos-pkg-setup-template.sh, line 50) runs:

sudo installer -pkg $PYTHON_PKG_NAME ... -target /

The runner service user has no TTY, so any host without passwordless sudo for /usr/sbin/installer fails. Older assets (e.g. 3.11.9) shipped plain directory trees and installed unprivileged.

Suggestion

Document the sudo requirement and/or fail with an explicit message; a relocatable (unprivileged) darwin asset layout would remove the requirement entirely.

Related: #914, #1387.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions