Commit Graph

105 Commits

Author SHA1 Message Date
Jamil Lambert, PhD fe685b824f
Fix the release script that checks for TBD
`release.sh` is missing `units`.

Add `units` to the list of crates to check.
Reorder the crates alphabetically.
2025-03-03 17:25:34 +00:00
merge-script 38e9bf841e
Merge rust-bitcoin/rust-bitcoin#4084: documentation: update instructions for building lock files
948647a9dd update documentation for changing lockfiles; change script to support mac nanaive cp function (jeremiah)

Pull request description:

  1. Updates `CONTRIBUTING.md` with latest instructions on using `just` to create new lock files. See discussion [here](https://github.com/rust-bitcoin/rust-bitcoin/pull/4045/files).
  2. For the command `cp`,  `--force` is not an option on the Mac. Changed to `-f` which as far as I can tell is equivalent.

  ```
  ➜  rust-bitcoin git:(jr_update_contrib) ✗ cp --force
  cp: illegal option -- -
  ```

ACKs for top commit:
  tcharding:
    ACK 948647a9dd
  Kixunil:
    ACK 948647a9dd
  apoelstra:
    ACK 948647a9dd95bedbb8c34f0b9548e859bfc723b1; successfully ran local tests

Tree-SHA512: a9486ec323b15a9cfa78cd70332e153881537ec8fd26e6e23f8b61ed2272251271299723e9aa390542044588357ec072eb1559cd5e32cb707757f58361a6fb05
2025-02-23 14:39:44 +00:00
jeremiah 948647a9dd update documentation for changing lockfiles; change script to support mac nanaive cp function 2025-02-19 18:26:12 -05:00
Martin Habovstiak f99847d6ec Do not enable `soft-float` when running `miri`
To ensure that all target features are tested we simply enable all of
them. However some of them are problematic. We already have an exception
to not enable `crt-static`. This change also adds `soft-float` to the
list because `miri` was warning about it being UB.
2025-02-14 13:56:37 +01:00
Tobin C. Harding 7f2cf1dce8
api: Include generics in regex
The regex is still wrong, it misses structs with generics.

Currently `contrib/api.sh io types` returns:

ErrorKind
Error
Sink

But with this patch applied it returns:

FromStd<T>
ToStd<T>
ErrorKind
Cursor<T>
Error
Sink
Take<'a, R: bitcoin_io::Read + ?core::marker::Sized>
2024-12-29 09:01:27 +11:00
Shing Him Ng 23f75a098c Update regex lookahead to match when there are no characters 2024-12-19 16:28:25 -06:00
Jose Storopoli 04852958b9
contrib: check if the user has cargo-public-api 2024-12-15 11:42:51 -03:00
Tobin C. Harding 7e0501c03c
Add a script to query the API
Add a simple script that allows one to query the current API. Done by
parsing the API text files and grepping for things.

This is useful as a dev tool as we try to stabalize the leaf crates.
2024-12-06 15:42:28 +11:00
Tobin C. Harding e126a24307
Add API script
Add a script to generate API files using `cargo public-api` for the
crates that we are trying to stabalise (the so called 'leaf crates').

- hashes
- io
- primitives
- units

We already ran the script and committed the files last patch. The fact
that this patch does not include any changes to the `api/` directory and
that CI passes is enough to convince us that last patch was valid.

Add a CI job that runs the script and checks there are no changes to
the committed text files thereby proving no API changes are made in a
PR without explicitly modifying the API text files.

Add documentation to `CONTRIBUTING.md` on what is expected of devs.
2024-12-06 15:42:22 +11:00
Martin Habovstiak bd8ad1f5e2 Add basic `miri` checks
We have a bit of `unsafe` code in the crates which should really be
checked with `miri`. Thus this adds a basic CI check that automatically
determines which crates need `miri` checking and checks them. It also
makes sure to enable all target features so that SIMD code can be
checked as well.
2024-09-08 20:24:00 +02:00
Tobin C. Harding 90e073ef3e
Set CRATES mechanically
Instead of manually setting the crates list it is less error prone to do
so mechanically. This required some changes to the `run_task` script
which have now merged, so we update to use the new commit hash at the
same time.

- Use shell to set the `CRATES` env var used by `run_task.sh`.
- Use latest revision of  rust-bitcoin-maintainer-tools
2024-09-02 09:21:19 +10:00
Martin Habovstiak 83831e6363 Show output of failed semver checks
Debugging the API breaks without seeing what failed is pretty much
impossible. This simply prints the output when a check fails.
2024-08-27 20:44:10 +02:00
Andrew Poelstra 30f6bd43a4
Add primitives to the CRATES list
This should have been done when we introduced the `primitives`
crate - epic fail.

Intentionally put it before `fuzz` because of the known bug in the CI
script where nothing after `fuzz` gets tested.
2024-08-22 16:51:53 +00:00
Tobin C. Harding 009e747323
CI: Put fuzz last in CRATES list
There is a bug in `run_task` [0] that drastically reduces our test
coverage. We can bypass it by putting `fuzz` last in the list.

[0] rust-bitcoin/rust-bitcoin-maintainer-tools#10
2024-08-21 16:00:14 +10:00
Jose Storopoli 1948995443
ci: semver-check for non-additive cargo features
Co-authored-by: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com>
2024-07-25 12:19:54 -03:00
Ryan Breen 1b0653314b just: install/remove git hooks 2024-07-13 14:05:32 -04:00
Jose Storopoli 213566f34b
ci: semver-checks should run on rust stable 2024-07-10 16:02:24 +00:00
Jose Storopoli 0fa2b0b16a
ci: add all-features semver-checks
Crates missing:
- bitcoin_hashes
- bitcoin-units
- bitcoin-io
2024-07-10 08:53:36 +00:00
Jose Storopoli eeae225cfc
ci: add cargo-semver-checks 2024-07-04 10:08:06 +00:00
Jose Storopoli d9567b097f
ci: remove check-api
Removes check-api workflow, helper scripts, documentation, and files.
2024-07-04 10:08:06 +00:00
Tobin C. Harding 0630457403
Create empty bitcoin-addresses crate
We intend on splitting the address types and logic out into a separate
crate. In preparation for doing so, and so that we can grab the name on
crates.io, add an empty crate `bitcoin-addresses`.

Tie it in to the CI infrastructure.
2024-06-29 06:21:49 +10:00
Jose Storopoli a09c3c5225
Check API: remove false positives on rustdoc 2024-06-05 11:44:05 +00:00
Tobin C. Harding 60ab3d26e5
CI: Remove shebang from non-executable scripts
Some of our CI shell scripts are meant only to be sourced and not
run directly however they include an initial shebang line, implying that
they should be run.

Remove the shebang line from `crates.sh` and the various `test_vars.sh`
scripts. Add a `shellcheck` directive to inhibit the no-shebang warning.

Fix: #2764
2024-05-31 10:10:00 +10:00
Tobin C. Harding 76331aeee3
Add a just cmd to check for API changes
Add a `just` command to run the API checking script. Makes it more
discoverable.
2024-05-18 09:54:53 +10:00
Tobin C. Harding 9e7cd97c25
Add a script to check the public API
We would like to check for API changes during development and in CI so
that such changes can be discussed separately from the code.

Add tooling and documentation for creating API listings for the public
crates within the workspace (i.e., not `internals`).

Add API text files from an initial run of the script.
2024-05-18 09:54:52 +10:00
Jose Storopoli 021bea89bb
ci: shellcheck checks 2024-05-11 18:08:53 +00:00
Tobin C. Harding 6def5bc974
CI: Use run_task from maintainer tools
Use the shiny new `run_task.sh` script from maintainer tools.

This patch should not change the test coverage in any way.
2024-05-08 08:08:24 +10:00
Tobin C. Harding 0c0e88165e
CI: Add README file
In preparation for using the `run_task` file from maintainer tools pull
the docs out and throw them in a readme file in the workflow directory.
2024-05-08 06:12:13 +10:00
Tobin C. Harding 44cb2255d3
CI: Add sanitizer script
As we did for the wasm job.

In preparation for using the `run_task` script from maintainer tools we
want to have all the things that are particular to `rust-bitcoin` out of
the current `run_task` script.

The address/memory sanitizer test is specific to `hashes`. Add a script
in `hashes/contrib` and call it from the ASAN job.

No test coverage change.
2024-05-08 06:12:13 +10:00
Tobin C. Harding 3407257936
CI: Add WASM script
In preparation for using the `run_task` script from maintainer tools we
want to have all the things that are particular to `rust-bitcoin` out of
the current `run_task` script.

The wasm test is specific to `hashes`. Add a script in `hashes/contrib`
and call it from the wasm job.

No test coverage change.
2024-05-08 06:12:13 +10:00
Tobin C. Harding cc14edf63f
CI: Run the schemars job directly using cargo
The `Schemars` job calls the `run_task.sh` script only to do a single
invocation of `cargo test` - just call cargo directly.
2024-05-08 06:12:13 +10:00
Tobin C. Harding 26b9782d8b
CI: Re-write run_task.sh
Recently we re-wrote CI to increase VM level parallelism, in hindsite
this has proved to be not that great because:

- It resulted in approx 180 jobs
- We are on free tier so only get 20 jobs (VMs) at a time so its slow to run
- The UI is annoying to dig through the long job list to find failures

Have another go at organising the jobs with the main aim of shortening
total run time and making it easier to quickly see fails.

Re-write the `run_task.sh` script, notable moving manifest handling
to the workflow. Also don't bother testing with beta toolchain.

WASM Note

Removes the `cdylib` and `rlib` from the manifest patching during wasm
build - I do not know the following:

- Why this breaks on this PR but not on other PRs
- Why I can't get wasm test to run locally on master but PRs are passing
- What the `cdylib` and `rlib` were meant to be doing

This is the docs from: https://doc.rust-lang.org/reference/linkage.html

* --crate-type=cdylib, #![crate_type = "cdylib"] - A dynamic system
library will be produced. This is used when compiling a dynamic library
to be loaded from another language. This output type will create *.so
files on Linux, *.dylib files on macOS, and *.dll files on Windows.

* --crate-type=rlib, #![crate_type = "rlib"] - A "Rust library" file
will be produced. This is used as an intermediate artifact and can be
thought of as a "static Rust library". These rlib files, unlike
staticlib files, are interpreted by the compiler in future linkage. This
essentially means that rustc will look for metadata in rlib files like
it looks for metadata in dynamic libraries. This form of output is used
to produce statically linked executables as well as staticlib outputs.
2024-04-26 09:41:51 +10:00
Tobin C. Harding e1869340be
Upgrade secp dependency
Upgrade `rust-secp256k1` to the latest version `v0.29.0`. This removes
the duplicate deps as well.
2024-04-03 09:24:41 +11:00
Andrew Poelstra 684b453b7c
Merge rust-bitcoin/rust-bitcoin#2632: internals: Release tracking PR `v0.3.0`
af6dc1db02 internals: Bump version to 0.3.0 (Tobin C. Harding)

Pull request description:

  In preparation for release add a changelog and bump the version number.

  Please note, the changelog is pretty terse.

ACKs for top commit:
  apoelstra:
    ACK af6dc1db02
  sanket1729:
    ACK af6dc1db02

Tree-SHA512: b70d4b9de7de90aba3cbff90dd7f25c5ac801d020dbdfe3e64af4c079347cba726aa783a94fc777e7bf177db8402b54948c2dfd4a766d90c1a7a7a6bdfd36136
2024-04-02 00:09:04 +00:00
Tobin C. Harding 35687c84fc
CI: Fix Manage PR job
In #2635 we broke the Manage PR CI job but for some reason CI didn't run
on that PR so we merged the breakage.

Fix the script by setting default variables when they are not set. Done
with ChatGPT.
2024-03-28 09:08:08 +11:00
Tobin C. Harding 3fa3d37c21
Add set -euo pipefail
Add `euo pipefail` to all non-trial shell scripts, note if `x` is
already set we maintain it.

Note we have a pipe in `run_task.sh` that relies on grep not finding
anything i.e., failing, so we cannot use pipefail there. Disable it and
re-enable it after the pipe.
2024-03-27 11:02:27 +11:00
Tobin C. Harding af6dc1db02
internals: Bump version to 0.3.0
In preparation for release add a changelog and bump the version number.
2024-03-27 09:44:30 +11:00
Andrew Poelstra 9df59639ce
Merge rust-bitcoin/rust-bitcoin#2621: Release tracking PR: `hashes v0.14.0`
0ca5a43ce5 hashes: Bump version to v0.14.0 (Tobin C. Harding)

Pull request description:

  In preparation for release add a changlelog entry and bump the version.

  Note the hashes 0.13.0 dependency stays in the dependency graph because of secp, we can update secp after releasing `hashes` then update the secp dependency in `rust-bitcoin` thereby removing the `hashes v0.13.0` dependency - phew.

  Note we are right to release this immediately, the two open PRs (#2337 and #2541) that touch `hashes` only add a clippy attribute so can safely be ignored.

ACKs for top commit:
  apoelstra:
    ACK 0ca5a43ce5
  sanket1729:
    ACK 0ca5a43ce5

Tree-SHA512: d1d26acb8fbf13f785b25add3f1dac05bb392b5bdbad16ead2bc5dd26f3d668824c4b653c373f88c3562a37e775146766680606cedd19db40e0f197b26ca86b8
2024-03-25 22:23:30 +00:00
Tobin C. Harding 0ca5a43ce5
hashes: Bump version to v0.14.0
In preparation for release add a changlelog entry and bump the version.

I'm not 100% sure that this release is API breaking, dependencies
definitely changed. The rest might be only additives but I didn't bother
looking exactly because I think its better to bump the minor version and
err on the side of caution.

Note the hashes 0.13.0 dependency stays in the dependency graph because
of secp, we can update secp after releasing `hashes` then update the
secp dependency in `rust-bitcoin` thereby removing the `hashes v0.13.0`
dependency - phew.
2024-03-22 06:04:40 +11:00
Andrew Poelstra 50e772fe79
Revert "ci: introduce `classify-pr.sh` script which determines whether a PR should have CI run"
This reverts commit 9aca8a18c7.
2024-03-20 14:08:17 +00:00
Andrew Poelstra ec3e4e8801
Revert "ci: gate coverage analysis on whether source code changed"
This reverts commit 32f9b1a231.
2024-03-20 14:08:14 +00:00
Andrew Poelstra f495bd9681
Merge rust-bitcoin/rust-bitcoin#2525: ci: skip CI for things that modify only markdown files
32f9b1a231 ci: gate coverage analysis on whether source code changed (Andrew Poelstra)
2203c02347 ci: gate fuzztesting on whether source code changed (Andrew Poelstra)
09f7fc3cff ci: gate CI workflow on source being changed (Andrew Poelstra)
9aca8a18c7 ci: introduce `classify-pr.sh` script which determines whether a PR should have CI run (Andrew Poelstra)

Pull request description:

  Fixes #2523

ACKs for top commit:
  tcharding:
    ACK 32f9b1a231

Tree-SHA512: 7d53365bdf4e8ae5480221e43b4c515d4b16048ec1a00cb62ab65b2d2b91a37f8945c39b619a82bfe4ca74f3508176d9879481b908bb8d3fe8d214b173d3bf18
2024-03-20 14:01:32 +00:00
Tobin C. Harding 097a00b133
CI: Disable MSAN job
I believe there is currently a bug in the MemorySanitizer, when we pass
various types across the FFI boundry MSAN gives a unititialized variable
error:

- `usize` passed as `size_t` (cannot be uninitialized)
- byte slice passed as `const char *`

In order to let other work continue disable the MSAN job.
2024-03-15 09:44:38 +11:00
Andrew Poelstra 32f9b1a231
ci: gate coverage analysis on whether source code changed 2024-03-01 16:13:40 +00:00
Andrew Poelstra 9aca8a18c7
ci: introduce `classify-pr.sh` script which determines whether a PR should have CI run 2024-03-01 16:12:19 +00:00
Andrew Poelstra c97f2ccc69
ci: require a nightly compiler rather than using +nightly
If we pin the version of nightly to a specific date then `cargo
+nightly` will stop working. And even locally, if you want to use a
specific version of nightly, you can't if the script is overriding your
version with "+nightly". Instead the user should set RUSTUP_TOOLCHAIN.
2024-02-28 20:47:35 +00:00
Andrew Poelstra e386cbfadf
ci: delete *test.sh files
These are not run in CI since #2353 and are likely to go out of date. If
we want a script that users can run locally then we should create a new
script that wraps our current CI.
2024-02-28 20:45:56 +00:00
Tobin C. Harding 01a66a7fa7
CI: Check for required commands
Add a function to check for commands used by the `run_task` script. Move
the version printing to after the check. Also print the bash version in
use.
2024-02-02 11:35:56 +11:00
Martin Habovstiak 5c15ed5441
CI: Epic overhaul
Re-write the whole CI pipeline.

Co-developed-by: Martin Habovstiak <martin.habovstiak@gmail.com>
2024-02-02 05:57:23 +11:00
Tobin C. Harding 242aa676b3
Use env bash instead of /bin/bash
As we do in all the other shell scripts use `env` to call `bash`.
2024-02-02 05:57:23 +11:00