From f4e5afcbf1c576a33b7fde549960ed4fa30a4c18 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Tue, 16 Sep 2025 22:06:32 +0200 Subject: [PATCH] [Python] Continue clingwrapper synchronization Continue clingwrapper synchronization with upstream. --- .../pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx | 2 +- .../clingwrapper/src/clingwrapper.cxx | 233 +++++++++++++++--- bindings/pyroot/cppyy/cppyy/test/stltypes.xml | 1 + ...PyCppyy-Perform-function-style-casts.patch | 26 -- .../patches/cppyy-Enable-testsuite.patch | 50 ---- ...nused-template-instance-pattern-rule.patch | 25 -- bindings/pyroot/cppyy/sync-upstream | 39 ++- 7 files changed, 230 insertions(+), 146 deletions(-) delete mode 100644 bindings/pyroot/cppyy/patches/CPyCppyy-Perform-function-style-casts.patch delete mode 100644 bindings/pyroot/cppyy/patches/cppyy-Remove-unused-template-instance-pattern-rule.patch diff --git a/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx b/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx index 98bcbad25d625..360b45a9e51cd 100644 --- a/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx +++ b/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx @@ -274,7 +274,7 @@ static PyObject* op_destruct(CPPInstance* self) } //= CPyCppyy object dispatch support ========================================= -static PyObject* op_dispatch(PyObject* self, PyObject* args, PyObject* /* kdws */) +static PyObject* op_dispatch(PyObject* self, PyObject* args, PyObject* /* kwds */) { // User-side __dispatch__ method to allow selection of a specific overloaded // method. The actual selection is in the __overload__() method of CPPOverload. diff --git a/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx b/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx index f63dff0846220..6343d2bc16b72 100644 --- a/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx +++ b/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx @@ -52,11 +52,64 @@ #include #include +#if defined(__arm64__) +#include +#include +#define CLING_CATCH_UNCAUGHT_ \ +ARMUncaughtException guard; \ +if (setjmp(gExcJumBuf) == 0) { +#define _CLING_CATCH_UNCAUGHT \ +} else { \ + if (!std::getenv("CPPYY_UNCAUGHT_QUIET")) \ + std::cerr << "Warning: uncaught exception in JIT is rethrown; resources may leak" \ + << " (suppress with \"CPPYY_UNCAUGHT_QUIET=1\")" << std::endl;\ + std::rethrow_exception(std::current_exception()); \ +} +#else +#define CLING_CATCH_UNCAUGHT_ +#define _CLING_CATCH_UNCAUGHT +#endif + +#if 0 +// force std::string and allocator instantation, otherwise Clang 13+ fails to JIT +// symbols that rely on some private helpers (e.g. _M_use_local_data) when used in +// in conjunction with the PCH; hat tip: +// https://github.com/sxs-collaboration/spectre/pull/5222/files#diff-093aadf224e5fee0d33ae1810f2f1c23304fb5ca398ba6b96c4e7918e0811729 +#if defined(__GLIBCXX__) && __GLIBCXX__ >= 20220506 +template class std::allocator; +template class std::basic_string; +template class std::basic_string; +#endif + +using namespace CppyyLegacy; +#endif + // temp #include typedef CPyCppyy::Parameter Parameter; // --temp +#if 0 +#if defined(__arm64__) +namespace { + +// Trap uncaught exceptions and longjump back to the point of JIT wrapper entry +jmp_buf gExcJumBuf; + +void arm_uncaught_exception() { + longjmp(gExcJumBuf, 1); +} + +class ARMUncaughtException { + std::terminate_handler m_Handler; +public: + ARMUncaughtException() { m_Handler = std::set_terminate(arm_uncaught_exception); } + ~ARMUncaughtException() { std::set_terminate(m_Handler); } +}; + +} // unnamed namespace +#endif // __arm64__ +#endif // small number that allows use of stack for argument passing const int SMALL_ARGS_N = 8; @@ -75,6 +128,7 @@ static const ClassRefs_t::size_type STD_HANDLE = GLOBAL_HANDLE + 1; typedef std::map Name2ClassRefIndex_t; static Name2ClassRefIndex_t g_name2classrefidx; + static std::map resolved_enum_types; namespace { @@ -245,7 +299,7 @@ class ApplicationStarter { public: ApplicationStarter() { // initialize ROOT early to guarantee proper order of shutdown later on (gROOT is a - // macro that resolves to the ROOT::GetROOT() function call) + // macro that resolves to the ::CppyyLegacy::GetROOT() function call) (void)gROOT; // setup dummy holders for global and std namespaces @@ -262,6 +316,13 @@ class ApplicationStarter { g_globalvars.push_back(nullptr); g_globalidx[nullptr] = 0; + // fill out the builtins + std::set bi{g_builtins}; + for (const auto& name : bi) { + for (const char* a : {"*", "&", "*&", "[]", "*[]"}) + g_builtins.insert(name+a); + } + // disable fast path if requested if (std::getenv("CPPYY_DISABLE_FASTPATH")) gEnableFastPath = false; @@ -324,25 +385,23 @@ class ApplicationStarter { gInterpreter->Declare("namespace __cppyy_internal { struct Sep; }"); // retrieve all initial (ROOT) C++ names in the global scope to allow filtering later - if (!std::getenv("CPPYY_NO_ROOT_FILTER")) { - gROOT->GetListOfGlobals(true); // force initialize - gROOT->GetListOfGlobalFunctions(true); // id. - std::set initial; - Cppyy::GetAllCppNames(GLOBAL_HANDLE, initial); - gInitialNames = initial; + gROOT->GetListOfGlobals(true); // force initialize + gROOT->GetListOfGlobalFunctions(true); // id. + std::set initial; + Cppyy::GetAllCppNames(GLOBAL_HANDLE, initial); + gInitialNames = initial; #ifndef WIN32 - gRootSOs.insert("libCore.so "); - gRootSOs.insert("libRIO.so "); - gRootSOs.insert("libThread.so "); - gRootSOs.insert("libMathCore.so "); + gRootSOs.insert("libCore.so "); + gRootSOs.insert("libRIO.so "); + gRootSOs.insert("libThread.so "); + gRootSOs.insert("libMathCore.so "); #else - gRootSOs.insert("libCore.dll "); - gRootSOs.insert("libRIO.dll "); - gRootSOs.insert("libThread.dll "); - gRootSOs.insert("libMathCore.dll "); + gRootSOs.insert("libCore.dll "); + gRootSOs.insert("libRIO.dll "); + gRootSOs.insert("libThread.dll "); + gRootSOs.insert("libMathCore.dll "); #endif - } // start off with a reasonable size placeholder for wrappers gWrapperHolder.reserve(1024); @@ -467,10 +526,10 @@ std::string Cppyy::ResolveName(const std::string& cppitem_name) if (tclean.compare(0, 9, "std::byte") == 0) return tclean; - // check data types list (accept only builtins as typedefs will // otherwise not be resolved) if (IsBuiltin(tclean)) return tclean; + // special case for enums if (IsEnum(cppitem_name)) return ResolveEnum(cppitem_name); @@ -517,6 +576,36 @@ std::string Cppyy::ResolveName(const std::string& cppitem_name) return "const " + TClassEdit::ShortType(tclean.c_str(), 2); } +#if 0 +//---------------------------------------------------------------------------- +static std::string extract_namespace(const std::string& name) +{ +// Find the namespace the named class lives in, take care of templates +// Note: this code also lives in CPyCppyy (TODO: refactor?) + if (name.empty()) + return name; + + int tpl_open = 0; + for (std::string::size_type pos = name.size()-1; 0 < pos; --pos) { + std::string::value_type c = name[pos]; + + // count '<' and '>' to be able to skip template contents + if (c == '>') + ++tpl_open; + else if (c == '<') + --tpl_open; + + // collect name up to "::" + else if (tpl_open == 0 && c == ':' && name[pos-1] == ':') { + // found the extend of the scope ... done + return name.substr(0, pos-1); + } + } + +// no namespace; assume outer scope + return ""; +} +#endif std::string Cppyy::ResolveEnum(const std::string& enum_type) { @@ -571,6 +660,30 @@ std::string Cppyy::ResolveEnum(const std::string& enum_type) return restype; // should default to some int variant } +#if 0 +static Cppyy::TCppIndex_t ArgSimilarityScore(void *argqtp, void *reqqtp) +{ +// This scoring is not based on any particular rules + if (gInterpreter->IsSameType(argqtp, reqqtp)) + return 0; // Best match + else if ((gInterpreter->IsSignedIntegerType(argqtp) && gInterpreter->IsSignedIntegerType(reqqtp)) || + (gInterpreter->IsUnsignedIntegerType(argqtp) && gInterpreter->IsUnsignedIntegerType(reqqtp)) || + (gInterpreter->IsFloatingType(argqtp) && gInterpreter->IsFloatingType(reqqtp))) + return 1; + else if ((gInterpreter->IsSignedIntegerType(argqtp) && gInterpreter->IsUnsignedIntegerType(reqqtp)) || + (gInterpreter->IsFloatingType(argqtp) && gInterpreter->IsUnsignedIntegerType(reqqtp))) + return 2; + else if ((gInterpreter->IsIntegerType(argqtp) && gInterpreter->IsIntegerType(reqqtp))) + return 3; + else if ((gInterpreter->IsIntegralType(argqtp) && gInterpreter->IsIntegralType(reqqtp))) + return 4; + else if ((gInterpreter->IsVoidPointerType(argqtp) && gInterpreter->IsPointerType(reqqtp))) + return 5; + else + return 10; // Penalize heavily for no possible match +} +#endif + Cppyy::TCppScope_t Cppyy::GetScope(const std::string& sname) { // First, try cache @@ -707,7 +820,7 @@ Cppyy::TCppType_t Cppyy::GetActualClass(TCppType_t klass, TCppObject_t obj) #endif TClass* clActual = cr->GetActualClass((void*)obj); - // The additional check using TClass::GetClassInfo is to prevent returning classes of which the Interpreter has no info + // The additional check using TClass::GetClassInfo is to prevent returning classes of which the Interpreter has no info (see https://github.com/root-project/root/pull/16177) if (clActual && clActual != cr.GetClass() && clActual->GetClassInfo()) { auto itt = g_name2classrefidx.find(clActual->GetName()); if (itt != g_name2classrefidx.end()) @@ -733,7 +846,6 @@ size_t Cppyy::SizeOf(const std::string& type_name) return SizeOf(GetScope(type_name)); } - bool Cppyy::IsBuiltin(const std::string& type_name) { if (g_builtins.find(type_name) != g_builtins.end()) @@ -756,7 +868,7 @@ bool Cppyy::IsComplete(const std::string& type_name) int oldEIL = gErrorIgnoreLevel; gErrorIgnoreLevel = 3000; - TClass* klass = TClass::GetClass(TClassEdit::ShortType(type_name.c_str(), 1).c_str()); + TClass* klass = TClass::GetClass(type_name.c_str()); if (klass && klass->GetClassInfo()) // works for normal case w/ dict b = gInterpreter->ClassInfo_IsLoaded(klass->GetClassInfo()); else { // special case for forward declared classes @@ -802,11 +914,11 @@ void Cppyy::Destruct(TCppType_t type, TCppObject_t instance) else { auto ib = sHasOperatorDelete.find(type); if (ib == sHasOperatorDelete.end()) { - TFunction *f = (TFunction *)cr->GetMethodAllAny("operator delete"); - sHasOperatorDelete[type] = (bool)(f && (f->Property() & kIsPublic)); - ib = sHasOperatorDelete.find(type); + TFunction *f = (TFunction *)cr->GetMethodAllAny("operator delete"); + sHasOperatorDelete[type] = (bool)(f && (f->Property() & kIsPublic)); + ib = sHasOperatorDelete.find(type); } - ib->second ? cr->Destructor((void *)instance) : ::operator delete((void *)instance); + ib->second ? cr->Destructor((void*)instance) : ::operator delete((void*)instance); } } } @@ -869,7 +981,8 @@ bool copy_args(Parameter* args, size_t nargs, void** vargs) } static inline -void release_args(Parameter* args, size_t nargs) { +void release_args(Parameter* args, size_t nargs) +{ for (size_t i = 0; i < nargs; ++i) { if (args[i].fTypeCode == 'X') free(args[i].fValue.fVoidp); @@ -1106,15 +1219,19 @@ bool Cppyy::IsAbstract(TCppType_t klass) bool Cppyy::IsEnum(const std::string& type_name) { if (type_name.empty()) return false; + + if (type_name.rfind("enum ", 0) == 0) + return true; // by definition (C-style) + std::string tn_short = TClassEdit::ShortType(type_name.c_str(), 1); if (tn_short.empty()) return false; return gInterpreter->ClassInfo_IsEnum(tn_short.c_str()); } -bool Cppyy::IsAggregate(TCppType_t klass) +bool Cppyy::IsAggregate(TCppType_t type) { -// Test if this type is an aggregate type - TClassRef& cr = type_from_handle(klass); +// Test if this type is a "plain old data" type + TClassRef& cr = type_from_handle(type); if (cr.GetClass()) return cr->ClassProperty() & kClassIsAggregate; return false; @@ -1183,7 +1300,7 @@ static inline void cond_add(Cppyy::TCppScope_t scope, const std::string& ns_scope, std::set& cppnames, const char* name, bool nofilter = false) { - if (!name || name[0] == '_' || strstr(name, ".h") != 0 || strncmp(name, "operator", 8) == 0) + if (!name || strstr(name, ".h") != 0) return; if (scope == GLOBAL_HANDLE) { @@ -1238,6 +1355,21 @@ void Cppyy::GetAllCppNames(TCppScope_t scope, std::set& cppnames) cond_add(scope, ns_scope, cppnames, gClassTable->Next()); */ +#if 0 +// add interpreted classes (no load) + { + ClassInfo_t* ci = gInterpreter->ClassInfo_FactoryWithScope( + false /* all */, scope == GLOBAL_HANDLE ? nullptr : cr->GetName()); + while (gInterpreter->ClassInfo_Next(ci)) { + const char* className = gInterpreter->ClassInfo_FullName(ci); + if (strstr(className, "(anonymous)") || strstr(className, "(unnamed)")) + continue; + cond_add(scope, ns_scope, cppnames, className); + } + gInterpreter->ClassInfo_Delete(ci); + } +#endif + // any other types (e.g. that may have come from parsing headers) coll = gROOT->GetListOfTypes(); { @@ -1252,23 +1384,21 @@ void Cppyy::GetAllCppNames(TCppScope_t scope, std::set& cppnames) // add functions coll = (scope == GLOBAL_HANDLE) ? - gROOT->GetListOfGlobalFunctions() : cr->GetListOfMethods(); + gROOT->GetListOfGlobalFunctions(true) : cr->GetListOfMethods(true); { TIter itr{coll}; TFunction* obj = nullptr; while ((obj = (TFunction*)itr.Next())) { const char* nm = obj->GetName(); // skip templated functions, adding only the un-instantiated ones - if (nm && nm[0] != '_' && strstr(nm, "<") == 0 && strncmp(nm, "operator", 8) != 0) { - if (gInitialNames.find(nm) == gInitialNames.end()) - cppnames.insert(nm); - } + if (nm && gInitialNames.find(nm) == gInitialNames.end()) + cppnames.insert(nm); } } // add uninstantiated templates coll = (scope == GLOBAL_HANDLE) ? - gROOT->GetListOfFunctionTemplates() : cr->GetListOfFunctionTemplates(); + gROOT->GetListOfFunctionTemplates() : cr->GetListOfFunctionTemplates(true); FILL_COLL(TFunctionTemplate, kIsPrivate | kIsProtected) // add (global) data members @@ -1350,7 +1480,7 @@ std::string Cppyy::GetScopedFinalName(TCppType_t klass) return std::string("std::")+cr->GetName(); return cr->GetName(); } - return ""; + return ""; } bool Cppyy::HasVirtualDestructor(TCppType_t klass) @@ -1512,10 +1642,8 @@ bool Cppyy::GetSmartPtrInfo( TClassRef& cr = type_from_handle(GetScope(tname)); if (cr.GetClass()) { TFunction* func = cr->GetMethod("operator->", ""); - if (!func) { - gInterpreter->UpdateListOfMethods(cr.GetClass()); + if (!func) func = cr->GetMethod("operator->", ""); - } if (func) { if (deref) *deref = (TCppMethod_t)new_CallWrapper(func); if (raw) *raw = GetScope(TClassEdit::ShortType( @@ -2234,6 +2362,31 @@ std::string Cppyy::GetDatamemberType(TCppScope_t scope, TCppIndex_t idata) s << '[' << m->GetMaxIndex(i) << ']'; fullType.append(s.str()); } + +#if 0 + // this is the only place where anonymous structs are uniquely identified, so setup + // a class if needed, such that subsequent GetScope() and GetScopedFinalName() calls + // return the uniquely named class + auto declid = m->GetTagDeclId(); //GetDeclId(); + if (declid && (m->Property() & (kIsClass | kIsStruct | kIsUnion)) &&\ + (fullType.find("(anonymous)") != std::string::npos || fullType.find("(unnamed)") != std::string::npos)) { + + // use the (fixed) decl id address to guarantee a unique name, even when there + // are multiple anonymous structs in the parent scope + std::ostringstream fulls; + fulls << fullType << "@" << (void*)declid; + fullType = fulls.str(); + + if (g_name2classrefidx.find(fullType) == g_name2classrefidx.end()) { + ClassInfo_t* ci = gInterpreter->ClassInfo_Factory(declid); + TClass* cl = gInterpreter->GenerateTClass(ci, kTRUE /* silent */); + gInterpreter->ClassInfo_Delete(ci); + if (cl) cl->SetName(fullType.c_str()); + g_name2classrefidx[fullType] = g_classrefs.size(); + g_classrefs.emplace_back(cl); + } + } +#endif return fullType; } @@ -2483,3 +2636,5 @@ long long Cppyy::GetEnumDataValue(TCppEnum_t etype, TCppIndex_t idata) TEnumConstant* ecst = (TEnumConstant*)((TEnum*)etype)->GetConstants()->At((int)idata); return (long long)ecst->GetValue(); } + + diff --git a/bindings/pyroot/cppyy/cppyy/test/stltypes.xml b/bindings/pyroot/cppyy/cppyy/test/stltypes.xml index 7ced2f35f6d98..4a5c2c00e1095 100644 --- a/bindings/pyroot/cppyy/cppyy/test/stltypes.xml +++ b/bindings/pyroot/cppyy/cppyy/test/stltypes.xml @@ -33,4 +33,5 @@ + diff --git a/bindings/pyroot/cppyy/patches/CPyCppyy-Perform-function-style-casts.patch b/bindings/pyroot/cppyy/patches/CPyCppyy-Perform-function-style-casts.patch deleted file mode 100644 index 2d2213b2ea758..0000000000000 --- a/bindings/pyroot/cppyy/patches/CPyCppyy-Perform-function-style-casts.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 6e6725637d4a0d0402fac38a08f7176991d29ac9 Mon Sep 17 00:00:00 2001 -From: Jonas Rembser -Date: Tue, 17 Dec 2024 13:17:36 +0100 -Subject: [PATCH] Perform function-style casts when returning multi-keyword - types - ---- - bindings/pyroot/cppyy/CPyCppyy/src/Dispatcher.cxx | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/bindings/pyroot/cppyy/CPyCppyy/src/Dispatcher.cxx b/bindings/pyroot/cppyy/CPyCppyy/src/Dispatcher.cxx -index db388575db..cdef2b8c7b 100644 ---- a/bindings/pyroot/cppyy/CPyCppyy/src/Dispatcher.cxx -+++ b/bindings/pyroot/cppyy/CPyCppyy/src/Dispatcher.cxx -@@ -45,7 +45,7 @@ static inline void InjectMethod(Cppyy::TCppMethod_t method, const std::string& m - " return"; - if (retType != "void") { - if (retType.back() != '*') -- code << " " << CPyCppyy::TypeManip::remove_const(retType) << "{}"; -+ code << " (" << CPyCppyy::TypeManip::remove_const(retType) << "){}"; - else - code << " nullptr"; - } --- -2.47.0 - diff --git a/bindings/pyroot/cppyy/patches/cppyy-Enable-testsuite.patch b/bindings/pyroot/cppyy/patches/cppyy-Enable-testsuite.patch index 7da6f7bd02ad0..8523b3c261e35 100644 --- a/bindings/pyroot/cppyy/patches/cppyy-Enable-testsuite.patch +++ b/bindings/pyroot/cppyy/patches/cppyy-Enable-testsuite.patch @@ -1,53 +1,3 @@ -From 7eafbaa8ad7a17ac9fe860982bd168c5d3c05589 Mon Sep 17 00:00:00 2001 -From: Aaron Jomy -Date: Thu, 27 Mar 2025 11:31:02 +0100 -Subject: [PATCH 1/2] [cppyy] Drop genreflex in favour of rootcling for test - dictionaries - -This patch modifies upstream cppyy's test suite to use rootcling for -dictionary generation, and also marks all tests that regress or crash -on ROOT. This heavily simplifies the MakeFile, which will be dropped -subsequently in favour of CMake that adds this to ROOTs ctest executable. ---- - bindings/pyroot/cppyy/cppyy/test/Makefile | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) - -diff --git a/bindings/pyroot/cppyy/cppyy/test/Makefile b/bindings/pyroot/cppyy/cppyy/test/Makefile -index 0d13d38c22..c40442fab0 100644 ---- a/bindings/pyroot/cppyy/cppyy/test/Makefile -+++ b/bindings/pyroot/cppyy/cppyy/test/Makefile -@@ -16,20 +16,22 @@ dicts = advancedcppDict.so \ - - all : $(dicts) - --genreflex_flags := $(shell genreflex --cppflags) --cppflags=$(shell cling-config --cppflags) $(genreflex_flags) -O3 -fPIC -I$(shell python -c 'import sysconfig as sc; print(sc.get_config_var("INCLUDEPY"))') -Wno-register -- -+cppflags=$(shell root-config --cflags) -O3 -fPIC -I$(shell python -c 'import sysconfig as sc; print(sc.get_config_var("INCLUDEPY"))') -Wno-register - PLATFORM := $(shell uname -s) - ifeq ($(PLATFORM),Darwin) - cppflags+=-dynamiclib -undefined dynamic_lookup -Wno-delete-non-virtual-dtor - endif - -+# For these tests, the rootcling invocation looks like the following: -+# rootcling advancedcpp_rflx.cpp --rmf advancedcppDict.rootmap --rml advancedCppDict.so advancedcpp.h advancedcpp.xml -+%_rflx.cpp: %.h %.xml -+ rootcling $@ --rmf $*Dict.rootmap --rml $*Dict.so $^ -+ -+# Compiling the test dictionaries to shared libs: -+# g++ $(cppflags) -shared -o advancedcppDict.so advancedcpp_rflx.cpp advancedcpp.cxx - %Dict.so: %_rflx.cpp %.cxx - $(CXX) $(cppflags) -shared -o $@ $^ - --%_rflx.cpp: %.h %.xml -- genreflex $< --selection=$*.xml --rootmap=$*Dict.rootmap --rootmap-lib=$*Dict.so -- - .PHONY: test clean - - test: --- -2.43.0 - From 23d7c1353eb0bdd88f0e83a3c7a6c8b177e98700 Mon Sep 17 00:00:00 2001 From: Aaron Jomy Date: Thu, 27 Mar 2025 11:32:57 +0100 diff --git a/bindings/pyroot/cppyy/patches/cppyy-Remove-unused-template-instance-pattern-rule.patch b/bindings/pyroot/cppyy/patches/cppyy-Remove-unused-template-instance-pattern-rule.patch deleted file mode 100644 index c750b0493fdc3..0000000000000 --- a/bindings/pyroot/cppyy/patches/cppyy-Remove-unused-template-instance-pattern-rule.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 1d67aa782008d571d7d0bc545c3c0bcf335f0adc Mon Sep 17 00:00:00 2001 -From: Danilo Piparo -Date: Thu, 26 Jun 2025 20:41:53 +0200 -Subject: [PATCH] [cppyy] Remove unused template instance pattern rule - -as there are no instances to match. ---- - bindings/pyroot/cppyy/cppyy/test/templates.xml | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/bindings/pyroot/cppyy/cppyy/test/templates.xml b/bindings/pyroot/cppyy/cppyy/test/templates.xml -index 32f56da76f3..7cb33f67a00 100644 ---- a/bindings/pyroot/cppyy/cppyy/test/templates.xml -+++ b/bindings/pyroot/cppyy/cppyy/test/templates.xml -@@ -36,7 +36,6 @@ - - - -- - - - --- -2.49.0 - diff --git a/bindings/pyroot/cppyy/sync-upstream b/bindings/pyroot/cppyy/sync-upstream index ae3d9e068929e..e0ce712cd336c 100755 --- a/bindings/pyroot/cppyy/sync-upstream +++ b/bindings/pyroot/cppyy/sync-upstream @@ -4,12 +4,14 @@ # We will keep our own CMakeLists.txt files +mv cppyy-backend/CMakeLists.txt cppyy-backend_CMakeLists.txt mv CPyCppyy/CMakeLists.txt CPyCppyy_CMakeLists.txt mv cppyy/CMakeLists.txt cppyy_CMakeLists.txt mv cppyy/test/CMakeLists.txt cppyy_test_CMakeLists.txt rm -rf CPyCppyy rm -rf cppyy +rm -rf cppyy-backend # If we want to clone specific branches: # git clone --depth 1 --branch CPyCppyy-1.13.0 https://github.com/wlav/CPyCppyy.git @@ -17,13 +19,14 @@ rm -rf cppyy git clone https://github.com/wlav/CPyCppyy.git git clone https://github.com/wlav/cppyy.git +git clone https://github.com/wlav/cppyy-backend.git rebase_topic () { git rebase sync $1 && git branch -D sync && git checkout -b sync } cd CPyCppyy/ -git reset --hard 0586cd9e5d7112cf20418c5126130276c5b8e384 +git reset --hard 1d049d4dab7cc26387dc938846e42bc3a7e0a05c git remote rename origin wlav @@ -34,13 +37,12 @@ git checkout -b sync rebase_topic guitargeek/py_errors rebase_topic guitargeek/reduce_api -rebase_topic guitargeek/improve-clone-heuristic # equivalent to vepadulano/improve-clone-heuristic cd ../ cd cppyy/ -git reset --hard 05c8f2dad4a37c495c55f2ea28d9dff540b0fecc +git reset --hard a3bd17f45b42689c2504a514ea0397b2eeb63a5d git remote rename origin wlav @@ -51,23 +53,51 @@ git checkout -b sync rebase_topic guitargeek/concurrency_tests_gil +rm test/Makefile + +cd ../ + +cd cppyy-backend/ + +git reset --hard a6e112cf8396bcddf5ba4d66ab70ca77a7bd9d20 + +sed '/C-linkage wrappers/,$d' clingwrapper/src/clingwrapper.cxx > clingwrapper/src/clingwrapper.cxx.no_c_api + +mv clingwrapper/src/clingwrapper.cxx.no_c_api clingwrapper/src/clingwrapper.cxx + +rm -rf .circleci/ +rm -rf .github/ +rm .gitignore +rm README.rst +rm circleci.py +rm -rf cling/ +rm clingwrapper/MANIFEST.in +rm clingwrapper/README.rst +rm clingwrapper/pyproject.toml +rm clingwrapper/setup.cfg +rm clingwrapper/setup.py +rm clingwrapper/src/capi.h +rm clingwrapper/src/clingwrapper.h +rm clingwrapper/src/cppyy.h + cd ../ rm -rf CPyCppyy/.git rm -rf cppyy/.git +rm -rf cppyy-backend/.git # Move back CMakeLists.txt files mv CPyCppyy_CMakeLists.txt CPyCppyy/CMakeLists.txt mv cppyy_CMakeLists.txt cppyy/CMakeLists.txt mv cppyy_test_CMakeLists.txt cppyy/test/CMakeLists.txt +mv cppyy-backend_CMakeLists.txt cppyy-backend/CMakeLists.txt # Apply patches (they were created with git format-patch -1 HEAD) # Alternatively, one can also use "git am" to create individual commits git apply patches/CPyCppyy-Adapt-to-no-std-in-ROOT.patch git apply patches/CPyCppyy-Always-convert-returned-std-string.patch git apply patches/CPyCppyy-Prevent-construction-of-agg-init-for-tuple.patch -git apply patches/CPyCppyy-Perform-function-style-casts.patch # https://github.com/wlav/CPyCppyy/pull/34 git apply patches/CPyCppyy-Use-PyMapping_GetOptionalItemString-where-necessary.patch # https://github.com/wlav/CPyCppyy/pull/44 git apply patches/CPyCppyy-Add-converters-and-low-level-views-for-fixed-width-integers.patch # https://github.com/wlav/CPyCppyy/pull/52 git apply patches/CPyCppyy-Correct-check-for-temporaries-in-Python-3.14.patch # https://github.com/wlav/CPyCppyy/pull/53 @@ -79,4 +109,3 @@ git apply patches/cppyy-No-CppyyLegacy-namespace.patch git apply patches/cppyy-Remove-Windows-workaround.patch git apply patches/cppyy-Don-t-enable-cling-autoloading.patch git apply patches/cppyy-Enable-testsuite.patch -git apply patches/cppyy-Remove-unused-template-instance-pattern-rule.patch