snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 39 forks source link

Windows failure: copyFile: invalid argument #562

Closed snowleopard closed 6 years ago

snowleopard commented 6 years ago

After #561, we can start building GHC on Windows (both on AppVeyor and on my machine), but we quickly hit the following error:

| Run GhcPkg Dependencies Stage0: integer-gmp
C:/Users/nam83/AppData/Local/Programs/stack/x86_64-windows/ghc-8.2.2/bin/ghc-pkg.exe --no-user-package-db field integer-gmp depends
| Run GhcPkg Dependencies Stage0: base
C:/Users/nam83/AppData/Local/Programs/stack/x86_64-windows/ghc-8.2.2/bin/ghc-pkg.exe --no-user-package-db field base depends
| KeyValues oracle: reading '_build/stage0/libraries/ghc-boot-th/.dependencies'...
| Run GhcPkg Dependencies Stage0: array
| Run GhcPkg Dependencies Stage0: filepath
C:/Users/nam83/AppData/Local/Programs/stack/x86_64-windows/ghc-8.2.2/bin/ghc-pkg.exe --no-user-package-db field array depends
C:/Users/nam83/AppData/Local/Programs/stack/x86_64-windows/ghc-8.2.2/bin/ghc-pkg.exe --no-user-package-db field filepath depends
| Windows path mapping: C:/msys/home/nam83/ghc/inplace/mingw/bin/ld.exe => C:/msys/home/nam83/ghc/inplace/mingw/bin/ld.exe
| KeyValues oracle: reading '_build/stage0/libraries/transformers/.dependencies'...
copyFile: invalid argument (The filename, directory name, or volume label syntax is incorrect.)
shakeArgsWith    0.000s    0%
Function shake  13.869s    7%  =
Database read    0.003s    0%
With database    0.002s    0%
Running rules  174.263s   92%  =========================
Total          188.137s  100%
Error when running Shake build system:
* _build/stage1/bin/unlit.exe
* OracleQ (PackageDataFile (Context {stage = Stage1, package = Package {pkgLanguage = Haskell, pkgType = Program, pkgName = "unlit", pkgPath = "utils/unlit"}, way = v}))
* _build/stage1/utils/unlit/setup-config
* _build/stage0/bin/ghc.exe
* OracleQ (PackageDataFile (Context {stage = Stage0, package = Package {pkgLanguage = Haskell, pkgType = Program, pkgName = "ghc-bin", pkgPath = "ghc"}, way = v}))
* _build/stage0/ghc/setup-config
* _build/stage0/lib/package.conf.d/ghc-8.5.conf
* OracleQ (PackageDataFile (Context {stage = Stage0, package = Package {pkgLanguage = Haskell, pkgType = Library, pkgName = "ghc", pkgPath = "compiler"}, way = v}))
* _build/stage0/compiler/setup-config
* _build/stage0/lib/package.conf.d/ghc-boot-th-8.5.conf
ExitFailure 1

See https://ci.appveyor.com/project/snowleopard/hadrian

I don't think I've seen such failure before.

alpmestan commented 6 years ago

Do you know which call to copyFile is failing?

snowleopard commented 6 years ago

@alpmestan No, I haven't yet figured out which copyFile is to blame.

ndmitchell commented 6 years ago

Isn't it one coming from _build/stage0/lib/package.conf.d/ghc-boot-th-8.5.conf - which is what the Shake stack trace says?

snowleopard commented 6 years ago

@ndmitchell Got it now. The error was coming from Cabal's defaultMainWithHooksNoReadArgs :-S

By the way, for some reason, I'm still getting confused when I see a Shake error trace -- my first reaction is usually "Shall I read it from top to bottom or vice versa?". I don't think there is anything wrong with how trace is printed, it's probably just me.

snowleopard commented 6 years ago

Fixed, now getting this: #564

ndmitchell commented 6 years ago

Agreed - I have the same reaction. I think it has to put the exception at the bottom (as it may be unbounded), and therefore it has to be in that order. What format/words do you think would clarify it? "Starting at" and "depends on"?