public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/onnx] test-1.21.0: Add fix to use with onnxruntime
@ 2026-06-08 15:18 Diego Herrera
  0 siblings, 0 replies; only message in thread
From: Diego Herrera @ 2026-06-08 15:18 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/onnx
Branch : test-1.21.0
Commit : fdc60563f9b4506b4318c93115d7c69005ded369
Author : Diego Herrera <dherrera@redhat.com>
Date   : 2023-09-06T18:44:34-03:00
Stats  : +53/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/onnx/c/fdc60563f9b4506b4318c93115d7c69005ded369?branch=test-1.21.0

Log:
Add fix to use with onnxruntime

---
diff --git a/onnx.spec b/onnx.spec
index 9d7a7dc..a86b27a 100644
--- a/onnx.spec
+++ b/onnx.spec
@@ -2,7 +2,7 @@
 
 Name:       onnx
 Version:    1.14.0
-Release:    6%{?dist}
+Release:    7%{?dist}
 Summary:    Open standard for machine learning interoperability
 License:    Apache-2.0
 
@@ -18,6 +18,8 @@ Patch1:     onnx-tox.patch
 Patch2:     onnx-requirements.patch
 # Let pyproject_wheel use binaries from cmake_build
 Patch3:     python-cmake-fix.patch 
+# Add fixes for use with onnxruntime
+Patch4:     onnxruntime_fix.patch
 
 # https://bugzilla.redhat.com/show_bug.cgi?id=2212096
 ExcludeArch:    s390x
@@ -114,6 +116,9 @@ export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
 %{_bindir}/check-node
 
 %changelog
+* Wed Aug 30 2023 Diego Herrera C <dherrera@redhat.com> - 1.14.0-7
+- Add fix to use with onnxruntime
+
 * Sat Aug 5 2023 Diego Herrera C <dherrera@redhat.com> - 1.14.0-6
 - Lower version requirement for parameterized.
 - Lower version requirement for protobuf.

diff --git a/onnxruntime_fix.patch b/onnxruntime_fix.patch
new file mode 100644
index 0000000..d7718a2
--- /dev/null
+++ b/onnxruntime_fix.patch
@@ -0,0 +1,47 @@
+diff -ruN onnx-1.14.0-orig/onnx/defs/schema.cc onnx-1.14.0/onnx/defs/schema.cc
+--- onnx-1.14.0-orig/onnx/defs/schema.cc	2023-08-04 19:00:31.645728197 -0400
++++ onnx-1.14.0/onnx/defs/schema.cc	2023-09-06 18:27:14.667106624 -0300
+@@ -17,6 +17,7 @@
+ #include "onnx/common/assertions.h"
+ #include "onnx/common/stl_backports.h"
+ #include "onnx/defs/parser.h"
++#include "onnx/onnxruntime_fix.h"
+ 
+ namespace ONNX_NAMESPACE {
+ // -1 means ONNX schema hasn't been loaded yet
+@@ -1061,6 +1062,9 @@
+   class SchemasRegisterer {
+    public:
+     SchemasRegisterer() {
++      // Check if static registration is actually disabled
++      if(ONNXRuntimeFix::isStaticRegistrationDisabled()) return;
++
+       // In debug builds, the number of schema registered in this constructor
+       // is compared against the number of calls to schema registration macros.
+ #ifndef NDEBUG
+diff -ruN onnx-1.14.0-orig/onnx/onnxruntime_fix.h onnx-1.14.0/onnx/onnxruntime_fix.h
+--- onnx-1.14.0-orig/onnx/onnxruntime_fix.h	1969-12-31 21:00:00.000000000 -0300
++++ onnx-1.14.0/onnx/onnxruntime_fix.h	2023-09-06 18:38:38.329785016 -0300
+@@ -0,0 +1,22 @@
++#pragma once
++
++namespace ONNX_NAMESPACE {
++
++class ONNXRuntimeFix {
++public:
++  static inline bool isStaticRegistrationDisabled() {
++    return static_registration_disabled();
++  }
++
++  static inline void disableStaticRegistration() {
++    static_registration_disabled() = true;
++  }
++
++private:
++  static inline bool& static_registration_disabled() {
++    static auto value = false;
++    return value;
++  }
++};
++
++} // namespace ONNX_NAMESPACE

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-08 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08 15:18 [rpms/onnx] test-1.21.0: Add fix to use with onnxruntime Diego Herrera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox