Skip to content

Commit

Permalink
Merge rust-bitcoin#3765: contrib: check if the user has cargo-public-api
Browse files Browse the repository at this point in the history
f01f071 api: document the need of cargo nightly (Jose Storopoli)
ff67ead contributing: clarify API changes (Jose Storopoli)
0485295 contrib: check if the user has cargo-public-api (Jose Storopoli)

Pull request description:

  Closes rust-bitcoin#3764.

  yancyribbens can you test it locally? It works in my end both with and without `cargo-public-api`. Of course without gives the error message that I was supposed to see.

  EDIT: You can run it with `just check-api`.

ACKs for top commit:
  apoelstra:
    ACK f01f071; successfully ran local tests
  tcharding:
    ACK f01f071

Tree-SHA512: 7acf8332731191de47afc02e24c151bc53c1f38685217eccbea1b64c216674f31729ba703e132765cba67183dff95757aa949d653c5cbe538240371c2db52c14
  • Loading branch information
apoelstra committed Dec 16, 2024
2 parents 61744ef + f01f071 commit d2c9fab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ running `just check-api`.
- `primitives`
- `units`

Check the [API text files](api/README.md) for more information
on how to install the dependencies and create the text files.

### Repository maintainers

Pull request merge requirements:
Expand Down
2 changes: 1 addition & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ enabled. To create these files run `../contrib/check-for-api-changes.sh`:
Requires `cargo-public-api`, install with:

```
cargo +stable install cargo-public-api --locked
cargo +nightly install cargo-public-api --locked
```

ref: https://github.com/enselic/cargo-public-api
8 changes: 8 additions & 0 deletions contrib/check-for-api-changes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export LC_ALL=C

main() {
need_nightly
need_cargo_public_api

generate_api_files "hashes"
generate_api_files "io"
Expand Down Expand Up @@ -81,6 +82,13 @@ need_nightly() {
fi
}

need_cargo_public_api() {
if command -v cargo-public-api > /dev/null; then
return
fi
err "cargo-public-api is not installed; please run 'cargo +nightly install cargo-public-api --locked'"
}

err() {
echo "$1" >&2
exit 1
Expand Down

0 comments on commit d2c9fab

Please sign in to comment.