Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Remove unused system inspection code
- Add a set of helper functions to await for tab loading and send javascript
v1.2.1
- Use custom threadpool for functions that could be running during shutdown:
Expand Down
7 changes: 1 addition & 6 deletions src/choreographer/browser_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from choreographer import protocol

from ._brokers import Broker
from .browsers import BrowserClosedError, BrowserDepsError, BrowserFailedError, Chromium
from .browsers import BrowserClosedError, BrowserFailedError, Chromium
from .channels import ChannelClosedError, Pipe
from .protocol.devtools_async import Session, Target
from .utils import TmpDirWarning, _manual_thread_pool
Expand Down Expand Up @@ -166,11 +166,6 @@ def run() -> subprocess.Popen[bytes] | subprocess.Popen[str]: # depends on args
await asyncio.sleep(0) # let watchdog start
await self.populate_targets()
except (BrowserClosedError, BrowserFailedError, asyncio.CancelledError) as e:
if (
hasattr(self._browser_impl, "missing_libs")
and self._browser_impl.missing_libs # type: ignore[reportAttributeAccessIssue]
):
raise BrowserDepsError from e
raise BrowserFailedError(
"The browser seemed to close immediately after starting.",
"You can set the `logging.Logger` level lower to see more output.",
Expand Down
1 change: 1 addition & 0 deletions src/choreographer/browsers/_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class BrowserFailedError(RuntimeError):
"""An error for when the browser fails to launch."""


# not currently used but keeping copy + not breaking API
class BrowserDepsError(BrowserFailedError):
"""An error for when the browser is closed because of missing libs."""

Expand Down
41 changes: 0 additions & 41 deletions src/choreographer/browsers/chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,46 +115,6 @@ def logger_parser(

return True

def _libs_ok(self) -> bool:
"""Return true if libs ok."""
if self.skip_local:
_logger.debug(
"If we HAVE to skip local.",
)
return True
_logger.debug("Checking for libs needed.")
if platform.system() != "Linux":
_logger.debug("We're not in linux, so no need for check.")
return True
p = None
try:
_logger.debug(f"Trying ldd {self.path}")
p = subprocess.run( # noqa: S603, validating run with variables
[ # noqa: S607 path is all we have
"ldd",
str(self.path),
],
capture_output=True,
timeout=5,
check=True,
)
except Exception as e: # noqa: BLE001
msg = "ldd failed."
stderr = p.stderr.decode() if p and p.stderr else None
# Log failure as INFO rather than WARNING so that it's hidden by default,
# since browser may succeed even if ldd fails
_logger.info(
msg # noqa: G003 + in log
+ f" e: {e}, stderr: {stderr}",
)
return False
if b"not found" in p.stdout:
msg = "Found deps missing in chrome"
_logger.debug2(msg + f" {p.stdout.decode()}")
return False
_logger.debug("No problems found with dependencies")
return True

def __init__(
self,
channel: ChannelInterface,
Expand Down Expand Up @@ -220,7 +180,6 @@ def pre_open(self) -> None:
path=self._tmp_dir_path,
sneak=self._is_isolated,
)
self.missing_libs = not self._libs_ok()
_logger.info(f"Temporary directory at: {self.tmp_dir.path}")

def is_isolated(self) -> bool:
Expand Down