[rubygems/rubygems] normalise manifest path from cargo on windows

https://github.com/rubygems/rubygems/commit/23b5ca5fc4
This commit is contained in:
Mat Sadler 2023-01-27 19:59:32 -08:00 коммит произвёл git
Родитель c5a34f5b56
Коммит cb06006213
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -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) }