[Hackage] #256: Copying files during installation is oblivious to ~

#256: Copying files during installation is oblivious to ~ ----------------------------------+----------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Keywords: Difficulty: very easy (<1 hour) | Ghcversion: 6.8.2 Platform: | ----------------------------------+----------------------------------------- I tried to install a cabal package into my home directory using {{{--prefix=~/local}}}. Cabal does not expand this to my home directory. This is very confusing, as all the files wind up in a directory called ~. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by igloo): I think that Cabal is doing the right thing here. If your shell doesn't expand ~ there, then Cabal shouldn't either. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by guest): Ok, I guess that's fair. But maybe it should warn? It's never a sensible thing to create a directory that starts with ~. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by kolmodin): You could either write {{{ --prefix ~/local }}} or {{{ --prefix=$HOME/local }}} I've not seen any other application warn about this as it is standard behavior. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Any consensus? Do we make the change or close the bug as wontfix? -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by guest): Well, autoconf would not let me down like that, since it uses a the install.sh program which passes the path verbatim to the shell. I have little experience with any other installation tools. Hence this behaviour was new to me. For me, the 'standard behaviour' is that ~ is expanded to my home directory. Close it if you disagree that not expanding ~ is standard behaviour. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:5 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Ah, so `./configure --prefix=~/local` does not get expanded when `./configure` is called but it gets expanded when the `install-sh` program is called later. That's rather subtle. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:6 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by ross@soi.city.ac.uk): On my system autoconf 2.61 objects that the argument doesn't start with a slash: {{{ % ./configure --prefix=~/local configure: error: expected an absolute directory name for --prefix: ~/local }}} That's not appropriate on Windows, of course. The standard behaviour is that ~ (like ? and *) is expanded when trying to match a whole shell argument against file names. In other positions, one uses $HOME, as Ian suggested. I'm against expanding or warning. If we fill the code with heuristic tests, it will be unmanageable. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:7 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): We could do the same as autoconf and check that the prefix is absolute. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:8 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by guest): It seems that you've just checked what configure does. So yes, it does complain: {{{ ./configure --prefix=~/local configure: error: expected an absolute directory name for --prefix: ~/local }}} Hence, an error would be appropriate. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:9 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by guest): Ups, I didn't see the comment by Ross. I'd like to see an error message. I don't understand why Ross says that it's not appropriate on Windows. There is a function System.FilePath.isAbsolute which would prevent a user from specifying anything that doesn't start with a drive letter. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:10 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Comment (by ross@soi.city.ac.uk): Replying to [comment:10 guest]:
I'd like to see an error message. I don't understand why Ross says that it's not appropriate on Windows. There is a function System.FilePath.isAbsolute which would prevent a user from specifying anything that doesn't start with a drive letter.
I was thinking of the simple slash test; certainly isAbsolute would be a portable solution. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:11 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#256: Copying files during installation is oblivious to ~ ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: closed Priority: low | Milestone: Component: Cabal library | Version: 1.2.3.0 Severity: normal | Resolution: fixed Keywords: | Difficulty: very easy (<1 hour) Ghcversion: 6.8.2 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * status: new => closed * resolution: => fixed Comment: Fixed: {{{ $ cabal configure --prefix=~foobar Configuring Foo-1.0... cabal: expected an absolute directory name for --prefix: ~foobar }}} -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/256#comment:12 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage