ghc with -odir and -prof (or any stub file) does not create the specified output directory
|Reported by:||wmarshall||Owned by:||ezyang|
|Type of failure:||Compile-time crash||Test Case:|
|Related Tickets:||Differential Revisions:|
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.
Change History (8)
comment:1 Changed 18 months ago by wmarshall
- Summary changed from ghc with -odir and -prof cannot create the specified output directory to ghc with -odir and -prof does not create the specified output directory
comment:2 Changed 15 months ago by ezyang
- Owner set to ezyang
- Summary changed from ghc with -odir and -prof does not create the specified output directory to ghc with -odir and -prof (or any stub file) does not create the specified output directory
- Version changed from 7.6.3 to 7.9
comment:7 Changed 14 months ago by thoughtpolice
- Resolution set to fixed
- Status changed from merge to closed