facebook / facebook/buck2

Giving an alias for multiple target patterns

Open
#513 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.4k
Forks
394
PR merge metrics
No merged PRs in 30d

Description

I have a bunch of top level cells called `root//`, `third-party//`, and `cellar//`, and I'd like to build *everything* across *all* of them when doing things like CI integration.

Currently, I have to do that with a very verbose command:

```
buck2 build root//... third-party//... cellar//...
```

There is an `[alias]` stanza in `.buckconfig` which lets you alias *targets*, but not target *patterns*. This does not work:

```ini
[alias]
world = root//... third-party//... cellar//...
```

```
$ buck2 build world
File changed: root//.buckconfig
Parsing target pattern `world`

Caused by:
0: Error resolving alias `world`
1: [alias] section produced a dangling chain: `world -> root//... third-party//... cellar//...`
```

## Workarounds

I think you could use `@` syntax on the command line to include a file, so something like `buck2 build @world`, but that requires an actual file existing which is pretty messy, and I don't see why `[alias]` should not work.

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.