Closed aaronj0 closed 3 weeks ago
More info:
The PR that reverts the patches in CPyCppyy, removes patches that revert 3 commits upstream.
So I assume the bug was induced by one of the 3 commits upstream, since the example works on ROOT master that currently reverts these commits:
In order:
Those patches came from ROOT in the first place. Make up your mind. :)
Those patches came from ROOT in the first place. Make up your mind. :)
Yeah I see it's from Jonas's fixes upstream. I found that the second commit is what caused the bug. @guitargeek any idea how we can fix it?
Ok I can look into it, but if what you're saying is true (that the regression comes from c061703), then this is not a patch that comes from ROOT as far as I can tell. Anyway it's a small scoped change that caused the regression, so we should be able to sort it out fast!
Maybe; the problem introduced there is probably along the lines of having 2 implicit converters called and one blocking the other with their flags.
@wlav, the issue does come from https://github.com/wlav/CPyCppyy/commit/c06170389ea6e37fc6f25f9f0e44940fb1035625, specifically making this CallContext noimp
call in the string_view converter:
bool CPyCppyy::STLStringViewConverter::SetArg(
PyObject* pyobject, Parameter& para, CallContext* ctxt)
{
// normal instance convertion (eg. string_view object passed)
if (!PyInt_Check(pyobject) && !PyLong_Check(pyobject)) {
+ CallContextRAII<CallContext::kNoImplicit> noimp(ctxt);
if (InstanceConverter::SetArg(pyobject, para, ctxt)) {
if I remove this line and allow it to be implicit then this issue no longer happens. How do you think we should proceed?
That call needs to be protected against implicit conversions; that part is correct. Looks to me that the logic in the RAII object is wrong, though.
We ran into failures in root in the following call:
to the RDataFrame constructor:
This currently works on ROOT master. However we unearthed this failure while reverting some patches to CPyCppyy(https://github.com/root-project/root/pull/16212/files) and discovered a minimal example also fails on cppyy master.
On trials with the cases it failed in, a minimal reproduces looks something like this:
This fails when:
cppyy.gbl.processMessage("a", [1, 2, 3])
works)string_view
in the beginning of the function signature:so the above also works.
cc @guitargeek