blitzcode / hackage-diff Goto Github PK
View Code? Open in Web Editor NEWCompare the public API of different versions of a Hackage library
License: MIT License
Compare the public API of different versions of a Hackage library
License: MIT License
I discovered this package by accident because I named a similar tool I am working on hackage-diff.
The specific problem I was trying to solve with my tool is to be able to run a command in a project directory and figure out if what is in that directory is the same as the latest version of the package on hackage. If not, it means I probably need to upload a new version to hackage. I maintain a lot of packages, and often when a new version of text, etc, comes out I have to make mods to many, but not all of the packages. But, by the time I am done making the mods, building them in the continuous integration server, etc, I've long forgotten which packages I modified and need to upload. :)
Your tool seems to have a lot of extra, useful features that would be helpful for assigning a new version number, etc. But, it seems to require that you specify an exact version number for the package to compare against on hackage.
Do you think it is reasonable that we could merge our tools into a single unified tool?
I have uploaded my work in progress here:
$ hackage-diff transformers 0.4.3.0 0.5.0.0
Downloading / Reading Hoogle DBs...
Parsing Hoogle DBs...
Comparing Hoogle DBs...
--- Diff for | 0.4.3.0 hackage-diff: <stdout>: commitBuffer: invalid argument (invalid character)
It would be nice if you added your package to Hackage. Don't worry if you feel that it's still too immature: Hackage is a mother that loves both her old and young offsprings 👍.
I tested this change locally and things seem to work. Just using http://hackage.haskell.org/package/hackage-diff/maintain should do the trick, without needing a new release...
This is what I get when trying to compare Cabal 1.24.1.0 API with 1.24.0.0:
$ hackage-diff Cabal 1.24.0.0 1.24.1.0
Downloading / Reading Hoogle DBs...
Parsing Hoogle DBs...
endOfInput
Would be nice if the error was a bit more informative at least.
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
.
When trying to build hackage-diff
against haskell-src-exts
1.19.0 and 1.18.2, I get the following error:
Main.hs:593:42: error:
• Expecting one more argument to ‘Module’
Expected a type, but ‘Module’ has kind ‘* -> *’
• In the first argument of ‘Maybe’, namely ‘Module’
In the type ‘[(String, Maybe Module)]’
In the type declaration for ‘PackageModuleList’
It works with 1.17, though, so the upper bound in the released version on Hackage should be updated.
I'm currently seeing this when I try to install it.
Main.hs:32:1: error:
Could not find module ‘Distribution.PackageDescription.Parse’
Perhaps you meant
Distribution.PackageDescription.Parsec (from Cabal-2.4.0.1)
Distribution.PackageDescription.Check (from Cabal-2.4.0.1)
Distribution.PackageDescription.Quirks (from Cabal-2.4.0.1)
Use -v to see a list of the files searched for.
|
32 | import Distribution.PackageDescription.Parse
Nice tool! :-) It would be really nice if the tool could also suggest the next version, maybe even with a flag for selecting either PVP or SemVer?
On my Mac:
$ stack install hackage-diff --resolver lts-9.1
hackage-diff-0.1.0.1: configure
hackage-diff-0.1.0.1: build
-- While building package hackage-diff-0.1.0.1 using:
/Users/chen/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /Users/chen/.stack/global-project/.stack-work/logs/hackage-diff-0.1.0.1.log
Configuring hackage-diff-0.1.0.1...
Building hackage-diff-0.1.0.1...
Preprocessing executable 'hackage-diff' for hackage-diff-0.1.0.1...
[1 of 1] Compiling Main ( Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/hackage-diff/hackage-diff-tmp/Main.o )
/private/var/folders/xz/z3wrll111zn03hdhkd_pxs5w0000gp/T/stack87082/hackage-diff-0.1.0.1/Main.hs:593:42: error:
• Expecting one more argument to ‘Module’
Expected a type, but ‘Module’ has kind ‘* -> *’
• In the first argument of ‘Maybe’, namely ‘Module’
In the type ‘[(String, Maybe Module)]’
In the type declaration for ‘PackageModuleList’
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.