FreeBSD Bugzilla – Attachment 249344 Details for
Bug 277811
finance/hyperswitch: fails to build with rust 1.77.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
v0
0004-finance-hyperswitch-Fix-build-with-rust-1.77.0.patch (text/plain), 6.72 KB, created by
Mikael Urankar
on 2024-03-20 15:42:35 UTC
(
hide
)
Description:
v0
Filename:
MIME Type:
Creator:
Mikael Urankar
Created:
2024-03-20 15:42:35 UTC
Size:
6.72 KB
patch
obsolete
>From aab446a2eacc1c2fe6339db489035d659384b074 Mon Sep 17 00:00:00 2001 >From: Mikael Urankar <mikael@FreeBSD.org> >Date: Wed, 20 Mar 2024 16:37:33 +0100 >Subject: [PATCH] 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 >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(-) > create mode 100644 finance/hyperswitch/files/patch-rust-1.77.0 > >diff --git a/finance/hyperswitch/Makefile b/finance/hyperswitch/Makefile >index 33345ea4ce0..1ceb7952eac 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 223453d989f..77bfa87a56f 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 00000000000..2a6d40f0f91 >--- /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`" >+ ); >+ } >+ >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 277811
: 249344