Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benbrittain/buckle
A buck2 launcher
https://github.com/benbrittain/buckle
Last synced: about 2 months ago
JSON representation
A buck2 launcher
- Host: GitHub
- URL: https://github.com/benbrittain/buckle
- Owner: benbrittain
- License: mit
- Created: 2023-06-10T14:22:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-10T19:08:29.000Z (6 months ago)
- Last Synced: 2024-07-08T17:38:43.310Z (2 months ago)
- Language: Rust
- Size: 36.1 KB
- Stars: 23
- Watchers: 6
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-buck2 - buckle
README
# Buckle
Buckle is a launcher for [Buck2](https://buck2.build/). It manages Buck2 on a per-project basis. This enables a project or team to do seamless upgrades of their build system tooling.
It is designed to be minimally intrusive. Buckle only manages fetching Buck2 and enforcing the prelude is upgraded in sync.
## Installation
There are multiple ways to install the `buckle` binary.
### Prebuilts
There are prebuilts available for Linux, Windows, and MacOS hosted on [GitHub](https://github.com/benbrittain/buckle/releases).
```
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/benbrittain/buckle/releases/download/v1.0.0/buckle-installer.sh | sh
```### Building from source
```
cargo install buckle
```## How To Use
### Invoke buck2
The most basic thing Buckle does is invoke the `buck2` binary. Use it as follows:```bash
buckle build //...
```By default, all of the above installation methods install the binary as `buckle`. You may also wish to add an alias to your shell:
```bash
alias buck2='buckle'```
This will prevent you from accidently using the incorrect Buck2 version.
### Specifying a Buck2 version
A `.buckversion` file is what allows you to pin your buck2 installation for all downstream users. Put it in the root of the Buck2 project.`latest` or the release date in format YYYY-MM-DDD. [buck2 releases](https://github.com/facebook/buck2/releases)
Example `.buckversion`:
```
2023-07-15
````buckle` supports an environment variable that can override the `.buckversion` file.
```bash
USE_BUCK2_VERSION=latest buckle //...
```### Prelude check
When upgraded, `buck2` will likely not be syncronized with the standard prelude anymore. Buckle will notify in this scenario what prelude is expected and how to upgrade.There are reasonable scenarios where someone actively working on the build system might be carrying a patch on the standard `buck2` prelude. To disable the Buckle warnings of the mismatch:
```bash
export BUCKLE_PRELUDE_CHECK=NO
```
### Changing the installation directory
Buckle stores the `buck2` binary in a different place dependent on the OS.Linux: `$XDG_CACHE_HOME/buckle` or `$HOME/.cache/buckle`
MacOS: `$HOME/Library/Caches/buckle`
Windows `%LocalAppData%/buckle`
you may also specify an override with the `BUCKLE_CACHE` environment variable.
```bash
export BUCKLE_CACHE=/tmp
```