diff mbox series

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

Message ID 87a64amanr.fsf@dlr.de
State New
Headers show
Series [bug#59177] python-protobuf: Use C++ implementation | expand

Commit Message

Ontje.Luensdorf@dlr.de Nov. 29, 2022, 8:23 a.m. UTC
Hi Ludovic,


Ludovic Courtès <ludo@gnu.org> writes:

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

...

> 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?

you are right, it doesn't need to be propagated, the python shared
object paths look good if inputs is used instead of propagated-inputs
(thanks, good to know :)

$ ldd /gnu/store/r6lxp1x9lj0a4980730pyd44mcvqv8pr-python-protobuf-3.20.1/lib/python3.9/site-packages/google/protobuf/pyext/_message.cpython-39-x86_64-linux-gnu.so 
        linux-vdso.so.1 (0x00007ffe50ba5000)
        libprotobuf.so.32 => /gnu/store/75d8pq1yxixr10dxfw59lv8k294nrck5-protobuf-3.21.9/lib/libprotobuf.so.32 (0x00007ffa6b600000)
...

I've also added a comment in the updated patch below.

Thanks & best regards,
Ontje

Comments

Ludovic Courtès Dec. 2, 2022, 1:13 p.m. UTC | #1
Hi,

<Ontje.Luensdorf@dlr.de> skribis:

> From a1f443dcf7ad1e222a9796441f6d96425dbfe787 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Ontje=20L=C3=BCnsdorf?= <ontje.luensdorf@dlr.de>
> 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.
>   [inputs]: Add protobuf.
>   [arguments]: Add --cpp_implementation configure flags.

Perfect.  Applied, thanks!

Ludo’.
diff mbox series

Patch

From a1f443dcf7ad1e222a9796441f6d96425dbfe787 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ontje=20L=C3=BCnsdorf?= <ontje.luensdorf@dlr.de>
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.
  [inputs]: Add protobuf.
  [arguments]: Add --cpp_implementation configure flags.
---
 gnu/packages/protobuf.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/protobuf.scm b/gnu/packages/protobuf.scm
index f7184bd49a..ab701b254d 100644
--- a/gnu/packages/protobuf.scm
+++ b/gnu/packages/protobuf.scm
@@ -406,6 +406,12 @@  (define-public python-protobuf
         (base32
          "1ja2vpk9nklllmsirmil2s4l7ni9yfqvbvj47zz5xx17s1k1bhxd"))))
     (build-system python-build-system)
+    (inputs (list protobuf))
+    (arguments
+     `(;; Favor C++ implementation from protobuf over the native Python
+       ;; implementation. The additional dependency yields significant
+       ;; performance improvements for some workloads.
+       #:configure-flags '("--cpp_implementation")))
     (home-page "https://github.com/google/protobuf")
     (synopsis "Protocol buffers is a data interchange format")
     (description
-- 
2.38.1