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

build(router_env): obtain workspace member package names from cargo_metadata more deterministically #4215

Conversation

deepanshu-iiitu
Copy link
Contributor

@deepanshu-iiitu deepanshu-iiitu commented Mar 26, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

ORIGINAL PR: #4139
This PR updates the build script code to obtain cargo workspace member package names to use a better and more deterministic way to do so.

Previously, we used to perform string manipulation on the package ID format (obtained from the workspace_members field in cargo metadata --format-version=1), and the package ID format was not stabilized (until recently). The package ID format has been stabilized in Rust 1.77, and the stabilized format breaks our existing build scripts. This PR updates the build script code to instead obtain the workspace member package names using the Metadata::workspace_packages() method that the cargo_metadata crate provides.

Motivation and Context

This would fix builds from breaking once Rust 1.77 is released as the stable version on March 21st, 2024.

Fixes #4137.

How did you test it?

cargo run was successful with both Rust 1.76 and 1.77 (although with warnings).

I installed the Rust 1.77 toolchain by following the instructions from the Rust 1.77.0 pre-release testing blog post.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

…metadata` more deterministically (#4139)

Co-authored-by: Sampras Lopes <lsampras@pm.me>
@deepanshu-iiitu deepanshu-iiitu added A-dependencies Area: Dependencies C-bug Category: Bug labels Mar 26, 2024
@deepanshu-iiitu deepanshu-iiitu self-assigned this Mar 26, 2024
@deepanshu-iiitu deepanshu-iiitu requested a review from a team as a code owner March 26, 2024 17:11
@deepanshu-iiitu deepanshu-iiitu linked an issue Mar 26, 2024 that may be closed by this pull request
2 tasks
@SanchithHegde
Copy link
Member

Force merging this since cargo clippy has passed. Though not the best indicator that code will compile with Rust 1.77, it's sufficient enough to know that code compiles.

@SanchithHegde SanchithHegde merged commit e07f9a4 into hotfix-2024.03.01.0 Mar 26, 2024
11 of 17 checks passed
@SanchithHegde SanchithHegde deleted the cargo-metadata-workspace-packages-parsing-crypto-hotfix branch March 26, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependencies Area: Dependencies C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [CRYPTOPAY] Payments failing due to missing metadata
2 participants