mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[rubygems/rubygems] better error message if cargo metadata doesn't contain the package we expect
cb7e6d1577
This commit is contained in:
parent
b4defea362
commit
c5a34f5b56
1 changed files with 11 additions and 0 deletions
|
@ -225,6 +225,17 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
|
|||
# avoid the json dependency
|
||||
metadata = Gem::SafeYAML.safe_load(output)
|
||||
package = metadata["packages"].find {|pkg| pkg["manifest_path"] == manifest_path }
|
||||
unless package
|
||||
found = metadata["packages"].map {|md| "#{md["name"]} at #{md["manifest_path"]}" }
|
||||
raise Gem::InstallError, <<-EOF
|
||||
failed to determine cargo package name
|
||||
|
||||
looking for: #{manifest_path}
|
||||
|
||||
found:
|
||||
#{found.join("\n")}
|
||||
EOF
|
||||
end
|
||||
package["name"].tr("-", "_")
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue