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

Add --fail-fast support to jvm compile #7284

Closed
baroquebobcat opened this issue Feb 25, 2019 · 7 comments
Closed

Add --fail-fast support to jvm compile #7284

baroquebobcat opened this issue Feb 25, 2019 · 7 comments

Comments

@baroquebobcat
Copy link
Contributor

Currently, jvm compile will attempt to build the full closure provided to it. If a target fails, all of its dependees are canceled, but any other parts of the graph are still compiled.

It would be nice to be able to have pants stop early on failures. Without this it can be frustrating if the failed compile happened relatively early in the compile because its error output is far from the end of the run output.

One approach would be to add a flag to the ExecutionGraph that causes it to exit the scheduler loop on any failure.

The place where failure is handled is:

https://github.com/pantsbuild/pants/blob/8cade53/src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py#L324-L335

@stuhood
Copy link
Member

stuhood commented Feb 26, 2019

I'm not sure that we would want to turn --fail-fast on by default for compiles... in which context are you envisioning this being useful?

@stuhood
Copy link
Member

stuhood commented Feb 26, 2019

Related: #6829. The v2 engine currently fails fast, but it's unclear which cases that is desirable in.

@baroquebobcat
Copy link
Contributor Author

In large graphs, failures that happen early get buried in the output, and aren't surfaced until a lot of other things happen.

I think this actually is two things.

  1. it's hard to find errors in large cli output.
  2. large graphs will have failures early, but continue to compile, possibly for minutes, which I find to be kinda frustrating.

Locally, when I'm actively iterating on something, stopping compiles at the first failure would be handy because it becomes actionable more quickly. Also, we have --fail-fast for tests, and the cases where I've used that have made me want it for compile.

I don't think it should be the default, but it would sure be handy.

@stuhood
Copy link
Member

stuhood commented Feb 27, 2019

Locally, when I'm actively iterating on something, stopping compiles at the first failure would be handy because it becomes actionable more quickly.

It doesn't become actionable more quickly, does it? You can fix the error immediately and stop/restart if you'd like...

@baroquebobcat
Copy link
Contributor Author

well usually when I'm compiling a large graph, the error goes by rather quickly, so I have to

  1. be watching the compile as it happens
  2. be ready to Control+C in case I see a failure
    Then after I see one,
  3. hit Control+C
  4. scroll back to the error (usually I use the text search for [error])

In contrast, if fail fast existed, I could set a flag and compile would fail precisely when the first failure is hit. I have my terminal setup to notify me with a notification and a sound when a run fails, so I'll be immediately pinged when it happens and the first thing visible in the terminal would be the last compile error.

@stuhood
Copy link
Member

stuhood commented Feb 27, 2019

That will only be the case on the first build though, since all future builds should immediately fail with only the unbuildable things.

@baroquebobcat
Copy link
Contributor Author

yes, but I find the build once, then build again to have more scan-able error output to be frustrating and I think it could be better.

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

3 participants