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

Remove no-std and actual-serde features #769

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

JoseSK999
Copy link
Contributor

Closes #681

The no-std feature is no longer needed with bitcoin version 0.32.0

  • Update README.md (in Building I have copy-pasted part of the same section from rust-bitcoin)
  • Disable actual-serde implicit feature

I think FEATURES_WITH_NO_STD now could be removed from the maintainer tools. Let me know if there's something missing or to improve!

apoelstra
apoelstra previously approved these changes Nov 10, 2024
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 8722d58; successfully ran local tests; nice!

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

Thanks man! Apart from the comments on the docs stuff this is awesome, appreciate the improvement.

Cargo.toml Outdated
bitcoin = { version = "0.32.0", default-features = false }

# Do NOT use this as a feature! Use the `serde` feature instead.
actual-serde = { package = "serde", version = "1.0.103", optional = true }
Copy link
Member

Choose a reason for hiding this comment

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

By looking at rust-bitcoin it looks like this can be renamed to just plain old serde (the actual-serde was only used because we didn't have "dep:serde" available).

Will also need

 #[cfg(feature = "serde")]
-pub use actual_serde as serde;
+pub use serde;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, good point!

README.md Outdated
Comment on lines 39 to 54
The library can be built and tested using [`cargo`](https://github.com/rust-lang/cargo/):

```
git clone [email protected]:rust-bitcoin/rust-miniscript.git
cd rust-miniscript
cargo build
```

You can run tests with:

```
cargo test
```

Please refer to the [`cargo` documentation](https://doc.rust-lang.org/stable/cargo/) for more
detailed instructions.
Copy link
Member

Choose a reason for hiding this comment

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

These changes are unrelated to this PR, right? (FTR I never liked these docs in rust-bitcoin, if one doesn't know how to run Rust unit tests they probably shouldn't be writing financial software - and rust-miniscript is even more hardcore than rust-bitcoin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. The Building section had more relevant info about how to select the no-std/std features, but now it is just one line (I added that to make it more complete).

Technically the no_std support is already explained in High-Level Features and doesn't require more in-depth explanation, so based on your comment I think it makes sense to remove Building.

Copy link
Member

Choose a reason for hiding this comment

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

They're not totally unrelated because they replace docs that talked about nostd.

Though agreed that we probably don't need to tell people to run cargo test if there's not even any env variables or anything :). If this were end-user software then sure, but this is a Rust library that you can't use without being familiar with the language and its ecosystem.

Comment on lines -47 to 41
you may need to pin some dependencies. See `./contrib/test.sh` for current pinning.
you may need to pin some dependencies. See `./contrib/pin.sh` for current pinning.

Copy link
Member

Choose a reason for hiding this comment

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

This change is good, its an unrelated change for this PR though. (Sorry for being picky, we just uncovered a bug in rust-bitcoin that slipped through review so I'm trying to review more anally diligently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, no worries about being thorough. It is unrelated, but I figured it was okay since it’s just an outdated path in the README.

# Test all these features with "no-std" enabled.
# rust-miniscript only: https://github.com/rust-bitcoin/rust-miniscript/issues/681
FEATURES_WITH_NO_STD="compiler trace serde rand base64"

# Test all these features without "std" enabled.
Copy link
Member

Choose a reason for hiding this comment

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

Mad! If this merges we can patch rust-bitcoin-maintainer-tools to remove the logic that supports this.

@JoseSK999
Copy link
Contributor Author

Updated with @tcharding comments

@apoelstra
Copy link
Member

CI failure is unrelated (will be fixed by #766).

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 8372e8c; successfully ran local tests; even nicer!

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK 8372e8c

@tcharding
Copy link
Member

Thanks bro.

@sanket1729
Copy link
Member

ACK. Can you rebase to get the CI fix in? Or maybe can @apoelstra directly merge after running tests on merge commit?

The `no-std` feature is no longer needed with `bitcoin` version 0.32.0

- Update README.md, including updating to the `./contrib/pin.sh` path
- Disable `actual-serde` implicit feature
@JoseSK999
Copy link
Contributor Author

Rebased!

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK ccc2815; successfully ran local tests; even nicer!

@apoelstra apoelstra merged commit e35eb70 into rust-bitcoin:master Nov 12, 2024
30 checks passed
@JoseSK999 JoseSK999 deleted the remove-no-std-feature branch November 12, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

We should remove "no-std" feature
4 participants