cobbpg / hp2any

Haskell space profiling toolset
http://www.haskell.org/haskellwiki/Hp2any
14 stars 15 forks source link

hp2any-graph fails on OS X because of canonicalizePath when `.hp` file is not already there at startup #4

Open Blaisorblade opened 10 years ago

Blaisorblade commented 10 years ago

When starting on program foo, hp2any-graph will call canonicalizePath on foo.hp.

As tracked by various bugs (e.g. https://ghc.haskell.org/trac/ghc/ticket/5014 and https://ghc.haskell.org/trac/ghc/ticket/4215), canonicalizePath fails on some platforms on non-existing files, and this is not going to get fixed so soon.

For a solution, see for instance this workaround in cabal: https://github.com/haskell/cabal/pull/1290/files#diff-e6e714c73e4b673ae0433a71cbb85a78L1

Update: more likely, you want in fact canonicalizePathNoThrow: https://github.com/haskell/cabal/blob/84a76809490f40765f73dddc6c2a2015678db57f/cabal-install/Distribution/Client/Utils.hs#L179

cobbpg commented 10 years ago

Thanks for the report, I’ll deal with this in the coming days.

cobbpg commented 10 years ago

I just made the relevant changes. Please tell me if the issue needs further work to fix!

Blaisorblade commented 10 years ago

Thanks! But 0.5.4.2 does not seem to help:

$ hp2any-graph -e $(which pts) -- --instance uu --quiet UU.lpts +RTS -hy
hp2any-graph: /Users/pgiarrusso/Documents/Research/Sorgenti/tsr-experiments/pts.hp: canonicalizePath: does not exist (No such file or directory)

I think the problem is here, which was not fixed by 88acbea9aeddb1ad0ee6b6ebdd2cac20b0477c39.