Skip to content

pkg_zip is very very slow with rules_python #795

@peakschris

Description

@peakschris

There are significant performance issues with pkg_zip in a bazel environment (on Windows). We were finding when bazel was simultaneously packaging many zips, each one could take 45s instead of 2s expected. We discovered that this is because Bazel's hermetic python toolchain (rules_python) uncompresses many files to prepare for every single python invocation. More discussion here: https://bazelbuild.slack.com/archives/CA306CEV6/p1701253691249489

There appear to be two workarounds:

  • use a local python instead of rules_python
  • don't use python

I've done a hacky port of build_zip tool to Go using Github Copilot, and it resolves our issue. I'm sharing it here in the hopes that it might be adopted by rules_pkg as an optional alternate language for those facing the same issue.

https://github.com/peakschris/build_zip_go

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that we are not working on but will review quarterly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions