Subject: [bug#59177] [PATCH] python-protobuf: Use C++ implementation

From: Ludovic Courtès <[email-masked]>
Date: Mon, 28 Nov 2022 22:58:37 +0100

Hi,

<[email-masked]> skribis:

> this patch configures python-protobuf to use the C++ protobuf
> implementation. This additional dependency pays off with a 10x
> performance improvement in some of my workloads.

Impressive.  It would be nice to have that info as a comment in the code
for future reference.

> From f2675cccf54d2bb1291ba1614ca44966730734e1 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Ontje=20L=C3=BCnsdorf?= <[email-masked]>
> Date: Thu, 10 Nov 2022 09:11:11 +0100
> Subject: [PATCH] gnu: python-protobuf: Use C++ implementation.
>
> * gnu/packages/protobuf.scm (python-protobuf): Use C++ implementation.
>   [propagated-inputs]: Add protobuf.
>   [arguments]: Add --cpp_implementation configure flags.
> ---
>  gnu/packages/protobuf.scm | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gnu/packages/protobuf.scm b/gnu/packages/protobuf.scm
> index 1448691a42..9be35783fb 100644
> --- a/gnu/packages/protobuf.scm
> +++ b/gnu/packages/protobuf.scm
> @@ -393,6 +393,9 @@ (define-public python-protobuf
>          (base32
>           "1ja2vpk9nklllmsirmil2s4l7ni9yfqvbvj47zz5xx17s1k1bhxd"))))
>      (build-system python-build-system)
> +    (propagated-inputs (list protobuf))

Does it really need to be propagated?  Would be nice if this could be
avoided, for instance by adding a phase that hardcodes the absolute file
name of the protobuf shared library, if that’s the reason why it’s being
propagated.   And if we really have to propagate it, then it’d be nice
to clarify what.  WDYT?

Thanks,
Ludo’.