Skip to content

Python zip built with bootstrap_impl=script not runnable on macOS #2030

@linzhp

Description

@linzhp

🐞 bug report

Affected Rule

The issue is caused by the rule: python/private/stage1_bootstrap_template.sh

Is this a regression?

Yes, the Python zip built with bootstrap_impl=system_python works on macOS

Description

The stage 1 bootstrapper for Python zip file cannot run on macOS

🔬 Minimal Reproduction

  1. Build a zip file with bazel build --build_python_zip --@rules_python//python/config_settings:bootstrap_impl=script
  2. Run the zip file on macOS

🔥 Exception or Error


mktemp: unrecognized option `--suffix'
usage: mktemp [-d] [-p tmpdir] [-q] [-t prefix] [-u] template ...
       mktemp [-d] [-p tmpdir] [-q] [-u] -t prefix

🌍 Your Environment

Operating System:

macOS Sonoma 14.5

Output of bazel version:

7.2.0

Rules_python version:

0.33.2

Anything else relevant?
This line is triggered when running a Python zip file. However, the mktemp command on macOS doesn't have the option --suffix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions