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

multiline Coq error matching? #55

Open
JasonGross opened this issue Apr 21, 2021 · 0 comments
Open

multiline Coq error matching? #55

JasonGross opened this issue Apr 21, 2021 · 0 comments
Labels

Comments

@JasonGross
Copy link
Member

I've been toying with a fancier way of doing problem matching by piping stderr through a script that aggregates Coq warnings and errors. In particular, it would use the following criterion to identify which chunks are warnings/errors:

  • The first line must match "^(?:-\\s+)?File \"([^ \"]+)\", line (\\d+), characters (\\d+-\\d+):"
  • The second line must match "^(?:-\\s+)?(Warning|Error):\\s*(.*?)
  • If the second line ends with something matching \\[([^]]*)\\], then the error is just a two-line error
  • The multiline error is considered to end at the first line ending with something matching \\[([^]]*)\\], unless a line matching one of the following is found first, in which case we assume that the matching has gone wrong and treat only the first two lines specially:
    • We encounter another line which matches the first-line pattern for errors/warnings
    • We encounter a line matching "^(?:-\\s+)?(COQC|OCAMLC|OCAMLOPT|COQDEP) .*" (new build file, presumably we missed the end of the error)
    • We encounter a line matching "^(?:-\\s+)?[^\\s]+ \\(real: [0-9\\.]*, user: [0-9\\.]*, sys: [0-9\\.]*, mem: [0-9]* ko)" (output of make TIMED=1, we probably missed the end of the warning/error)
    • We encounter a line matching "^(?:-\\s+)?make(?:\\[[0-9]+\\]):" (we ended up back in make output)

Would the docker coq action be interested in using such a script? (via something like 2> >(./process_coq_errors_to_annotations.sh >&2), or perhaps via { normal_cmd.sh 3>&1 1>&2 2>&3 3>&- | ./process_coq_errors_to_annotations.sh; } 3>&1 1>&2 2>&3 3>&- or similar, based on https://stackoverflow.com/a/3618308/377022 and the note at https://stackoverflow.com/questions/3618078/pipe-only-stderr-through-a-filter/52575213#comment105555334_52575087 that the system may kill the substituted process before it completes, once the main process exits)

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

No branches or pull requests

2 participants