Skip to content

zipapp compression input does not allow valid values #3646

@nate-england

Description

@nate-england

🐞 bug report

Affected Rule

The issue is caused by the rule: py_zipapp_binary

Is this a regression?

No, this is a new rule

Description

A clear and concise description of the problem...

You're supposed to be able to specify compression per

"compression": attr.string(
doc = """
The compression level to use.
Typically 0 to 9, with higher numbers being to compress more.
""",
default = "",
),
. Bazel requires this value to be a string, so you have to specify it with quotes like "9".

🔬 Minimal Reproduction

Create any py_zipapp_binary and try to specify compression

🔥 Exception or Error




This makes the call unhappy and you get an error like this.
```

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
usage: zipper_.py [-h] [--compression COMPRESSION]
                  [--workspace-name WORKSPACE_NAME]
                  [--legacy-external-runfiles {0,1}]
                  [--runfiles-dir RUNFILES_DIR]
                  manifest output
zipper_.py: error: argument --compression: invalid int value: '%s'
```

🌍 Your Environment

Operating System:
Linux

Output of bazel version:
8.4.2

Rules_python version:
1.9.0

Anything else relevant?
It looks like a simple format = is missing in the line that is supposed to support compression setting.

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