Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot see debug print statements in rules when executing bazel run @{external}:{target} #3920

Closed
EricCousineau-TRI opened this issue Oct 18, 2017 · 2 comments

Comments

@EricCousineau-TRI
Copy link
Contributor

EricCousineau-TRI commented Oct 18, 2017

Description of the problem:

I am attempting to debug some install rules in an external, and ran into an issue where I was not seeing print(...) statements.

I was able to see the print(...) statements when running a rule that is not prefixed with @.

Workaround: See temporary debug statements using fail(...).

If possible, provide a minimal example to reproduce the problem:

I encountered it in drake (source tree of my fork), when attempting to debug installation of an external library while following a workaround of #492.

Steps:

  • Wanted to debug an executable rule implementation: bazel run @fmt//:install -- ~+/build_install
  • Added debug statements in //tools:install.bzl for things like dir(target.cc) to inspect available fields
  • Executed command, got a syntax error, but no debug statement.
  • Fixed syntax error, but still no output.
  • Add fail(...) statement, and could see the output.

I could see output previously when running something like bazel run //:install -- ~+/build_install

Environment info

  • Operating System: Ubuntu 16.04.2

  • Bazel version (output of bazel info release): release 0.6.1

Have you found anything relevant by searching the web?

Nope, searching in these issues and on the web didn't turn anything up.

@jwnimmer-tri
Copy link
Contributor

@EricCousineau-TRI
Copy link
Contributor Author

Ah, that makes sense! Thank you for pointing that out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants