From cb060062137ed73313cf6c175e968aabd7bfa243 Mon Sep 17 00:00:00 2001 From: Mat Sadler Date: Fri, 27 Jan 2023 19:59:32 -0800 Subject: [rubygems/rubygems] normalise manifest path from cargo on windows https://github.com/rubygems/rubygems/commit/23b5ca5fc4 --- lib/rubygems/ext/cargo_builder.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/rubygems/ext') diff --git a/lib/rubygems/ext/cargo_builder.rb b/lib/rubygems/ext/cargo_builder.rb index e2ba9e8122..022aabf481 100644 --- a/lib/rubygems/ext/cargo_builder.rb +++ b/lib/rubygems/ext/cargo_builder.rb @@ -224,7 +224,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder # --format-version 1 option the output is compatible with YAML, so we can # avoid the json dependency metadata = Gem::SafeYAML.safe_load(output) - package = metadata["packages"].find {|pkg| pkg["manifest_path"] == manifest_path } + package = metadata["packages"].find {|pkg| normalize_path(pkg["manifest_path"]) == manifest_path } unless package found = metadata["packages"].map {|md| "#{md["name"]} at #{md["manifest_path"]}" } raise Gem::InstallError, <<-EOF @@ -239,6 +239,12 @@ EOF package["name"].tr("-", "_") end + def normalize_path(path) + return path unless File::ALT_SEPARATOR + + path.tr(File::ALT_SEPARATOR, File::SEPARATOR) + end + def rustc_dynamic_linker_flags(dest_dir, crate_name) split_flags("DLDFLAGS") .map {|arg| maybe_resolve_ldflag_variable(arg, dest_dir, crate_name) } -- cgit v1.2.3