-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#8505] Run PyPy with Travis-CI #226
Conversation
.travis.yml
Outdated
| "$PYENV_ROOT/bin/pyenv" install --skip-existing "pypy-$PYPY_VERSION" | ||
| virtualenv --python="$PYENV_ROOT/versions/pypy-$PYPY_VERSION/bin/python" "$HOME/virtualenvs/pypy-$PYPY_VERSION" | ||
| source "$HOME/virtualenvs/pypy-$PYPY_VERSION/bin/activate" | ||
| fi | ||
| - pip install tox tox-travis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't technically need to install tox explicitly, since tox-travis depends on tox... :-)
|
@adiroiban it looks like travis did not to run on the last two commits -- was that intentional?? |
Nope. Something is broken with Travis-CI as it was ignoring my push commits. |
|
@adiroiban fair enough. i'm happy to help if i can! |
|
I have other PR and travis-ci is not triggered ... so I need to investigate ...I have sent an email to Travis-CI support team anyway we need to fix the coverage issue and this will also need to be deployed on our buildbot env |
.travis.yml
Outdated
| virtualenv --python="$PYENV_ROOT/versions/pypy-$PYPY_VERSION/bin/python" "$HOME/virtualenvs/pypy-$PYPY_VERSION" | ||
| source "$HOME/virtualenvs/pypy-$PYPY_VERSION/bin/activate" | ||
| echo "import sys; sys.setrecursionlimit(10000)" > $HOME/virtualenvs/pypy-$PYPY_VERSION/ | ||
| /lib-python/2.7/sitecustomize.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this line supposed to do? This line introduces YAML syntax error, so Travis CI build will not run.
|
@adiroiban so it didn't fix the issue but it did seem to let the code advance a little farther. if you're willing to give it another shot, you can bump the recursion limit to 10000. otherwise i'll report back after i've gotten a chance to run coverage & trial under a debug build of pypy. |
The limit is already at 10.000 ... as I have just copy pasted from your comment :) Maybe is worth getting in touch with coverage people to see if something special is needed for PyPy |
|
@adiroiban sorry, i meant 100,000 - github ate my comment and i hastily retyped it. i can reach out to the coverage people, but i'm pretty sure this is a pypy specific issue :( i'll update this PR when i know more. |
|
@markrwilliams: take a look at https://travis-ci.org/twisted/twisted/jobs/142311357 |
|
@rodrigc Sorry, I should have mentioned that I've filed an issue with PyPy about this: https://bitbucket.org/pypy/pypy/issues/2335/maximum-recursion-depth-exceeded-with |
|
@markrwilliams How many Pypy patches for Twisted do you have? Getting blocked because the coverage tool itself doesn't work under Pypy is :( |
|
The codecov patch protection was lifted see twisted-infra/braid#213 so you can no merge pypy patches even if their coverage is not reported |
|
Armin Rigo just pushed a fix for the coverage issue. Looks like we can revist it this after the next PyPy release! |
Codecov Report
@@ Coverage Diff @@
## trunk #226 +/- ##
===========================================
- Coverage 91.28% 45.82% -45.47%
===========================================
Files 844 156 -688
Lines 147616 19990 -127626
Branches 13059 2898 -10161
===========================================
- Hits 134756 9160 -125596
+ Misses 10623 10222 -401
+ Partials 2237 608 -1629Continue to review full report at Codecov.
|
|
I have pushed a version with 100.000 recursion limit... but not luck.... so I am reverting that change. Rather than having this code unmerged, I have pushed it for review as at least it can run pypy on travis ci... once a new pypy release is ready, in theory we should only update the version in the travis install.sh When is the new pypy version planned to be released? I had a quick look at the pypy website, but the release notes are done without any date ... very strange. Similar with the bad habit that we have in Twisted, when a ticket is closed as fixed there is no note about when it will be released ... or in which version it was released |
|
@adiroiban - can you update your branch please? hopefully the push of the merge commit will also fix whatever broke the documentation buildbot… |
|
@glyph updated. thanks! |
|
Updating again in the hopes that the CI gods will be with us this time… |
|
Ugh. They were, but now conflicts need to be resolved. |
|
@adiroiban - the build is failing because the topfile is in the wrong place. Move it into |
.travis/install.sh
Outdated
| source ~/.venv/bin/activate | ||
| fi | ||
|
|
||
| # Temporary workaround for https://github.com/pypa/setuptools/issues/776; | ||
| # install (and thereby cache a built wheel of) cryptography. (NB: We're |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why delete this comment? Seems irrelevant to the change in question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed it as for pypy this is no longer valid.
In travis we have pypy 2.5 and in venv we have pypy 5.4
|
Thanks @glyph for the review. I have moved to src and also updated the travis cache functionality It would be nice to have a command in pip which can remove packages which are not used for a long time. for pyenv, I went for this simple pyenv uninstall command, but we might need a .travis/pyenv.cleanup.sh script which will remove any version, other than PYPY_VERSION ... and in the future we might want to keep other versions if pyenv |
|
we are caching on travis the full ~/.cache/pip , but maybe we should only cache ~/.cache/pip/wheels |
|
Instead of doing all this work with pyenv and caching, wouldn't it be easier to install squeaky's portable pypy from scratch on each build? (The travis cache has to be downloaded to the build worker every time anyway, so it's only really useful for artifacts that you're building on travis.) |
|
@njsmith - An alternate PR would be appreciated, but given that "all this work" is already done, is there much benefit to getting rid of it? |
|
I don't know. I just happened to glance at this out of curiosity and on a
quick skim it looked like there was some struggle with getting the cache
state management to work correctly -- the advantage of my suggestion is
that it'd be stateless.
|
|
@adiroiban I agree with @njsmith and would prefer to use squeaky's portable PyPy. I can take up this PR if that approach seems OK to you. |
|
@markrwilliams go for it. Thanks! I have never used pypy so my work from here was just trying to pay it forward for all the good things I use in Twisted basically great python 2.7 as I don't care for the rest :) I think that I have just checked what Travis-CI was doing and I went on those lines. |
|
/me zaps a blessed wand of dead turning on the "Twisted on PyPy" thread. The PR rises from the dead. |
|
@ulidtko You have successfully nerd-sniped me. |
|
What's wrong with the travis-provided PyPy that means pyenv needs to be involved? |
|
Historically it has been unspeakably ancient, and only the most recent pypys are really worth testing. If travis is on the latest we could revert that part. |
|
(I’d rather just land this as-is and do that as a follow-up though) |
|
Got it -- yup sounds good (me personally I've [not had any issues recently
with it being terribly out of date](
https://travis-ci.org/Julian/jsonschema/jobs/569829619#L273), but yeah
think doing it as a follow up is fine)
…On Fri, Aug 9, 2019 at 8:10 PM Glyph ***@***.***> wrote:
(I’d rather just land this as-is and do that as a follow-up though)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#226?email_source=notifications&email_token=AACQQXU343MJ3HVQOGQFVA3QDYBPZA5CNFSM4CH2RFWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4ABSUA#issuecomment-520100176>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACQQXWRAASMCHULIW5LX6LQDYBPZANCNFSM4CH2RFWA>
.
|
| realFromFD = socket.fromfd | ||
| if realFromFD.__name__ == fromFDWithoutModifyingFlags.__name__: | ||
| return | ||
| socket.fromfd = fromFDWithoutModifyingFlags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... personally I have experienced cases where twisted has monkey patched globally a thing and that monkey patch introduced bugs in non-twisted code...
I realize how tempting this is over instead just changing code to use a level of indirection, since I presume fromfd is reasonably widely used but... severe :(
Tell me to go away though I guess, and that this is the best way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the best way, at least in this specific case.
- It's only monkeypatched on pypy3
- The behavior on pypy3 is buggy as heck and this will fix it for other programs as well.
- The monkeypatch is harmless (even if the monkeypatch were to get invoked on a different cpython, it would at worst be slightly inefficient unless someone is doing something truly batty with threads).
- I expect this to be relatively short-lived; it links to the bug, the bug is super straightforward and has a reproducer that's only a half a dozen lines. The other bug I filed today, Armin has already fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really dislike the monkey patching, but other than that, lgtm.
See https://twistedmatrix.com/trac/ticket/8505