cabal-dev icon indicating copy to clipboard operation
cabal-dev copied to clipboard

Double path seaparators

Open nponeccop opened this issue 11 years ago • 4 comments

When doing cabal-dev install I get the following message:

Installing library in
C:\Users\foo\bar\cabal-dev//lib\profunctors-3.3.0.1/ghc-7.4.2

Same double forward slashes appear on Linux with GHC 7.6.3

nponeccop avatar Aug 20 '13 15:08 nponeccop

I have the same problem!

This is really annoying, since getDataFile "data/data.text" >>= readFile errors because of the superflous /:

$ cabal-dev/bin/test
eulerproject: /home/user/projects/haskell/teststuff/cabal-dev//share/teststuff-0.0.1.0/data/data.txt: openFile: does not exist (No such file or directory)
$ ls /home/user/projects/haskell/teststuff/cabal-dev//share/teststuff-0.0.1.0/data/
problem8.txt

Please note that ls finds the directory and list its contents regardless of the superflous slash!

This makes me wonder, if we should consider the superflous slash as a bug of cabal-dev or the wrong handling of the path as a bug of GHC?

NobbZ avatar Feb 25 '14 14:02 NobbZ

@NobbZ your ls listing shows a file "problem8.txt", but the error message states that the file that can't be found is "data.txt"; is it possible that the filesystem changed and that change wasn't propagated to the source that you're compiling? (or, possibly the binary wasn't fully recompiled?)

I haven't seen any issues with double path separators (at least using forward-slashes, back slashes are a different matter). That's not to say there isn't a problem here, though.

As an aside, we're recommending that people move away from cabal-dev, now that cabal-install supports sandboxes natively (in versions >= 1.18). Here's a blog post that describes how to use cabal-install sandboxes: http://coldwa.st/e/blog/2013-07-30-Cabal-sandbox.html

creswick avatar Feb 25 '14 22:02 creswick

That there is a file named problem8.txt is a matter of disguising the original code :) I just forgot to change it after copying.

But I'll take a look into the cabal-install sandbox then. Perhaps you should do a change to README and write your recommondation there in the first few lines.

NobbZ avatar Feb 25 '14 23:02 NobbZ

Good point re: README. I've added a note to the top.

creswick avatar Feb 25 '14 23:02 creswick