hadrian icon indicating copy to clipboard operation
hadrian copied to clipboard

Custom build root does not work on Windows

Open snowleopard opened this issue 6 years ago • 2 comments

I've tried changing the build root on Windows like this:

$ ./build.stack.bat -j --flavour=quickest --integer-simple -c -o/d/test

and this:

$ ./build.stack.bat -j --flavour=quickest --integer-simple -c -oD:\test

But both fail with errors:

C:/msys/home/nam83/ghc/D:/test/stage0/utils/compare_sizes\: openBinaryTempFileWithDefaultPermissions: invalid argument (Invalid argument)

and

cp: cannot create directory ‘D:test/mingw’: No such file or directory

Clearly we are not handling paths correctly. I suspect we oversimplified our implementation of -/-:

https://github.com/snowleopard/hadrian/blob/master/src/Hadrian/Utilities.hs#L133-L140

There is already an issue about -/-: #434, but I'm not sure if it's necessarily a duplicate.

snowleopard avatar Aug 29 '18 21:08 snowleopard

Hmm. Isn't there an implementation of this somewhere, that we could just use or steal?

alpmestan avatar Sep 06 '18 21:09 alpmestan

@alpmestan Presumable </> does the right thing and we used to have a -/- b = unifyPath (a </> b) but that was very slow due to unifyPath, which we need, as otherwise Windows paths are a mess of slashes looking in random directions. We should clearly be able to do better, but noone has yet come up with a good plan.

snowleopard avatar Sep 06 '18 22:09 snowleopard