bazel-contrib / bazel-contrib/rules_multitool

Consider support for pulling multiple tools out of one archive or pkg

Open
#24 1 comment 6 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
25
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Sometimes, several applicable tools come packaged in the same archive.

@andyscott mentioned in https://github.com/theoremlp/rules_multitool/pull/22#issuecomment-2011165507:
> As a heads up since you're going to be thinking about the schema: I was planning to open another PR to add add support for multiple binaries from a single archive. E.g. the envtest suite from https://kubebuilder-tools.storage.googleapis.com/kubebuilder-tools-1.27.1-darwin-amd64.tar.gz contains:
>
> ```
> kubebuilder/bin/etcd
> kubebuilder/bin/kube-apiserver
> kubebuilder/bin/kubectl
> ```

Currently, our environment repos have a layout of something like:
```
tools/{tool_name}/{os}_{cpu}_archive/
tools/{tool_name}/{os}_{cpu}_executable -> symlink to a file in archive
```

We could consider updating the layout to something like:
```
archives/{archive_alias}/
archives/BUILD.bazel # export all dirs
tools/{tool_name}/{os}_{cpu}_executable -> symlink to a file in archive
```

Which would better support this particular use-case.

It's not obvious whether `{archive_alias}` should be the filename, filename+sha256, or a user-supplied value in the lockfile. We could add a new 'reference-archive' binary kind that depends on the alias, or we could tie together archives automatically. The specifics here need a bit more of a plan, but something of this shape is probably a thing we'd be willing to adopt in the repo.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.