Changeset View
Changeset View
Standalone View
Standalone View
contrib/teamcity/build-configurations.py
Show First 20 Lines • Show All 363 Lines • ▼ Show 20 Lines | async def process_stdout(self, stdout): | ||||
self.print_line_to_logs(line) | self.print_line_to_logs(line) | ||||
except ValueError: | except ValueError: | ||||
self.print_line_to_logs( | self.print_line_to_logs( | ||||
"--- Line discarded due to StreamReader overflow ---" | "--- Line discarded due to StreamReader overflow ---" | ||||
) | ) | ||||
continue | continue | ||||
def run_process(self, bin, args=[]): | def run_process(self, binary, args=[]): | ||||
return asyncio.create_subprocess_exec( | return asyncio.create_subprocess_exec( | ||||
*([bin] + args), | *([binary] + args), | ||||
# Buffer limit is 64KB by default, but we need a larger buffer: | # Buffer limit is 64KB by default, but we need a larger buffer: | ||||
limit=1024 * 256, | limit=1024 * 256, | ||||
stdout=asyncio.subprocess.PIPE, | stdout=asyncio.subprocess.PIPE, | ||||
stderr=asyncio.subprocess.STDOUT, | stderr=asyncio.subprocess.STDOUT, | ||||
cwd=self.configuration.build_directory, | cwd=self.configuration.build_directory, | ||||
env={ | env={ | ||||
**os.environ, | **os.environ, | ||||
**self.configuration.environment_variables, | **self.configuration.environment_variables, | ||||
**self.configuration.get("env", {}), | **self.configuration.get("env", {}), | ||||
"ARTIFACT_DIR": str(self.artifact_dir), | "ARTIFACT_DIR": str(self.artifact_dir), | ||||
"CMAKE_FLAGS": " ".join(self.configuration.cmake_flags), | "CMAKE_FLAGS": " ".join(self.configuration.cmake_flags), | ||||
}, | }, | ||||
) | ) | ||||
async def run_build(self, bin, args=[]): | async def run_build(self, binary, args=[]): | ||||
proc = await self.run_process(bin, args) | proc = await self.run_process(binary, args) | ||||
await asyncio.wait([ | await asyncio.wait([ | ||||
self.process_stdout(proc.stdout) | self.process_stdout(proc.stdout) | ||||
]) | ]) | ||||
return await proc.wait() | return await proc.wait() | ||||
async def wait_for_build(self, timeout, args=[]): | async def wait_for_build(self, timeout, args=[]): | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |