bazel-contrib / bazel-contrib/rules_multitool

os-/cpu-independent targets

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

Description

We've been integrating multitool, and we've realized that (due to the :cwd target) it's kind of convenient to be able to register other types of things with multitool, too, which keeps our tool setup nice and consistent. Today, it seems like the `os` and `cpu` fields are mandatory in the spec, but I was wondering what you thought about being able to pin multiple types in one field, for example:
```json
...
"my-shell-script": {
"binaries": [
{
"kind": "file",
"url": "https://raw.githubusercontent.com/my-shell-script.sh",
"sha256": "abc123",
},
...
```

(dropping os/cpu completely, and having it be the equivalent of "all", or alternately, something like this:

```json
...
"my-shell-script": {
"binaries": [
{
"kind": "file",
"url": "https://raw.githubusercontent.com/my-shell-script.sh",
"sha256": "abc123",
"platforms": [
{"os": "linux"}, # also permits a cpu field, and if omitted means "all"
{"os": "darwin"}
],
},
{
"kind": "file",
"url": "https://raw.githubusercontent.com/my-powershell-script.ps1",
"sha256": "abc123",
"platforms": [
{"os": "windows"}
],
},
...
```
In other words, a new platform key which allows one record to support multiple plats, while still being able to express differences.

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.