Date: Sat, 23 Mar 2024 09:42:11 GMT From: Mikael Urankar <mikael@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 54ef48424c0d - main - finance/hyperswitch: Fix build with rust 1.77.0 Message-ID: <202403230942.42N9gB9K052706@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=54ef48424c0dce1f78e441d377719c74a05fb626 commit 54ef48424c0dce1f78e441d377719c74a05fb626 Author: Mikael Urankar <mikael@FreeBSD.org> AuthorDate: 2024-03-20 15:37:33 +0000 Commit: Mikael Urankar <mikael@FreeBSD.org> CommitDate: 2024-03-23 09:41:46 +0000 finance/hyperswitch: Fix build with rust 1.77.0 Import upstream commit [1] to fix the recent change in cargo metadata [1] https://github.com/juspay/hyperswitch/commit/8f7d9fbc3a002127e220d8a968a6a4e15796e2fd PR: 277811 277786 Approved by: portmgr (build fix blanket) --- finance/hyperswitch/Makefile | 1 + finance/hyperswitch/distinfo | 4 +- finance/hyperswitch/files/patch-rust-1.77.0 | 110 ++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+), 1 deletion(-) diff --git a/finance/hyperswitch/Makefile b/finance/hyperswitch/Makefile index 33345ea4ce02..1ceb7952eac6 100644 --- a/finance/hyperswitch/Makefile +++ b/finance/hyperswitch/Makefile @@ -125,6 +125,7 @@ CARGO_CRATES= actix-codec-0.5.1 \ cargo-platform-0.1.3 \ cargo_metadata-0.14.2 \ cargo_metadata-0.15.4 \ + cargo_metadata-0.18.1 \ cast-0.3.0 \ cc-1.0.83 \ cfb-0.7.3 \ diff --git a/finance/hyperswitch/distinfo b/finance/hyperswitch/distinfo index 223453d989fd..77bfa87a56f5 100644 --- a/finance/hyperswitch/distinfo +++ b/finance/hyperswitch/distinfo @@ -1,4 +1,4 @@ -TIMESTAMP = 1708587915 +TIMESTAMP = 1710940726 SHA256 (rust/crates/actix-codec-0.5.1.crate) = 617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8 SIZE (rust/crates/actix-codec-0.5.1.crate) = 14337 SHA256 (rust/crates/actix-cors-0.6.4.crate) = b340e9cfa5b08690aae90fb61beb44e9b06f44fe3d0f93781aaa58cfba86245e @@ -213,6 +213,8 @@ SHA256 (rust/crates/cargo_metadata-0.14.2.crate) = 4acbb09d9ee8e23699b9634375c72 SIZE (rust/crates/cargo_metadata-0.14.2.crate) = 17469 SHA256 (rust/crates/cargo_metadata-0.15.4.crate) = eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a SIZE (rust/crates/cargo_metadata-0.15.4.crate) = 19993 +SHA256 (rust/crates/cargo_metadata-0.18.1.crate) = 2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037 +SIZE (rust/crates/cargo_metadata-0.18.1.crate) = 24535 SHA256 (rust/crates/cast-0.3.0.crate) = 37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5 SIZE (rust/crates/cast-0.3.0.crate) = 11452 SHA256 (rust/crates/cc-1.0.83.crate) = f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0 diff --git a/finance/hyperswitch/files/patch-rust-1.77.0 b/finance/hyperswitch/files/patch-rust-1.77.0 new file mode 100644 index 000000000000..2a6d40f0f915 --- /dev/null +++ b/finance/hyperswitch/files/patch-rust-1.77.0 @@ -0,0 +1,110 @@ +https://github.com/juspay/hyperswitch/issues/4137 +https://github.com/juspay/hyperswitch/pull/4139 +https://github.com/juspay/hyperswitch/commit/8f7d9fbc3a002127e220d8a968a6a4e15796e2fd + +--- Cargo.lock.orig 2024-01-05 07:20:19 UTC ++++ Cargo.lock +@@ -1455,9 +1455,9 @@ dependencies = [ + + [[package]] + name = "cargo_metadata" +-version = "0.15.4" ++version = "0.18.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" ++checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" + dependencies = [ + "camino", + "cargo-platform", +@@ -5169,7 +5169,7 @@ dependencies = [ + name = "router_env" + version = "0.1.0" + dependencies = [ +- "cargo_metadata 0.15.4", ++ "cargo_metadata 0.18.1", + "config", + "error-stack", + "gethostname", +--- crates/router_env/Cargo.toml.orig 2024-01-05 07:20:19 UTC ++++ crates/router_env/Cargo.toml +@@ -8,7 +8,7 @@ readme = "README.md" + license.workspace = true + + [dependencies] +-cargo_metadata = "0.15.4" ++cargo_metadata = "0.18.1" + config = { version = "0.13.3", features = ["toml"] } + error-stack = "0.3.1" + gethostname = "0.4.3" +@@ -34,7 +34,7 @@ vergen = { version = "8.2.1", optional = true, feature + tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread"] } + + [build-dependencies] +-cargo_metadata = "0.15.4" ++cargo_metadata = "0.18.1" + vergen = { version = "8.2.1", features = ["cargo", "git", "git2", "rustc"], optional = true } + + [features] +--- crates/router_env/src/cargo_workspace.rs.orig 2024-01-05 07:20:19 UTC ++++ crates/router_env/src/cargo_workspace.rs +@@ -14,17 +14,11 @@ pub fn set_cargo_workspace_members_env() { + let metadata = cargo_metadata::MetadataCommand::new() + .exec() + .expect("Failed to obtain cargo metadata"); +- let workspace_members = metadata.workspace_members; + +- let workspace_members = workspace_members ++ let workspace_members = metadata ++ .workspace_packages() + .iter() +- .map(|package_id| { +- package_id +- .repr +- .split_once(' ') +- .expect("Unknown cargo metadata package ID format") +- .0 +- }) ++ .map(|package| package.name.as_str()) + .collect::<Vec<_>>() + .join(","); + +@@ -35,7 +29,7 @@ pub fn set_cargo_workspace_members_env() { + .expect("Failed to set `CARGO_WORKSPACE_MEMBERS` environment variable"); + } + +-/// Verify that the cargo metadata workspace members format matches that expected by ++/// Verify that the cargo metadata workspace packages format matches that expected by + /// [`set_cargo_workspace_members_env`] to set the `CARGO_WORKSPACE_MEMBERS` environment variable. + /// + /// This function should be typically called within build scripts, before the +@@ -43,24 +37,20 @@ pub fn set_cargo_workspace_members_env() { + /// + /// # Panics + /// +-/// Panics if running the `cargo metadata` command fails, or if the workspace members package ID +-/// format cannot be determined. ++/// Panics if running the `cargo metadata` command fails, or if the workspace member package names ++/// cannot be determined. + pub fn verify_cargo_metadata_format() { + #[allow(clippy::expect_used)] + let metadata = cargo_metadata::MetadataCommand::new() + .exec() + .expect("Failed to obtain cargo metadata"); +- let workspace_members = metadata.workspace_members; + +- let package_id_entry_prefix = +- format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); + assert!( +- workspace_members ++ metadata ++ .workspace_packages() + .iter() +- .any(|package_id| package_id.repr.starts_with(&package_id_entry_prefix)), +- "Unknown workspace members package ID format. \ +- Please run `cargo metadata --format-version=1 | jq '.workspace_members'` and update this \ +- build script to match the updated package ID format." ++ .any(|package| package.name == env!("CARGO_PKG_NAME")), ++ "Unable to determine workspace member package names from `cargo metadata`" + ); + } +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403230942.42N9gB9K052706>