Test project on Windows with MINGW git (conda2.7&3.4/cpy-3.5)#519
Test project on Windows with MINGW git (conda2.7&3.4/cpy-3.5)#519Byron merged 42 commits intogitpython-developers:masterfrom
Conversation
|
@ankostis Totally awesome ! Even though I won't be of much help, I do hope that fixing the windows issues work out in the end. That would restore windows platform support and keep it, after all these years of supporting it just on a best-effort basis, which meant not to obviously use non-windows APIs. |
1774f98 to
d773d40
Compare
+ Del extra spaces, import os.path as osp
|
Yes, that's a start. |
5899c59 to
d12fdca
Compare
|
@Byron the |
+ Pump once, so when input larger than `mmap.PAGESIZE`, stream is not emptied.
+ Pump once, so when input larger than `mmap.PAGESIZE`, stream is not emptied.
+ Pump once, so when input larger than `mmap.PAGESIZE`, stream is not emptied.
+ Pump code reads only once streams per `_read_lines_from_fno()` invocation, so when input larger than `mmap.PAGESIZE`, bytes are forgotten in the stream.
+ The code in `_read_lines_from_fno()` was reading the stream only once per invocation, so when input was larger than `mmap.PAGESIZE`, bytes were forgotten in the stream. + Also set deamon-threads.
+ The code in `_read_lines_from_fno()` was reading the stream only once per invocation, so when input was larger than `mmap.PAGESIZE`, bytes were forgotten in the stream. + Replaced buffer-banging code with iterate-on-file-descriptors. + Also set deamon-threads.
+ The code in `_read_lines_from_fno()` was reading the stream only once per invocation, so when input was larger than `mmap.PAGESIZE`, bytes were forgotten in the stream. + Replaced buffer-building code with iterate-on-file-descriptors. + Also set deamon-threads.
|
@Byron that was a tough one! I replaced the buffer-assembly code with iterate-on-file-descriptors. Actually the code is so simple that it maybe worth to replace the select-poll with the 2-pumps code, for all OSs? Many A side question:
Is that possible? I would expect any language allowing such "gap" to be considered outright broken. |
…`assertRaisesRegexp`
…`assertRaisesRegexp`
+ Extract util-method to delete lock-files, also on Windows (will be needed by TCs).
+ Modify lock/read-config-file code to ensure files closed. + Use `with GitConfigarser()` more systematically in TCs. + Clear any locks left hanging from prev Tcs. + Util: mark lock-files as SHORT_LIVED; save some SSDs...
|
@ankostis Incredible work you are doing here ! Me not replying most of the time is merely an indication of me not touching the keyboard after work, so replies have to wait for the weekend. That said, I will try to address as much as possible, and in case I forget anything, please feel free to point me to it one more time.
I believe that is just me being paranoid, and considering that the internet doesn't know this issue, it probably just doesn't exist. Maybe you could delete that comment, while you are at it.
Without having had a look at the code, I may state that it must be possible to fetch data from stdout and stderr concurrently, if both channels are open. Otherwise you might see that blocking behaviour, which has bitten me in the past. If that would indeed be the case, I'd be fine with it. However, the only ways I could think of either was select/poll or threading.
Yes, please go ahead ! Everything that makes the code more idiomatic is appreciated !
Thanks for figuring this out ! As always, much appreciated :) !
Referring back to the select/poll vs Threading argument I made: Considering the added maintenance effort for having two versions of that, along with the relative rarity of doing a pull/push in the average use case, one might indeed choose to prefer using the threaded pumps instead. I will trust your expertise entirely with this one, so please feel free to remove the alternative code-path as you see fit. @ankostis You have been relentlessly working on getting this fixed, and I hope to soon have it all green on AppVeyor. It will hardly be possible to give you all the credit you deserve, but if you are interested, I would gladly make you a contributor. This could also include becoming a maintainer on Pypi to allow you pushing builds yourself. Just let me know, and I will make it happen. |
|
Thank you for your offer to become contributor, I'm honored. Unfortunately I cannot promise that I will be contributing to the project in the future; usually we are always late for deadlines :-( Regarding the thread-pump, the situation is not satisfying, both alternatives (threading, select/poll) suffer from a race condition if the python code is not absorbing data fast enough from all pipes. Threading is not enough because of how But that can wait. |
|
That's good enough ! I'd be happy already if you can have an eye out on the windows side of things, as you seem to have larger stakes in it than most others. PS: You have been invited to become a contributor/maintainer. |
+ FIX TestRepo.test_submodule_update(): + submod: del `.git` file prior overwrite; Windows denied otherwise! + FIX TestRepo.test_untracked_files(): + In the `git add <file>` case, it failed with unicode args on PY2. Had to encode them with `locale.getpreferredencoding()` AND use SHELL. + cmd: add `shell` into `execute()` kwds, for overriding USE_SHELL per command. + repo: replace blocky `communicate()` in `_clone()` with thread-pumps. + test_repo.py: unittestize (almost all) assertions. + Replace open --> with open for index (base and TC). + test_index.py: Enabled a dormant assertion.
|
Reporting progress so far; strangely, almost all of the problems fixed below did not appear in Appveyor:
Generic changes
Apveyor results
Site RegressionUnfortunately, building site started to fail on Travis - but has nothing to do with my changes. |
|
Here is a patch that resolves the merge conflict. In case you didn't fix it already, please feel free to apply it. Details |
|
@ankostis By the way, what do you think about an intermediate merge ? You could start out freshly on a new PR then for the last meters, while greatly reducing the risk of merge-conflicts. |
|
Merged it. @Byron practically there are 3 error remaining, and I believe all 3 of them are related to gitdb:
Can you provide any hint on how to resolve them? |
+ Some cases had restructuring of code.
|
@ankostis I agree, the errors you mention seem to be rooted in smmap and would thus have to be fixed there. Especially the one with the incompatible type appears like something that is relatively easy reproduce and fix via smmap. A hint I have not right now, just because it was years ago that I have touched the project for the last time. However, I could believe it is riddled with resource-related issues as I was banking on deterministic destructors back then. For now I will just merge the PR and try to setup the appveyor hooks. Maybe as a contributor, you can even do that yourself in case it doesn't work for me. |
|
Just pushed one last commit with those 3 TCs appropriately skipped.
Actually quite the contrary: I can only reproduce it when i run the full harness; if i launch these 2 TCs alone, they pass! So practically, I cannot enter debug-mode - I have to wait 2' just to reach this point.
Have not received an invitation yet. |
|
I have just re-invited you, maybe it comes through. Otherwise you would just have to visit https://github.com/gitpython-developers to see the invitation. Your last commit was not part of my merge, I will fetch it separately. |
|
@ankostis I think it worked ! The last commit has been cherry-picked and AppVeyor is on its way to all-green ! Even though it's not the real thing just yet, I call it an impressive piece of work! Thanks so much ! Right now I wouldn't know how to tackle the smmap issue, just as it's hard to fix anything in a project that is installed as a dependency. Probably it would be easiest if it would be reproducible locally, which I can't even do. |
|
@Byron many of the fixes in this PR can be applied also on gitdb, and as you said (haven't checked) on smmp. Is there a chance to tackle these issues in these projects? Or are they "frozen" somehow? I mean, a lot of problems just go away if resource classes are retrofitted as What do you think, is it worth the effort (but cna't promise anything)? |
|
For reference, reporting the CORRECT Appveyor results after #521 fixes by yarikoptic & ankostis restored skipped TCs: PY27: 5 errors: |
|
@ankostis With the latest upgrade of gitdb and smmap to 2.0, it's finally possible again to make new releases. This would allow the changes you talk about to be retro-fitted indeed, and given all the subtle problems GitPython has, it would certainly be worth doing that. |

poll/selectbuffer-assembly code with pump-threads (Win TCs faling 90-->20!) and rework unicode handling in many places.Popen()procs it withsubprocess.CREATE_NEW_PROCESS_GROUPso that they can be killed.git-daemon(instead ofgit daemon); otherwise it detaches (unix-ism here) from parent git cmd, and then CANNOT DIE!Popen().proc.stdout/stderrfrom the launching-thread, it freezes due to GIL/buffering.+Rework GitCommandError.str() and add TCs on unicode handling.
with GitConfigarser()more systematically in TCs..gitfile prior overwrite; Windows denied otherwise!git add <file>case, PY2 fails when args are unicode.Must encode them with
locale.getpreferredencoding()AND use SHELL.shellintoexecute()kwds, for overriding USE_SHELL percommand.
communicate()in_clone()with thread-pumps (UNNECESSARY, see this later discussion).with...construct (not complete).Popen()calls, to collect cmd usage.Apveyor results