async def _start_pyre_server(binary_location: str, pyre_arguments: start.Arguments) -> Union[(StartSuccess, BuckStartFailure, OtherStartFailure)]:
    try:
        with backend_arguments.temporary_argument_file(pyre_arguments) as argument_file_path:
            server_environment = {**os.environ, 'TMPDIR': tempfile.gettempdir()}
            with start.background_server_log_file(Path(pyre_arguments.base_arguments.log_path)) as server_stderr:
                server_process = (await asyncio.create_subprocess_exec(binary_location, 'newserver', str(argument_file_path), stdout=subprocess.PIPE, stderr=server_stderr, env=server_environment, start_new_session=True))
            server_stdout = server_process.stdout
            if (server_stdout is None):
                raise RuntimeError('asyncio.create_subprocess_exec failed to set up a pipe for server stdout')
            (await server_event.Waiter(wait_on_initialization=True).async_wait_on(connection.TextReader(connection.StreamBytesReader(server_stdout))))
        return StartSuccess()
    except server_event.ServerStartException as error:
        message = str(error)
        LOG.error(message)
        if (error.kind == server_event.ErrorKind.BUCK_USER):
            return BuckStartFailure(message)
        else:
            return OtherStartFailure(message=message, detail=message)
    except Exception as error:
        message = str(error)
        detail = traceback.format_exc()
        LOG.error(f'{detail}')
        return OtherStartFailure(message=message, detail=detail)
async def _start_pyre_server(binary_location: str, pyre_arguments: start.Arguments) -> Union[(StartSuccess, BuckStartFailure, OtherStartFailure)]:
    try:
        with backend_arguments.temporary_argument_file(pyre_arguments) as argument_file_path:
            server_environment = {**os.environ, 'TMPDIR': tempfile.gettempdir()}
            with start.background_server_log_file(Path(pyre_arguments.base_arguments.log_path)) as server_stderr:
                server_process = (await asyncio.create_subprocess_exec(binary_location, 'newserver', str(argument_file_path), stdout=subprocess.PIPE, stderr=server_stderr, env=server_environment, start_new_session=True))
            server_stdout = server_process.stdout
            if (server_stdout is None):
                raise RuntimeError('asyncio.create_subprocess_exec failed to set up a pipe for server stdout')
            (await server_event.Waiter(wait_on_initialization=True).async_wait_on(connection.TextReader(connection.StreamBytesReader(server_stdout))))
        return StartSuccess()
    except server_event.ServerStartException as error:
        message = str(error)
        LOG.error(message)
        if (error.kind == server_event.ErrorKind.BUCK_USER):
            return BuckStartFailure(message)
        else:
            return OtherStartFailure(message=message, detail=message)
    except Exception as error:
        message = str(error)
        detail = traceback.format_exc()
        LOG.error(f'{detail}')
        return OtherStartFailure(message=message, detail=detail)