Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Revert 66fb6a1: "Avoid compatibility problems with PyPy + dill" #109

Closed
Peque opened this issue Mar 21, 2016 · 30 comments
Closed

Revert 66fb6a1: "Avoid compatibility problems with PyPy + dill" #109

Peque opened this issue Mar 21, 2016 · 30 comments

Comments

@Peque
Copy link
Contributor

Peque commented Mar 21, 2016

Dill was recently added as a new serialization method in Pyro. However, some ugly fixes where made to workaround PyPy+dill compatibility issues.

These fixes should be reverted as soon as Dill fixes its PyPy compatibility issues. It seems there is a patch already that may fix those issues, but it has not being integrated in Dill yet.

I am subscribed to both threads in Dill, so I will update this issue with any relevant information.

@irmen
Copy link
Owner

irmen commented Apr 25, 2016

Note that commit aa7a715 extends these workarounds to add IronPython as well. It doesn't like dill either.
This means we'll now probably get conflicts if we simply want to revert the pypy workaround. Not a big deal, it's not much code

@Peque
Copy link
Contributor Author

Peque commented Apr 26, 2016

@irmen Thanks. Fortunately you are right, it is not a lot of code, so it will be easy to revert anyway. I just wrote a message to Dill's developer to know if there is any work-in-progress or update in relation to PyPy compatibility.

@mmckerns
Copy link

mmckerns commented May 5, 2016

The patch noted above is merged, and I've also fixed a number of the remaining compatibility issues. There are still a few that I can see that remain, however, which I need to get back to soon.

I should note (I saw discussion in the original PR from @Peque) that you can import dill and then stop dill from overriding pickle -- that way, you can override things in a more piecemeal fashion if you like.

>>> import dill
>>> dill.extend(False)

@irmen
Copy link
Owner

irmen commented Jun 27, 2016

