Skip to content

Commit 725815b

Browse files
Only specify error handler if one exists
Summary: Broke open source and some other tests because the error handler is defined in Buck2 repo, so not all toolchains would have an error handler defined. Will look at making error handler be able to take in a `None` but doing this for now to unbreak tests. Reviewed By: christolliday Differential Revision: D71658974 fbshipit-source-id: f29f17b883241a51c09cd89baaf0294683dea998
1 parent 0624204 commit 725815b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

prelude/python/make_py_package.bzl

+6-1
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ def _make_py_package_impl(
374374
# Inplace par should be built locally to avoid materialization cost
375375
prefer_local = (standalone and package_python_locally(ctx, python_toolchain)) or not standalone
376376

377+
# only specify error_handler if one exists
378+
error_handler_args = {}
379+
if python_toolchain.python_error_handler:
380+
error_handler_args["error_handler"] = python_toolchain.python_error_handler
381+
377382
cmd = cmd_args(
378383
make_py_package_cmd if make_py_package_cmd != None else python_toolchain.make_py_package_standalone,
379384
)
@@ -389,7 +394,7 @@ def _make_py_package_impl(
389394
category = "par",
390395
identifier = identifier_prefix.format(output_suffix),
391396
allow_cache_upload = allow_cache_upload,
392-
error_handler = python_toolchain.python_error_handler,
397+
**error_handler_args
393398
)
394399

395400
else:

prelude/python/source_db.bzl

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@ def create_dbg_source_db(
4848
args = dependencies,
4949
))
5050

51+
# only specify error_handler if one exists
52+
error_handler_args = {}
53+
if python_toolchain.python_error_handler:
54+
error_handler_args["error_handler"] = python_toolchain.python_error_handler
55+
5156
artifacts.append(dep_manifests.project_as_args("source_artifacts"))
52-
ctx.actions.run(cmd, category = "py_dbg_source_db", error_handler = python_toolchain.python_error_handler)
57+
ctx.actions.run(cmd, category = "py_dbg_source_db", **error_handler_args)
5358

5459
return DefaultInfo(default_output = output, other_outputs = artifacts)
5560

0 commit comments

Comments
 (0)