diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-18 11:49:28 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-18 11:52:03 +0100 |
commit | f040c38f0590fc8aaf3f2d6aa4a023872b7174d1 (patch) | |
tree | 52f7d52e7cf3c195a7aa3562ba12cb6edc584ae3 | |
parent | 7c084c2513d8028e2c1cd6a3a7b749caf2b3aa9f (diff) | |
download | poky-f040c38f0590fc8aaf3f2d6aa4a023872b7174d1.tar.gz |
bitbake: hashserv fixup
(Bitbake rev: b31de77665851fd1745ced8aa0abc26df7b4ea9a)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/hashserv/client.py | 8 | ||||
-rw-r--r-- | bitbake/lib/hashserv/server.py | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/bitbake/lib/hashserv/client.py b/bitbake/lib/hashserv/client.py index 4d3c35f00c..2559bbb3fb 100644 --- a/bitbake/lib/hashserv/client.py +++ b/bitbake/lib/hashserv/client.py | |||
@@ -40,7 +40,13 @@ class Client(object): | |||
40 | def connect_unix(self, path): | 40 | def connect_unix(self, path): |
41 | def connect_sock(): | 41 | def connect_sock(): |
42 | s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | 42 | s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) |
43 | s.connect(path) | 43 | # AF_UNIX has path length issues so chdir here to workaround |
44 | cwd = os.getcwd() | ||
45 | try: | ||
46 | os.chdir(os.path.dirname(path)) | ||
47 | s.connect(os.path.basename(path)) | ||
48 | finally: | ||
49 | os.chdir(cwd) | ||
44 | return s | 50 | return s |
45 | 51 | ||
46 | self._connect_sock = connect_sock | 52 | self._connect_sock = connect_sock |
diff --git a/bitbake/lib/hashserv/server.py b/bitbake/lib/hashserv/server.py index 0ffc83c13d..cddf8ebd1f 100644 --- a/bitbake/lib/hashserv/server.py +++ b/bitbake/lib/hashserv/server.py | |||
@@ -365,8 +365,11 @@ class Server(object): | |||
365 | def cleanup(): | 365 | def cleanup(): |
366 | os.unlink(path) | 366 | os.unlink(path) |
367 | 367 | ||
368 | # Work around path length limits in AF_UNIX | ||
369 | os.chdir(os.path.dirname(path)) | ||
370 | |||
368 | self.server = self.loop.run_until_complete( | 371 | self.server = self.loop.run_until_complete( |
369 | asyncio.start_unix_server(self.handle_client, path, loop=self.loop) | 372 | asyncio.start_unix_server(self.handle_client, os.path.basename(path), loop=self.loop) |
370 | ) | 373 | ) |
371 | logger.info('Listening on %r' % path) | 374 | logger.info('Listening on %r' % path) |
372 | 375 | ||