any progress with dill? (sorry I haven't bothered to investigate myself).

@Peque
Copy link
Contributor Author

Peque commented Jun 27, 2016

@irmen yes, there has been some progress! I will try to test the latest changes this week (did not find time before). 😇

@irmen
Copy link
Owner

irmen commented Jun 27, 2016

awesome, thanks.

@Peque
Copy link
Contributor Author

Peque commented Jun 30, 2016

It seems the tests do not pass yet. 7 fails, detailed here:

https://gist.github.com/Peque/be752e1fa6f4e845ace9607d803fb0f7

They all end in the form:

[...]
  File "/usr/lib64/pypy-4.0.1/lib-python/2.7/pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "/media/src/Pyro4/.tox/pypy/site-packages/dill/dill.py", line 1015, in save_wrapper_descriptor
    pickler.save_reduce(_getattr, (obj.__objclass__, obj.__name__,
AttributeError: 'function' object has no attribute '__objclass__'

@mmckerns Any ideas? 😊

@mmckerns
Copy link

mmckerns commented Jun 30, 2016

Aha… this appears to be an issue that is not tested in the main dill test suite, but is tested in dill_bugs.py which is a collection of known failure cases. Apparently dill is failing in pypy in an unexpected way, and this case is replicating the errors you are seeing. Let's move this to a new ticket (uqfoundation/dill#175) in dill for this particular case.

@Peque
Copy link
Contributor Author

Peque commented Jun 30, 2016

@mmckerns Thanks. ❤️

I will keep an eye on that issue and try again when it is solved.

@irmen
Copy link
Owner

irmen commented Jul 4, 2016

Ok. I don't think I'll wait for this for the upcoming Pyro release, it will (hopefully) land in the one after that.

@Peque
Copy link
Contributor Author

Peque commented Jul 7, 2016

@irmen Sure, go ahead. Let us hope it will be ready for the next release. 😊

@irmen
Copy link
Owner

irmen commented Dec 13, 2016

any progress on this front? 👷

@Peque
Copy link
Contributor Author

Peque commented Dec 14, 2016

@irmen I don't think so. I may try to contact Mike this weekend and propose him a deal: he works on this, I help him setting up CI in dill with pytest and Travis (I've done some initial coding and seems doable)... Don't know if he'll be interested, though. 😅

@irmen
Copy link
Owner

irmen commented Dec 14, 2016

okay thanks for the update!

@mmckerns
Copy link

I have not had time to resolve this issue yet, but you can track the progress here: (uqfoundation/dill#175). I may be able to get to it over the next week or so, and hopefully it's easy to solve. Basically, I think the only compatibility issue I can see is with the wrapper_descriptor.

@Peque
Copy link
Contributor Author

Peque commented Jan 16, 2017

It seems there are some updates related to this:

uqfoundation/dill#175

There is a discussion in PyPy's Bitbucket (where Armin Rigo himself has been very diligent and helpful):

https://bitbucket.org/pypy/pypy/issues/2464/getset_descriptor-cannot-access

So, hopefully, everything will be fixed and ready for the next PyPy and dill versions. 😊

Thanks a lot, @mmckerns.

@irmen
Copy link
Owner

irmen commented Jan 16, 2017

Nice to hear!

@mmckerns
Copy link

The latest builds of pypy and dill pass all tests that I have for pypy + dill compatibility. You guys are probably better suited to further test this than I am. Please report any issues you might find.

@irmen
Copy link
Owner

irmen commented Jan 17, 2017

thanks
it does require a new pypy version from what I understand (which one?).
I'm not sure yet if this is reason enough to keep the checks in place but make them know about the minimum pypy version required to make things work, or just assume it will be resolved externally.

@Peque
Copy link
Contributor Author

Peque commented Jan 17, 2017

@irmen Last commit in PyPy related to this issue is from an hour ago, so it will require next version (not-yet-tagged). I guess right now the only way to try this is with the PyPy latest development version. I haven't download it nor try it yet, though.

Maybe next week I'll find some time to download it and try it to see if everything is fixed. Regarding the "keep the checks in place" issue... I guess that is as you wish, you are the owner. 😉

@mmckerns
Copy link

I have been testing against the pypy nightly builds, which are pretty easy to install and work with.

@irmen
Copy link
Owner

irmen commented Jan 18, 2017

I suppose it is enough to add a warning in the docs that using dill will require a very recent pypy version with the needed changes to support it. And remove the workarounds from the code. That way we don't have to wait for an official release version and don't have to stick around with ugly version checks in the pyro code. For Ironpython it just doesn't work but I guess the choice of using a particular python implementation that doesn't fully support the serializer the user chooses, is the problem of the user and not of Pyro.

@Peque
Copy link
Contributor Author

Peque commented Jan 25, 2017

@irmen Agree. Although maybe we should wait for an official dill and pypy releases. Otherwise Pyro4 tests will fail in Travis (unless we configure the pypy tests to be executed with a nightly build or something...). If there is no need to hurry this changes, I would rather wait. 😉

PS: couldn't try the latest changes with pypy nightly builds (dependencies on libraries not available in my system: Fedora). I guess I could try with a containerized Ubuntu, but have not found the time yet.

@mmckerns
Copy link

A new dill release is imminent. Should be out in a few days.

@irmen
Copy link
Owner

irmen commented Jan 25, 2017

There's no need to hurry things. Although I don't know what pypy's release schedule is

@mmckerns
Copy link

No worries, it's a planned release.

@Peque
Copy link
Contributor Author

Peque commented Jan 26, 2017

@irmen They do not have a fixed schedule, I think, but it is usually each couple of months. This year there is no release yet, but last year there were in November, September, August, June, May, April, March... So I hope it wont take much longer to see a new release this year. 😊

@irmen
Copy link
Owner

irmen commented Jan 27, 2017

commit c6cf81c removes most of the platform checks with dill, in anticipation of the new releases

@Peque
Copy link
Contributor Author

Peque commented Jan 29, 2017

@irmen You may want to change .travis config file meanwhile (#145).

@irmen
Copy link
Owner

irmen commented Feb 5, 2017

I noticed the new dill release came out recently, and indeed it fixes the issues with pypy. For Pyro's test suite, we don't even need the latest pypy release to successfully complete

@irmen irmen closed this as completed Feb 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants