Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump MSRV to 1.56.1 #693

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ jobs:
run: ./contrib/test.sh

MSRV:
name: Test - 1.48.0 toolchain
name: Test - 1.56.1 toolchain
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@1.48.0
uses: dtolnay/rust-toolchain@1.56.1
- name: Running test script
env:
DO_FEATURE_MATRIX: true
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

* Bump MSRV to Rust `v1.56.1`

# 0.28.2 - 2024-01-30

* Implement `Hash` for `Scalar` [#674](https://github.com/rust-bitcoin/rust-secp256k1/pull/674)
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ documentation = "https://docs.rs/secp256k1/"
description = "Rust wrapper library for Pieter Wuille's `libsecp256k1`. Implements ECDSA and BIP 340 signatures for the SECG elliptic curve group secp256k1 and related utilities."
keywords = [ "crypto", "ECDSA", "secp256k1", "libsecp256k1", "bitcoin" ]
readme = "README.md"
edition = "2018"
edition = "2021"
rust-version = "1.56.1"

[package.metadata.docs.rs]
all-features = true
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a href="https://github.com/rust-bitcoin/rust-secp256k1/blob/master/LICENSE"><img alt="CC0 1.0 Universal Licensed" src="https://img.shields.io/badge/license-CC0--1.0-blue.svg"/></a>
<a href="https://github.com/rust-bitcoin/rust-secp256k1/actions?query=workflow%3AContinuous%20integration"><img alt="CI Status" src="https://github.com/rust-bitcoin/rust-secp256k1/workflows/Continuous%20integration/badge.svg"></a>
<a href="https://docs.rs/secp256k1"><img alt="API Docs" src="https://img.shields.io/badge/docs.rs-secp256k1-green"/></a>
<a href="https://blog.rust-lang.org/2020/02/27/Rust-1.48.0.html"><img alt="Rustc Version 1.48.0+" src="https://img.shields.io/badge/rustc-1.48.0%2B-lightgrey.svg"/></a>
<a href="https://blog.rust-lang.org/2020/02/27/Rust-1.56.1.html"><img alt="Rustc Version 1.56.1+" src="https://img.shields.io/badge/rustc-1.56.1.0%2B-lightgrey.svg"/></a>
</p>
</div>

Expand All @@ -29,7 +29,7 @@ Contributions to this library are welcome. A few guidelines:
* Any breaking changes must have an accompanied entry in CHANGELOG.md
* No new dependencies, please.
* No crypto should be implemented in Rust, with the possible exception of hash functions. Cryptographic contributions should be directed upstream to libsecp256k1.
* This library should always compile with any combination of features on **Rust 1.48.0**.
* This library should always compile with any combination of features on **Rust 1.56.1**.

### Githooks

Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.48.0"
msrv = "1.56.1"
4 changes: 4 additions & 0 deletions secp256k1-sys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Unreleased

* Bump MSRV to Rust `v1.56.1`

# 0.9.2 - 2023-12-18

* Fix incorrect FFI binding for `secp256k1_pubkey_combine`
Expand Down
3 changes: 2 additions & 1 deletion secp256k1-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ keywords = [ "secp256k1", "libsecp256k1", "ffi" ]
readme = "README.md"
build = "build.rs"
links = "rustsecp256k1_v0_9_2"
edition = "2018"
edition = "2021"
rust-version = "1.56.1"

[package.metadata.docs.rs]
all-features = true
Expand Down
4 changes: 2 additions & 2 deletions secp256k1-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<a href="https://crates.io/crates/secp256k1-sys"><img alt="Crate Info" src="https://img.shields.io/crates/v/secp256k1-sys.svg"/></a>
<a href="https://github.com/rust-bitcoin/rust-secp256k1/blob/master/LICENSE"><img alt="CC0 1.0 Universal Licensed" src="https://img.shields.io/badge/license-CC0--1.0-blue.svg"/></a>
<a href="https://docs.rs/secp256k1"><img alt="API Docs" src="https://img.shields.io/badge/docs.rs-secp256k1-green"/></a>
<a href="https://blog.rust-lang.org/2020/02/27/Rust-1.48.0.html"><img alt="Rustc Version 1.48.0+" src="https://img.shields.io/badge/rustc-1.48.0%2B-lightgrey.svg"/></a>
<a href="https://blog.rust-lang.org/2020/02/27/Rust-1.56.1.html"><img alt="Rustc Version 1.56.1+" src="https://img.shields.io/badge/rustc-1.56.1%2B-lightgrey.svg"/></a>
</p>
</div>

Expand Down Expand Up @@ -49,4 +49,4 @@ to your `RUSTFLAGS` variable.

## Minimum Supported Rust Version

This library should always compile with any combination of features on **Rust 1.48.0**.
This library should always compile with any combination of features on **Rust 1.56.1**.
2 changes: 1 addition & 1 deletion secp256k1-sys/vendor-libsecp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
SECP_VENDOR_GIT_ROOT="$(realpath "$SECP_VENDOR_GIT_ROOT")"
fi
SECP_SYS="$SECP_VENDOR_GIT_ROOT"/secp256k1-sys
DEFAULT_VERSION_CODE=$(grep version "$SECP_SYS/Cargo.toml" | sed 's/\./_/g' | sed 's/.*"\(.*\)".*/\1/')
DEFAULT_VERSION_CODE=$(grep "^version" "$SECP_SYS/Cargo.toml" | sed 's/\./_/g' | sed 's/.*"\(.*\)".*/\1/')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also wrong - toml allows leading whitespaces.

Just kidding. I mean it is strictly wrong but nobody cares.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if there were a tool like jq but for TOML.

We could try using Nix, which has a fromTOML builtin function, but I'd guess that most people do not want to maintain complicated logic in the Nix language, which combines laziness and dynamic typing in a truly impossible-to-read-or-debug way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized, would it make sense to rewrite our scripts in Nushell? It can convert Toml and a bunch of other formats to its own structured data representation. So this line would be just let version = (open Cargo.toml | get package.version). Also it handles structured data and error much better than bash but it's not as annoying when launching external programs as Python is. Though one big downside is we'd need to keep tests which we want contributors to run in bash to not annoy them too much.

I tried it out a long time ago (and even contributed a bit) so don't remember it that much but I'd love to learn it properly. I also have a nushell script wrapping lncli and converting string-encoded integers to normal integers (yes, they do that 🤦 ) if anyone is interested and I wanted to have a bitcoin-cli wrapper too. (IDK if it encodes ints as strings but at least outputting structured data would be nice.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds very interesting. I think I'd probably go Nix first, despite its shortcomings as a language, since it's a litte more mainstream (at least, within this project it is much more well-known). In Nix it's easy to hand off to bash and share code with bash.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Nushell is more appealing to learn than Nix based on your complaints? :) I find Nushell very readable. It does have dynamic typing but it's at least strong typing and some commands know their types upfront IIRC so they can report error messages nicely.

DEFAULT_DEPEND_DIR="$SECP_SYS/depend"
DEFAULT_SECP_REPO=https://github.com/bitcoin-core/secp256k1.git

Expand Down
Loading