[Hackage] #720: Executables fail on windows if the executable name has a dot in it

#720: Executables fail on windows if the executable name has a dot in it ----------------------------+----------------------------------------------- Reporter: j3h | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.6.0.3 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: | ----------------------------+----------------------------------------------- If an executable name has a dot in it, it is not generated with an .exe extension on Windows. It works fine under Linux. See the attached example to reproduce. {{{ $ cabal --version cabal-install version 0.8.2 using version 1.8.0.6 of the Cabal library $ cabal install Resolving dependencies... Configuring bad-exe-0.1... Preprocessing executables for bad-exe-0.1... Building bad-exe-0.1... [1 of 1] Compiling Main ( Main.hs, dist\build\bad.name\bad .name-tmp\Main.o ) Main.hs:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. Linking dist\build\bad.name\bad.name ... Installing executable(s) in C:\Users\hudson\AppData\Roaming\cabal\bin cabal.exe: dist\build\bad.name\bad.name.exe: does not exist cabal.exe: Error: some packages failed to install: bad-exe-0.1 failed during the final install step. The exception was: ExitFailure 1 }}} -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/720 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#720: Executables fail on windows if the executable name has a dot in it ----------------------------+----------------------------------------------- Reporter: j3h | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: | ----------------------------+----------------------------------------------- Changes (by j3h): * version: 1.6.0.3 => -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/720#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#720: Executables fail on windows if the executable name has a dot in it ----------------------------+----------------------------------------------- Reporter: j3h | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: | ----------------------------+----------------------------------------------- Comment(by duncan): Currently the code does: {{{ -- exeNameReal, the name that GHC really uses (with .exe on Windows) let exeNameReal = exeName' <.> (if null $ takeExtension exeName' then exeExtension else "") }}} Where as I would expect it should be simply {{{ -- exeNameReal, the name that GHC really uses (with .exe on Windows) let exeNameReal = exeName' <.> exeExtension }}} since `p <.> "" = p`. It is not clear to me why the code is like it is now. The code was added by the patch {{{ Mon Aug 21 15:30:21 BST 2006 Neil Mitchell * Make -o use the filename as GHC will, i.e. with .exe on the end for Windows. This fixes a GHC 6.4.2 bug with relinking every time. }}} the code was {{{ -- exeNameReal, the name that GHC really uses (with .exe on Windows) let exeNameReal = exeName' `joinFileExt` (if null $ snd $ splitFileExt exeName' then exeExtension else "") }}} Previously it had relied on ghc adding the .exe extension. It is still not obvious why it is coded the way it is, if it's an oversight or something I'm missing. In principle the above allows people to make an executable that does not use the .exe extension. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/720#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage