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

Parsehs mode doesn't use the right locations #10

Open
mightybyte opened this issue Aug 14, 2017 · 5 comments
Open

Parsehs mode doesn't use the right locations #10

mightybyte opened this issue Aug 14, 2017 · 5 comments

Comments

@mightybyte
Copy link
Contributor

When running hackage-diff --mode=parsehs xmlhtml 0.2.2 0.2.4 I get the following output:

Downloading xmlhtml-0.2.2...
Downloading xmlhtml-0.2.4...
Processing /var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.2...
  Parsing Text.XmlHtml
    Can't open source file '/var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.2/Text/XmlHtml.hs'
  Parsing Text.XmlHtml.Cursor
    Can't open source file '/var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.2/Text/XmlHtml/Cursor.hs'
  Parsing Text.XmlHtml.HTML.Meta
    Can't open source file '/var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.2/Text/XmlHtml/HTML/Meta.hs'
  Parsing Text.Blaze.Renderer.XmlHtml
    Can't open source file '/var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.2/Text/Blaze/Renderer/XmlHtml.hs'
Processing /var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.4...
  Parsing Text.XmlHtml
    Can't open source file '/var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.4/Text/XmlHtml.hs'
  Parsing Text.XmlHtml.Cursor
    Can't open source file '/var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.4/Text/XmlHtml/Cursor.hs'
  Parsing Text.XmlHtml.HTML.Meta
    Can't open source file '/var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.4/Text/XmlHtml/HTML/Meta.hs'
  Parsing Text.Blaze.Renderer.XmlHtml
    Can't open source file '/var/folders/yw/4lyc2l_n51z601wqjnyc9vvr0000gn/T/hackage-diff/xmlhtml-0.2.4/Text/Blaze/Renderer/XmlHtml.hs'

--- Diff for | 0.2.2 → 0.2.4 | ---

It looks like it's looking for Text/XmlHtml.hs but it should be looking for src/Text/XmlHtml.hs.

@blitzcode
Copy link
Owner

The parsehs mode is basically only there for historical reasons. It was the first attempt at solving this problem. Parsing Haskell out of context doesn't work well due to the pre-processor and language extensions. The Hoogle based modes are more useful. Probably not worth fixing this mode, I'd rather remove it.

@mightybyte
Copy link
Contributor Author

Hmmm yeah, I definitely understand that. However, my main use case for this tool is comparing my current code to what is released on hackage to check whether I need to do a major or minor version bump. To do this you have to use parsehs mode.

@blitzcode
Copy link
Owner

Yes, I added the message to tell you if breaking changes were detected because people told me they like that feature. Of course, for your own code you can of course chose not to use the CPP and don't put language options in the .cabal etc. and the Haskell parser might do am OK job then. For local packages you could always use builddb or specify a Hoogle DB you build yourself.

@mightybyte
Copy link
Contributor Author

I tried using builddb locally but it didn't work.

$ hackage-diff --mode=builddb xmlhtml 0.2.4 ~/haskell/xmlhtml/
'/Users/mightybyte/haskell/xmlhtml/' is not a valid version string (1.0[.0[.0]]) or database path

@blitzcode
Copy link
Owner

My memory is real hazy here, but that might be one of the cases not covered. I think I added the builddb thing initially because Hackage had a problem and Hoogle DBs were missing. You might need to build the Hoogle DB yourself for the local package and specify its path.

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