Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Matcher doesn't work to annotate on multi-package projects #131

Open
parsonsmatt opened this issue Dec 3, 2022 · 2 comments
Open

Matcher doesn't work to annotate on multi-package projects #131

parsonsmatt opened this issue Dec 3, 2022 · 2 comments
Labels
re: matcher Concerning matching GHC errors/warnings to GHA output

Comments

@parsonsmatt
Copy link

Consider this CI run. We've got a ton of warning annotations in the log, but none of them show up in the code.

Which makes sense as the file path in the matcher wouldn't include the package path!

{
  "problemMatcher": [
    {
      "owner": "haskell",
      "pattern": [
        {
          "regexp": "^(.+\\.hs):(\\d+):(\\d+): (\\w+):",
          "file": 1,
          "line": 2,
          "column": 3,
          "severity": 4
        },
        {
          "regexp": "^    (.*)$",
          "message": 1
        }
      ]
    }
  ]
}

Not sure if there's a good way to solve that 🤔

@andreasabel
Copy link
Member

@parsonsmatt : Thanks for your report!
Unfortunately, I understand nothing, I think the report misses some context.

  • Which action do you report on? setup, hlint-setup, hlint-run?
  • In what sense does your problem relate to the components of this repo?
  • You pasted some code here. Where is that taken from? (permalink to repo file)
  • Note that GitHub will not retain CI logs forever (I think no more than 3 months), so it makes sense to paste relevant excerpts into your report.

@parsonsmatt
Copy link
Author

The problem is that the repository does cabal build all to build each individual package. The regular expression captures the file name relative to the package's .cabal file.

Suppose there's a warning or error in persistent/src/Database/Persist.hs. The directory structure looks like this:

# persistent repo structure
persistent/
. . . . persistent.cabal
. . . . src/Database/Persist.hs

GHC will output a message for src/Database/Persist.hs, which this matcher will work for. However, that's not where the file is - it's in persistent/src/Database/Persist.hs. So the matcher can't properly annotate the file, because there's a prefix that it is unaware of.

@andreasabel andreasabel added the re: matcher Concerning matching GHC errors/warnings to GHA output label Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
re: matcher Concerning matching GHC errors/warnings to GHA output
Projects
None yet
Development

No branches or pull requests

2 participants