diff options
author | Mat Sadler <mat@sourcetagsandcodes.com> | 2023-01-27 19:59:32 -0800 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-01-30 17:39:48 +0000 |
commit | cb060062137ed73313cf6c175e968aabd7bfa243 (patch) | |
tree | 4c70317789b4c9fbcddac40057997783368e37e0 /lib/rubygems | |
parent | c5a34f5b566a5d89dd5fa311e75f8cf30d5dbe66 (diff) |
[rubygems/rubygems] normalise manifest path from cargo on windows
https://github.com/rubygems/rubygems/commit/23b5ca5fc4
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/ext/cargo_builder.rb | 8 |
1 files changed, 7 insertions, 1 deletions
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) } |