mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 15:16:41 +00:00
Merge pull request #1247 from tahoe-lafs/3960-misleading-ENOSPC-on-Windows
Attempt to workaround for failing Windows builds Fixes ticket:3960
This commit is contained in:
commit
d3a40b8430
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@ -86,8 +86,20 @@ jobs:
|
|||||||
run: python misc/build_helpers/show-tool-versions.py
|
run: python misc/build_helpers/show-tool-versions.py
|
||||||
|
|
||||||
- name: Run tox for corresponding Python version
|
- name: Run tox for corresponding Python version
|
||||||
|
if: ${{ !contains(matrix.os, 'windows') }}
|
||||||
run: python -m tox
|
run: python -m tox
|
||||||
|
|
||||||
|
# On Windows, a non-blocking pipe might respond (when emulating Unix-y
|
||||||
|
# API) with ENOSPC to indicate buffer full. Trial doesn't handle this
|
||||||
|
# well, so it breaks test runs. To attempt to solve this, we pipe the
|
||||||
|
# output through passthrough.py that will hopefully be able to do the right
|
||||||
|
# thing by using Windows APIs.
|
||||||
|
- name: Run tox for corresponding Python version
|
||||||
|
if: ${{ contains(matrix.os, 'windows') }}
|
||||||
|
run: |
|
||||||
|
pip install twisted pywin32
|
||||||
|
python -m tox | python misc/windows-enospc/passthrough.py
|
||||||
|
|
||||||
- name: Upload eliot.log
|
- name: Upload eliot.log
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
36
misc/windows-enospc/passthrough.py
Normal file
36
misc/windows-enospc/passthrough.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
"""
|
||||||
|
Writing to non-blocking pipe can result in ENOSPC when using Unix APIs on
|
||||||
|
Windows. So, this program passes through data from stdin to stdout, using
|
||||||
|
Windows APIs instead of Unix-y APIs.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from twisted.internet.stdio import StandardIO
|
||||||
|
from twisted.internet import reactor
|
||||||
|
from twisted.internet.protocol import Protocol
|
||||||
|
from twisted.internet.interfaces import IHalfCloseableProtocol
|
||||||
|
from twisted.internet.error import ReactorNotRunning
|
||||||
|
from zope.interface import implementer
|
||||||
|
|
||||||
|
@implementer(IHalfCloseableProtocol)
|
||||||
|
class Passthrough(Protocol):
|
||||||
|
def readConnectionLost(self):
|
||||||
|
self.transport.loseConnection()
|
||||||
|
|
||||||
|
def writeConnectionLost(self):
|
||||||
|
try:
|
||||||
|
reactor.stop()
|
||||||
|
except ReactorNotRunning:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def dataReceived(self, data):
|
||||||
|
self.transport.write(data)
|
||||||
|
|
||||||
|
def connectionLost(self, reason):
|
||||||
|
try:
|
||||||
|
reactor.stop()
|
||||||
|
except ReactorNotRunning:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
std = StandardIO(Passthrough())
|
||||||
|
reactor.run()
|
0
newsfragments/3960.minor
Normal file
0
newsfragments/3960.minor
Normal file
Loading…
Reference in New Issue
Block a user