-
Notifications
You must be signed in to change notification settings - Fork 239
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
Patching pypy venv #502
Patching pypy venv #502
Conversation
These changes are only needed for posix. |
I think we should have a reminder somewhere that this can be reverted after the next PyPy release. @joerick? |
one of the problem of this PR is that this code fails when cannot apply the patch. So It will fail when the user does not use pinned images, but will signal that there is need to remove patch after update. Or I should ignore fail of patch? |
Can it check PyPy version? |
maybe it could parse pypy string. |
|
Let's open a draft PR that reverts these changes once this is merged, that way we won't forget about it |
You could use a
Most users will use latest versions or the pinned versions, I think, so there would be no reason to still support 7.3.3 after we have a version pinning 7.3.4? |
I one project I use prebuild docker images because build libraries take ~0.5h. Of course, I will know that I need immediately rebuild docker images, but maybe some other users decide for the same workflow. |
Ah, right. Well maybe we can leave it around until the next minor point release. |
c737c3d
to
d1acc08
Compare
Sorry, @Czaki, I was trying something, but by accident pushed to your branch instead of my local one! |
Not sure why GHA wasn't triggered, but this seems to work, and is a dramatic simplification: YannickJadoul@615e905. Mind if I push to your branch, @Czaki, or do you prefer to pull from my branch yourself? |
|
Officially, it says that flag changes to that directory before applying the patch. Then if you only pass one file, that's the patch file, and it will go looking for which files to patch (since they are in the diff, anyway) |
Patches are not per-file, add “.patch” to the url of any pull request and you get a single file that describes the whole PR. |
@Czaki, so I'm pushing? |
Push. I do not know why I have a problem with patch the whole directory (so I split on two files). |
I sneaked in another commit, removing the Feel free to discuss/remove, if necessary. I also added a small test to
Not sure if this is a great plan, but it could work as this reminder? (We can't just easily test that in EDIT: Please review/discuss this hack; I'm not convinced about it myself ;-) |
Good idea! But I think we were planning to leave the patch in for a couple releases, even after our pinned version has upgraded, because users might still choose to specify an older version via a docker image. So it's perhaps not appropriate. Anyway, since we can check sys.pypy_version_info before applying the patch, it's not causing much harm being there for a little while. |
Well, that's the part that's not obvious to do, because you need to check the version of the "guess" PyPy, rather than of the host Python. |
There are two questions. If version supporting 7.3.3 should support 7.3.4 (someone updates his docker image without the update of cibuildwheel, because of the rebuild of some dependency). And current implementation supports it. The second question is what to do when changing the base version of PyPy to 7.3.4. I personally prefer to not break compatibility immediately. Especially in the context of the last Cent Os changes. |
That's a good point though; I had only thought about backwards compatibility.
Well, but then you should stay on an older version of |
Maybe a fast drop is a good decision when adding proper information to the documentation. |
Good point, I had not considered this. In that case I'd also be in favour of a quick drop once we have the bug fix in pypy. |
@Czaki, I think you're looking for
if you only want the last two parts tested on macOS. |
Something seems to be going horribly wrong, though? Tests just stall after printing |
I suggest wait. Maybe some download fail. I suggest restart tomorrow morning. Last changes does not affect test_0_basic. |
c8b48c8
to
bbd71eb
Compare
All linux builds on all CIs are stalling out still. :( |
The bug comes from @YannickJadoul patch.
Pure call CLI
Block execution waiting on stdinput. So this is the problem why I split the patch into two files. It looks like macOS patch works differently than Linux one. Did we revert @YannickJadoul changes? |
I have hope that I fix it. I suggest keeping |
This is weird. I tried this out, and things passed. What has changed meanwhile? EDIT: Aha, seems they also timed out; I saw macOS passing and I didn't see Linux failing, so I thought it was OK... |
cibuildwheel/linux.py
Outdated
patch_docker_path = PurePath('/pypy_venv.patch') | ||
docker.copy_into(patch_path, patch_docker_path) | ||
try: | ||
docker.call(['patch', '-N', '-p1', '-d', config.path, '-i', patch_docker_path]) |
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 -N
, why -i
?
-N --forward Ignore patches that appear to be reversed or already applied.
I don't see the point of this? We know our patches should apply forward?
-i PATCHFILE --input=PATCHFILE Read patch from PATCHFILE instead of stdin.
This was also not the issue in what you showed. The issue seems to have been the leading a
/b
?
Better apply one of these, then?
-t --batch Ask no questions; skip bad-Prereq patches; assume reversed.
-f --force Like -t, but ignore bad-Prereq patches, and assume unreversed.
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.
The leading a/b character should be fixed by -p1
. The -i
(or --input
) is correct, we want to specify an input patch, even if it works without it. I think --force
is probably what you want here, though, since you never want it to ask questions, which I think -N
still could do if it's not one of {unpatched, already patched}.
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.
docker.call(['patch', '-N', '-p1', '-d', config.path, '-i', patch_docker_path]) | |
docker.call(['patch', '--force', '-p1', '-d', config.path, '--input', patch_docker_path]) |
Perhaps?
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
is needed to specify the patch file. Patch on Linux assumes that the first file is one to patch.
I see no difference in behavior between -N
and --force
. We have properly formated patch files.
That's going to be annoying for the occasional slow test? Why not just add it when debugging? |
If a test suddenly takes 3x longer, isn't that a bug? As long as the timeout isn't too short so that it triggers on reasonable runs, there's no reason we need to wait 1-6 hours (depending on the CI) to fail? |
Probably. I was just thinking that we now already get the occasional spurious CI failure (just restarted a Travis job), so... myeah |
The main difference is that job killed by CI timeout does not provide any information. We do not know in which phase it stuck. Maybe timeout should be increased, but for me, it is better to get a job killed by pytest-timeout than CI timeout. I got more information. |
That's true, that's why I suggested to keep it as way of debugging. But fair enough, if the timeout is long enough, it can stay as well |
I'm happy with keeping the timeout. I'm not particularly familiar with |
Fix for the problem reported in #501