Skip to content

Commit

Permalink
Merge pull request #12 from regro/dep-more-exc
Browse files Browse the repository at this point in the history
ENH print more info when things fail
  • Loading branch information
beckermr authored Aug 13, 2023
2 parents b1824b7 + fa21a45 commit 27a1f71
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions conda_forge_feedstock_check_solvable/mamba_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"""
import rapidjson as json
import os
import traceback
import io
import glob
import functools
import pathlib
Expand Down Expand Up @@ -43,6 +45,7 @@
get_artifact_info_as_json,
)


PACKAGE_CACHE = api.MultiPackageCache(pkgs_dirs)

DEFAULT_RUN_EXPORTS = {
Expand Down Expand Up @@ -131,6 +134,8 @@ def suppress_conda_build_logging():
else:
suppress = True

outerr = io.StringIO()

if not suppress:
try:
yield None
Expand Down Expand Up @@ -160,8 +165,13 @@ def suppress_conda_build_logging():
""")
conda_build.conda_interface.cc_conda_build["log_config_file"] = config_file

with wurlitzer.pipes():
with wurlitzer.pipes(stdout=outerr, stderr=wurlitzer.STDOUT):
yield None

except Exception as e:
print("EXCEPTION: captured C-level I/O: %r" % outerr.getvalue(), flush=True)
traceback.print_exc()
raise e
finally:
if old_val is not None:
conda_build.conda_interface.cc_conda_build["log_config_file"] = old_val
Expand Down Expand Up @@ -516,6 +526,7 @@ def solve(
run_exports = copy.deepcopy(DEFAULT_RUN_EXPORTS)
else:
t = api.Transaction(
self.pool,
solver,
PACKAGE_CACHE,
)
Expand Down Expand Up @@ -955,11 +966,11 @@ def _is_recipe_solvable_on_platform(
recipe_dir,
config=config,
)
except Exception:
except Exception as e:
if att == 0:
pass
else:
raise
raise e

# now we render the meta.yaml into an actual recipe
metas = conda_build.api.render(
Expand Down

0 comments on commit 27a1f71

Please sign in to comment.