From 2177e6449b72d5ea17274d9e6e7f4e09b084adba Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Mon, 9 Oct 2023 23:37:26 +0200 Subject: [PATCH] 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. --- rust2rpm/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index 54f10e1..61697a7 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -163,6 +163,10 @@ def main(): log.error(f"This is not supported by rust2rpm; remove the '+{build_meta}' suffix.") 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) spec_contents = spec_render_crate(