bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Allow repository_ctx.extract to be told the file type explicitly

Open rickeylev opened this issue 6 months ago • 1 comments

Description of the feature request:

I have some zip files that don't have a .zip extension (Python .whl files).

In order to extract them, I have to create a symlink with the .zip extension because the extract() function doesn't allow explicitly specifying the file type.

In comparison, download_and_extract does.

On Linux, this is fairly cheap because I can symlink. On windows, symlinks aren't as easy, though.

In some cases, these files are very large (multiple gigabytes), so I want to avoid having to copy them.

Which category does this issue belong to?

No response

What underlying problem are you trying to solve with this feature?

Extract a file with a different extension.

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

Bazel 6

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?


Have you found anything relevant by searching the web?

Searched all three, didn't find any existing feature request

Any other information, logs, or outputs that you want to share?

No response

rickeylev avatar Jun 10 '25 22:06 rickeylev

This would be part of the repository_ctx API. I'm not sure if thats "external deps" (repository rules are usually related to external stuff in some way) or "rules api" (repository rules are a type of rule object), so I've tagged both for lack of my own understanding

rickeylev avatar Jun 11 '25 18:06 rickeylev

Let's do it, should be a simple change, @rickeylev can you send a PR for this?

meteorcloudy avatar Jun 17 '25 15:06 meteorcloudy

Or should we try the AI agent?

meteorcloudy avatar Jun 17 '25 15:06 meteorcloudy

Coincidentally, https://github.com/bazelbuild/bazel/issues/26307 was filed 6 days after this issue was filed, and ended up adding .whl file support in d9634ca. So I think the root problem that author had has been resolved.

The original feature request is still valid though.

I assume this is not being done by rickeylev? I can take this on. But I'll do some refactoring of the code before starting.

willstranton avatar Oct 27 '25 03:10 willstranton