Print an error and bail when using a vendor tarball for a library crate

Building a library-only crate against vendored dependencies is nonsense,
since the resulting package will not be able to ship anything.
This commit is contained in:
Fabio Valentini 2023-10-09 23:37:26 +02:00
parent 519f079729
commit 2177e6449b
No known key found for this signature in database
GPG key ID: 5AC5F572E5D410AF

View file

@ -163,6 +163,10 @@ def main():
log.error(f"This is not supported by rust2rpm; remove the '+{build_meta}' suffix.") log.error(f"This is not supported by rust2rpm; remove the '+{build_meta}' suffix.")
sys.exit(1) sys.exit(1)
if vendor_tarball and not (package.is_bin() or package.is_cdylib()):
log.error(f"Building library-only crates with vendored dependencies is not supported.")
sys.exit(1)
warn_if_package_uses_restrictive_dependencies(package) warn_if_package_uses_restrictive_dependencies(package)
spec_contents = spec_render_crate( spec_contents = spec_render_crate(