Skip to content

Commit

Permalink
Add logging before running subprocess commands
Browse files Browse the repository at this point in the history
Reviewed By: grievejia

Differential Revision: D63661313

fbshipit-source-id: 3cd877fde22fa7d3d07ae063b69d46259674f05e
  • Loading branch information
connernilsen authored and facebook-github-bot committed Oct 3, 2024
1 parent 92c7010 commit ed7d7a1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/commands/pyre_language_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class PythonAutoTargetsMetadata:
@functools.lru_cache(maxsize=1)
def get_buck_root() -> str:
buck_root_query_parameters = ["buck2", "root", "--kind", "project"]
LOG.debug(f"Getting Buck root: `{' '.join(buck_root_query_parameters)}`")
buck2_root_query = subprocess.run(
buck_root_query_parameters,
capture_output=True,
Expand Down Expand Up @@ -731,6 +732,9 @@ async def _query_buck_for_type_errors(
"prelude//python/typecheck/batch_files.bxl:run",
f"@{argfile.name}",
]
LOG.debug(
f"Querying Buck for type errors: `{' '.join(type_check_parameters)}`"
)
type_check = await asyncio.create_subprocess_exec(
*type_check_parameters,
stdout=asyncio.subprocess.PIPE,
Expand Down Expand Up @@ -869,6 +873,9 @@ async def _get_files_for_type_checker(
"prelude//python/sourcedb/typing_query.bxl:typing_query",
f"@{argfile.name}",
]
LOG.debug(
f"Getting files for type checker from Buck: `{' '.join(query_parameters)}`"
)
type_checked_files_query = asyncio.create_subprocess_exec(
*query_parameters,
stdout=asyncio.subprocess.PIPE,
Expand Down Expand Up @@ -1068,13 +1075,14 @@ async def _run_python_auto_targets(
)

pyautodeps_parameters = [
pyautotargets_bin,
str(pyautotargets_bin),
"--verbose",
"--buck-root",
buck2_root,
"--isolation-dir=.pyautotargets",
str(changed_file),
]
LOG.debug(f"Running Pyautotargets: `{' '.join(pyautodeps_parameters)}`")
pyautodeps_run = await asyncio.create_subprocess_exec(
*pyautodeps_parameters,
stdout=asyncio.subprocess.PIPE,
Expand Down

0 comments on commit ed7d7a1

Please sign in to comment.