diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2021-08-31 15:48:07 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-02 12:05:07 +0100 |
commit | 6901cdbe20783b82127d3c32ea0961651efe76b9 (patch) | |
tree | 0baf78a33a2c117e33ba7be1d309b1e9786fcd64 /bitbake/lib/codegen.py | |
parent | b978f7c3a028ff4cc61de79d296723b5f873651d (diff) | |
download | poky-6901cdbe20783b82127d3c32ea0961651efe76b9.tar.gz |
bitbake: prserv: make localhost work
After [1] introduced, the PR server doesn't work in docker when use
below setting like before.
PRSERV_HOST = "localhost:0"
And it's because the localhost is resolved to an ipv6 address ::1 as
the below bitbake-prserv shows.
bitbake$ bitbake-prserv --start --host=localhost --port=42005
bitbake$ cat prserv.log
Traceback (most recent call last):
File "/OE/nodistro/honister/bitbake/bin/bitbake-prserv", line 55, in <module>
ret = main()
File "/OE/nodistro/honister/bitbake/bin/bitbake-prserv", line 46, in main
ret=prserv.serv.start_daemon(options.dbfile, options.host, options.port,os.path.abspath(options.logfile), options.read_only)
File "/OE/nodistro/honister/bitbake/lib/prserv/serv.py", line 226, in start_daemon
run_as_daemon(daemon_main, pidfile, os.path.abspath(logfile))
File "/OE/nodistro/honister/bitbake/lib/prserv/serv.py", line 202, in run_as_daemon
func()
File "/OE/nodistro/honister/bitbake/lib/prserv/serv.py", line 224, in daemon_main
server.serve_forever()
File "/OE/nodistro/honister/bitbake/lib/bb/asyncrpc/serv.py", line 233, in serve_forever
self.start()
File "/OE/nodistro/honister/bitbake/lib/bb/asyncrpc/serv.py", line 144, in start_tcp
self.server = self.loop.run_until_complete(server_coro)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/usr/lib/python3.8/asyncio/streams.py", line 94, in start_server
return await loop.create_server(factory, host, port, **kwds)
File "/usr/lib/python3.8/asyncio/base_events.py", line 1463, in create_server
raise OSError(err.errno, 'error while attempting '
OSError: [Errno 99] error while attempting to bind on address ('::1', 42005, 0, 0): cannot assign requested address
So add the extra logic to make the localhost resolved as expected to
make the PR service work especially in docker.
[1] 6a2b23e2 prserv: Replace XML RPC with modern asyncrpc implementation
(Bitbake rev: 0a11696e0898c3c5108e6d7c5ad28da50e00ea66)
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/codegen.py')
0 files changed, 0 insertions, 0 deletions