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

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

SanchithHegde
Copy link
Member

Type of Change

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

Description

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

…ace member package names from `cargo_metadata`
@SanchithHegde SanchithHegde added A-dependencies Area: Dependencies C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Mar 19, 2024
@SanchithHegde SanchithHegde added this to the March 2024 milestone Mar 19, 2024
@SanchithHegde SanchithHegde self-assigned this Mar 19, 2024
@SanchithHegde SanchithHegde requested a review from a team as a code owner March 19, 2024 19:57
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Mar 20, 2024
Merged via the queue into main with commit 8f7d9fb Mar 20, 2024
10 of 12 checks passed
@Gnanasundari24 Gnanasundari24 deleted the fix-cargo-metadata-workspace-packages-parsing branch March 20, 2024 11:21
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Mar 20, 2024
deepanshu-iiitu pushed a commit that referenced this pull request Mar 26, 2024
…metadata` more deterministically (#4139)

Co-authored-by: Sampras Lopes <lsampras@pm.me>
prasunna09 pushed a commit that referenced this pull request Mar 27, 2024
…metadata` more deterministically (#4139)

Co-authored-by: Sampras Lopes <lsampras@pm.me>
deepanshu-iiitu pushed a commit that referenced this pull request May 6, 2024
…metadata` more deterministically (#4139)

Co-authored-by: Sampras Lopes <lsampras@pm.me>
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.

Fails to build with rust 1.77.0
5 participants