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 #4227

Conversation

prasunna09
Copy link
Contributor

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 <[email protected]>
@prasunna09 prasunna09 added A-framework Area: Framework S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Mar 27, 2024
@prasunna09 prasunna09 added this to the March 2024 milestone Mar 27, 2024
@prasunna09 prasunna09 self-assigned this Mar 27, 2024
@prasunna09 prasunna09 requested a review from a team as a code owner March 27, 2024 07:57
@prasunna09 prasunna09 linked an issue Mar 27, 2024 that may be closed by this pull request
2 tasks
@prasunna09 prasunna09 removed a link to an issue Mar 27, 2024
2 tasks
@prasunna09 prasunna09 added A-dependencies Area: Dependencies and removed A-framework Area: Framework labels Mar 27, 2024
@prasunna09 prasunna09 changed the title build(router_env): obtain workspace member package names from cargo_metadata more deterministically build(router_env): obtain workspace member package names from cargo_metadata more deterministically Mar 27, 2024
@SanchithHegde SanchithHegde merged commit 325b11d into hotfix-2024.03.15.0 Mar 27, 2024
16 of 21 checks passed
@SanchithHegde SanchithHegde deleted the hf-cargo-metadata-workspace-packages-parsing-crypto branch March 27, 2024 10:13
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependencies Area: Dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants