GNU bug report logs - #42650
[PATCH 1/2] gnu: python-protobuf: Update to 3.12.4.

Previous Next

Package: guix-patches;

Reported by: Vinicius Monego <monego <at> posteo.net>

Date: Sat, 1 Aug 2020 14:44:02 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42650 in the body.
You can then email your comments to 42650 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#42650; Package guix-patches. (Sat, 01 Aug 2020 14:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vinicius Monego <monego <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 01 Aug 2020 14:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Vinicius Monego <monego <at> posteo.net>
Subject: [PATCH 1/2] gnu: python-protobuf: Update to 3.12.4.
Date: Sat,  1 Aug 2020 11:43:20 -0300
* gnu/packages/protobuf.scm (python-protobuf): Update to 3.12.4.
---
 gnu/packages/protobuf.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/protobuf.scm b/gnu/packages/protobuf.scm
index 7c14ddbdfa..b8bd617eca 100644
--- a/gnu/packages/protobuf.scm
+++ b/gnu/packages/protobuf.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2017, 2018, 2019 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2020 Vinicius Monego <monego <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -206,15 +207,17 @@ encoder in C++.  The developer using protozero has to manually translate the
 (define-public python-protobuf
   (package
     (name "python-protobuf")
-    (version "3.11.3")
+    (version "3.12.4")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "protobuf" version))
        (sha256
         (base32
-         "07qby3yc2a8a1vsxnc79j687q4r68k1d3npni7bldwmd3m6rfz67"))))
+         "0mj6z58aiw532s1mq48m9xdrm3gdyp2vv9cdinfb5wmnfpm5m7n9"))))
     (build-system python-build-system)
+    (native-inputs
+     `(("python-wheel" ,python-wheel)))
     (propagated-inputs
      `(("python-six" ,python-six)))
     (home-page "https://github.com/google/protobuf")
-- 
2.20.1





Information forwarded to guix-patches <at> gnu.org:
bug#42650; Package guix-patches. (Sat, 01 Aug 2020 14:45:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Vinicius Monego <monego <at> posteo.net>
Subject: [PATCH 2/2] gnu: Add python-onnx.
Date: Sat,  1 Aug 2020 11:43:21 -0300
* gnu/packages/machine-learning.scm (python-onnx): New variable.
---
 gnu/packages/machine-learning.scm             | 43 +++++++++++++++
 .../python-onnx-use-system-googletest.patch   | 54 +++++++++++++++++++
 2 files changed, 97 insertions(+)
 create mode 100644 gnu/packages/patches/python-onnx-use-system-googletest.patch

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 18a4ac9ef2..4ec3ed05c7 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2019 Brett Gilio <brettg <at> gnu.org>
 ;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen <at> fastmail.net>
 ;;; Copyright © 2020 Edouard Klein <edk <at> beaver-labs.com>
+;;; Copyright © 2020 Vinicius Monego <monego <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -53,6 +54,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages cran)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dejagnu)
@@ -70,6 +72,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
@@ -576,6 +579,46 @@ tools.  This enables both rapid prototyping of data pipelines and extensibility
 in terms of new algorithms.")
     (license license:gpl3+)))
 
+(define-public python-onnx
+  (package
+    (name "python-onnx")
+    (version "1.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "onnx" version))
+       ;; ONNX will build googletest from a git checkout.  Patch CMake
+       ;; to use googletest from Guix and enable tests by default.
+       (patches (search-patches "python-onnx-use-system-googletest.patch"))
+       (sha256
+        (base32 "0j6rgfbhsw3a8id8pyg18y93k68lbjbj1kq6qia36h69f6pvlyjy"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("cmake" ,cmake)
+       ("googletest" ,googletest)
+       ("pybind11" ,pybind11)
+       ("python-coverage" ,python-coverage)
+       ("python-nbval" ,python-nbval)
+       ("python-pytest" ,python-pytest)
+       ("python-pytest-runner" ,python-pytest-runner)))
+    (inputs
+     `(("protobuf" ,protobuf)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-protobuf" ,python-protobuf)
+       ("python-six" ,python-six)
+       ("python-tabulate" ,python-tabulate)
+       ("python-typing-extensions"
+        ,python-typing-extensions)))
+    (home-page "https://onnx.ai/")
+    (synopsis "Open Neural Network Exchange")
+    (description
+     "Open Neural Network Exchange (ONNX) provides an open source format for
+AI models, both deep learning and traditional ML.  It defines an extensible
+computation graph model, as well as definitions of built-in operators and
+standard data types.")
+    (license license:expat)))
+
 (define-public rxcpp
   (package
     (name "rxcpp")
diff --git a/gnu/packages/patches/python-onnx-use-system-googletest.patch b/gnu/packages/patches/python-onnx-use-system-googletest.patch
new file mode 100644
index 0000000000..33d2fa12de
--- /dev/null
+++ b/gnu/packages/patches/python-onnx-use-system-googletest.patch
@@ -0,0 +1,54 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0aa9fda2..a573170c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -22,7 +22,7 @@ option(BUILD_ONNX_PYTHON "Build Python binaries" OFF)
+ option(ONNX_GEN_PB_TYPE_STUBS "Generate protobuf python type stubs" ON)
+ option(ONNX_WERROR "Build with Werror" OFF)
+ option(ONNX_COVERAGE "Build with coverage instrumentation" OFF)
+-option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" OFF)
++option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" ON)
+ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
+ option(ONNXIFI_ENABLE_EXT "Enable onnxifi extensions." OFF)
+ if(NOT DEFINED ONNX_ML)
+@@ -82,8 +82,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
+ endif()
+
+ if(ONNX_BUILD_TESTS)
+-  list(APPEND CMAKE_MODULE_PATH ${ONNX_ROOT}/cmake/external)
+-  include(googletest)
++  find_package(GTest REQUIRED)
++  if(NOT GTest_FOUND)
++    message(FATAL_ERROR "cannot find googletest")
++  endif()
+ endif()
+
+ if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
+diff --git a/cmake/unittest.cmake b/cmake/unittest.cmake
+index e29a93ff..ae146390 100644
+--- a/cmake/unittest.cmake
++++ b/cmake/unittest.cmake
+@@ -6,8 +6,8 @@ include(${ONNX_ROOT}/cmake/Utils.cmake)
+
+ find_package(Threads)
+
+-set(${UT_NAME}_libs ${googletest_STATIC_LIBRARIES})
+-set(${ONNXIFI_TEST_DRIVER}_libs ${googletest_STATIC_LIBRARIES})
++set(${UT_NAME}_libs ${GTEST_LIBRARIES})
++set(${ONNXIFI_TEST_DRIVER}_libs ${GTEST_LIBRARIES})
+
+ list(APPEND ${UT_NAME}_libs onnx)
+ list(APPEND ${UT_NAME}_libs onnx_proto)
+@@ -31,10 +31,10 @@ function(AddTest)
+   list(REMOVE_DUPLICATES _UT_SOURCES)
+
+   add_executable(${_UT_TARGET} ${_UT_SOURCES})
+-  add_dependencies(${_UT_TARGET} onnx onnx_proto googletest)
++  add_dependencies(${_UT_TARGET} onnx onnx_proto)
+
+   target_include_directories(${_UT_TARGET}
+-                             PUBLIC ${googletest_INCLUDE_DIRS}
++                             PUBLIC ${GTEST_INCLUDE_DIRS}
+                                     ${ONNX_INCLUDE_DIRS}
+                                     ${PROTOBUF_INCLUDE_DIRS}
+                                     ${ONNX_ROOT}
-- 
2.20.1





Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Mon, 03 Aug 2020 07:07:01 GMT) Full text and rfc822 format available.

Notification sent to Vinicius Monego <monego <at> posteo.net>:
bug acknowledged by developer. (Mon, 03 Aug 2020 07:07:01 GMT) Full text and rfc822 format available.

Message #13 received at 42650-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Vinicius Monego <monego <at> posteo.net>
Cc: 42650-done <at> debbugs.gnu.org
Subject: Re: [bug#42650] [PATCH 2/2] gnu: Add python-onnx.
Date: Mon, 03 Aug 2020 09:05:40 +0200
Hello,

A few comments on this one.

> * gnu/packages/machine-learning.scm (python-onnx): New variable.

You need to mention the added file in the commit message and also add it
to gnu/local.mk.

> +       ;; ONNX will build googletest from a git checkout.  Patch CMake
> +       ;; to use googletest from Guix and enable tests by default.

That seems to be a recurrent issue. Did you fix it by yourself or is
there a patch out there? 

Otherwise both patches look fine. I fixed the patch registering thing
and pushed.

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#42650; Package guix-patches. (Mon, 03 Aug 2020 12:34:01 GMT) Full text and rfc822 format available.

Message #16 received at 42650-done <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 42650-done <at> debbugs.gnu.org
Subject: Re: [bug#42650] [PATCH 2/2] gnu: Add python-onnx.
Date: Mon, 03 Aug 2020 09:32:57 -0300
Hello,

Mathieu Othacehe writes:

> You need to mention the added file in the commit message and also add it
> to gnu/local.mk.

Noted, thanks.

>> +       ;; ONNX will build googletest from a git checkout.  Patch CMake
>> +       ;; to use googletest from Guix and enable tests by default.
>
> That seems to be a recurrent issue. Did you fix it by yourself or is
> there a patch out there? 

I fixed it by myself.

Vinicius




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Sep 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 237 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.