[GHC] #8641: ghc with -odir and -prof cannot create the specified output directory

GHC ghc-devs at haskell.org
Mon Dec 30 21:01:37 UTC 2013


#8641: ghc with -odir and -prof cannot create the specified output directory
-----------------------------------+---------------------------------------
       Reporter:  wmarshall        |             Owner:
           Type:  bug              |            Status:  new
       Priority:  normal           |         Milestone:
      Component:  Compiler         |           Version:  7.6.3
       Keywords:                   |  Operating System:  Unknown/Multiple
   Architecture:                   |   Type of failure:  Compile-time crash
  Unknown/Multiple                 |         Test Case:
     Difficulty:  Unknown          |          Blocking:
     Blocked By:                   |
Related Tickets:                   |
-----------------------------------+---------------------------------------
 Calling ghc with -odir set to a non-existent directory causes ghc to
 create the directory.  However, if the -prof option is also specified, ghc
 fails to create the directory and quits with an error.

 Steps to reproduce:
 {{{
 $ echo 'main = print "Hello world"' > Main.hs

 $ ghc Main.hs -odir bin
 [1 of 1] Compiling Main             ( Main.hs, bin\Main.o )
 Linking Main.exe ...

 $ rm -Rvf bin
 removed `bin/Main.o'
 removed directory: `bin'

 $ ghc Main.hs -odir bin -prof
 [1 of 1] Compiling Main             ( Main.hs, bin\Main.o )
 C:/Program Files (x86)/Haskell Platform/2013.2.0.0/mingw/bin/ld.exe:
 cannot open output file bin\Main.o: No such file or directory
 collect2: ld returned 1 exit status
 }}}

 Expected result:  The output directory is created regardless of whether
 -prof is specified.

 The above commands were executed from within Cygwin, but the error occurs
 in the Windows command shell as well.  (I used Cygwin here because it is
 easier to give precise instructions to reproduce the error.)

 I have only tested this on Windows.  I do not know if the issue exists on
 Linux or other platforms.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8641>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list