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

Rust 1.80+ fixes & accumulated warning cleanup #3796

Merged
merged 6 commits into from
Sep 12, 2024

Conversation

yeastplume
Copy link
Member

Fix for current build issues on rust 1.8+, as well as fixes for all warnings and future deprecation warnings. Touches core code (though not in any complex way) so needs another level of review.

  • Update cursive (and related time deps) to 0.21
  • (Core) Remove unread edge_bits field in CuckooParams struct
  • (grin) Remove unused string arg from RPCError
  • Rust 1.80 now giving #[cfg] warnings if config values don't exist: https://blog.rust-lang.org/2024/05/06/check-cfg.html
  • NaiveDateTime::from_timestamp_opt replaced with DateTime::from_timestamp ... .naive_utc()
  • NaiveDateTime::timestamp() replaced with .and_utc().timestamp()
  • timestamp_nanos() -> timestamp_nanos_opt()
  • clean_output_dir() in chain/tests/common made conditional on test env
  • update built crate (build-only dependency) to 0.7
  • modify grin build.rs according to built crate updates
  • update log4rs crate to 1.3, modify util::logger accordingly
  • add anyhow crate to util to satisfy log4rs update dependency
  • allow dead code in chain_test_helper test (incorrect unused code warning reported otherwise)
  • rename .cargo/config -> .cargo/config.toml

@@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#![allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

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

What is that needed for?

Copy link
Member Author

Choose a reason for hiding this comment

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

there's some cargo oddness that's causing a 'not used' warning for the clean_output_dir function below during compilation, even though it's configured as test only. I spent some time trying to track it down and couldn't find a reason for it. I could possibly spend more time on it

Copy link
Contributor

@tromp tromp Sep 11, 2024

Choose a reason for hiding this comment

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

Maybe ask around on IRC #rust or other rust forums if other people have run into that issue. I see that googling for
rust 'not used' warning for test code
also brings up discussions on stack overflow, reddit, and the Rust programming language forum...

Copy link
Contributor

@tromp tromp left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Just would prefer not to see ignore dead code directive...

@yeastplume
Copy link
Member Author

Looks fine to me. Just would prefer not to see ignore dead code directive...

Just moved the directive to be function-scope rather than module scope, which it should have been in the first place.

@yeastplume yeastplume merged commit 9a23cfe into mimblewimble:master Sep 12, 2024
12 checks passed
yeastplume added a commit that referenced this pull request Sep 16, 2024
* Update grin_secp to 0.7.14 (#3788)

* Update versioning on master to 5.4.0-alpha.0

* Update versioning on master to 5.4.0-alpha.0 (#3789)

* Remove Merkle Proof Generation from Foreign API `get_outputs` (#3792)

* Update versioning on master to 5.4.0-alpha.0

* Remove merkle proof generation from foreign API

* Rust 1.80+ fixes & accumulated warning cleanup (#3796)

* Update versioning on master to 5.4.0-alpha.0

* updates for 1.80 and other accumulated warnings

* further warning cleanups

* move dead code tag to function defn rather than module

* Chain type field (#3790)

* Adding chain type field into get_status rpc

* formatting

* update version for next build

---------

Co-authored-by: aglkm <39521015+aglkm@users.noreply.github.com>
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.

2 participants