Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

Building on windows is broken. #697

Closed
AndreasPK opened this issue Oct 7, 2018 · 23 comments
Closed

Building on windows is broken. #697

AndreasPK opened this issue Oct 7, 2018 · 23 comments

Comments

@AndreasPK
Copy link

Both build.sh and build.bat are broken for seemingly different reasons.

$ hadrian/build.sh
Up to date
Up to date
Warning: libraries\text\text.cabal:4:1: The field "bug-reports" is specified
more than once at positions 4:1, 42:1
Warning: libraries\Win32\Win32.cabal:16:2: Tabs used as indentation at 16:2,
17:2
Warning: libraries\text\text.cabal:4:1: The field "bug-reports" is specified
more than once at positions 4:1, 42:1
Warning: utils\hpc\hpc-bin.cabal:11:2: Tabs used as indentation at 11:2
hadrian: 'C:/ghc/msys64/home/Andi/ghc_patterns/_build/stage0/bin/ghc.exe'
exited with an error:
ghc.exe: could not detect mingw toolchain

shakeArgsWith   0.001s    0%
Function shake  0.777s    2%
Database read   0.382s    1%
With database   0.011s    0%
Running rules  33.410s   96%  =========================
Total          34.580s  100%
Error when running Shake build system:
* _build/stage1/lib/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
ExitFailure 1

$ hadrian/build.bat -c

Warning: Cabal file warning in C:\ghc\msys64\home\Andi\ghc_patterns\libraries\text\text.cabal@ 4:1:
         The field "bug-reports" is specified more than once at positions 4:1, 42:1
Warning: libraries\text\text.cabal:4:1: The field "bug-reports" is specified
more than once at positions 4:1, 42:1
Warning: libraries\Win32\Win32.cabal:16:2: Tabs used as indentation at 16:2,
17:2
shakeArgsWith   0.000s    0%
Function shake  0.428s    8%  ==
Database read   0.002s    0%
With database   0.000s    0%
Running rules   4.812s   91%  =========================
Total           5.243s  100%
Error when running Shake build system:
* _build/stage1/lib/package.conf.d/Win32-2.6.1.0.conf
* _build/stage1/lib/platformConstants
* _build/generated/platformConstants
* _build/stage0/bin/deriveConstants.exe
* OracleQ (PackageDataFile (Context {stage = Stage0, package = Package {pkgLanguage = Haskell, pkgType = Program, pkgName = "deriveConstants", pkgPath = "utils/deriveConstants"}, way = v}))
* _build/stage0/utils/deriveConstants/setup-config
* C:/Users/Andi/AppData/Local/Programs/stack/x86_64-windows/msys2-20150512/opt/ghc/bin/ghc.exe
Error, file does not exist and no rule available:
  C:/Users/Andi/AppData/Local/Programs/stack/x86_64-windows/msys2-20150512/opt/ghc/bin/ghc.exe
CallStack (from HasCallStack):
  error, called at src\Development\Shake\Internal\Rules\File.hs:180:58 in shake-0.16.1-IQAyPBh8d6XAKaIIOEEuAT:Development.Shake.Internal.Rules.File
@alpmestan
Copy link
Collaborator

Hmm. Odd. That appveyor build went fine for last PR that got merged: #691

Maybe that was before some GHC patch broke everything (again) ?

@alpmestan
Copy link
Collaborator

For the record, the first error message comes from my work on #564 (which resulted in ghc commit ghc/ghc@5d76846). It'd be nice to get the output of the same command with --trace.

For the second one, it looks like _build/stage0/utils/deriveConstants/setup-config ends up needing C:/Users/Andi/AppData/Local/Programs/stack/x86_64-windows/msys2-20150512/opt/ghc/bin/ghc.exe, which... doesn't exist? Any idea of what might be going on there @snowleopard? Again, adding --trace to the command will give us a lot more output, maybe that will give us a lead.

@AndreasPK
Copy link
Author

Trace output

$ hadrian/build.sh --flavour=quickest
Up to date
Up to date
| Run Happy: utils/genprimopcode/Parser.y => _build/stage0/utils/genprimopcode/build/Parser.hs
happy.exe: C:\test\pyn\.stack-work\install\69301fa4\share\x86_64-windows-ghc-8.0.2\happy-1.19.5/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)
shakeArgsWith   0.000s    0%
Function shake  0.275s   13%  ====
Database read   0.005s    0%
With database   0.001s    0%
Running rules   1.715s   85%  =========================
Total           1.996s  100%
Error when running Shake build system:
* _build/stage0/bin/genprimopcode.exe
* _build/stage0/utils/genprimopcode/build/Syntax.o
* _build/stage0/utils/genprimopcode/build/Syntax.o _build/stage0/utils/genprimopcode/build/Syntax.hi
* OracleQ (KeyValues ("_build/stage0/utils/genprimopcode/.dependencies","_build/stage0/utils/genprimopcode/build/Syntax.o"))
* _build/stage0/utils/genprimopcode/.dependencies
* _build/stage0/utils/genprimopcode/.dependencies.mk
* _build/stage0/utils/genprimopcode/build/Parser.hs
user error (Development.Shake.cmd, system command failed
Command: C:/Users/Andi/AppData/Roaming/local/bin/happy.exe -agc --strict utils/genprimopcode/Parser.y -o _build/stage0/utils/genprimopcode/build/Parser.hs
Exit code: 1
Stderr:
happy.exe: C:\test\pyn\.stack-work\install\69301fa4\share\x86_64-windows-ghc-8.0.2\happy-1.19.5/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)
)

@alpmestan
Copy link
Collaborator

That's an odd one. No more details? Did you run hadrian/build.sh --flavour=quickest --trace ?

@snowleopard
Copy link
Owner

@alpmestan Do you mean --verbose?

@alpmestan
Copy link
Collaborator

--verbose and --trace do the same thing no? Judging from hadrian's --help output.

@snowleopard
Copy link
Owner

@AndreasPK In the first case (build.sh) you seem to miss -c that does the configuration step and copies Windows tarballs. In general, please use build.bat on Windows.

I'll try to reproduce the failure with build.bat when get to my laptop.

@alpmestan Ah, indeed, I didn't know about --trace.

@AndreasPK
Copy link
Author

AndreasPK commented Oct 8, 2018

I've run configure manually above

Some more dumps from build.sh/build.bat (are both supported on windows?)

$ hadrian/build.sh -c --flavour=quickest --trace --verbose
Up to date
Up to date
| Building Stage1 libraries: binary, Cabal, ghc, ghc-boot, ghc-boot-th, ghc-heap, ghci, hpc, mtl, parsec, template-haskell, text, transformers, array, base, bytestring, containers, deepseq, directory, filepath, ghc-compact, ghc-prim, haskeline, integer-gmp, pretty, process, rts, stm, time, xhtml, Win32
| Building Stage1 programs : ghc, ghc-pkg, hsc2hs, unlit, hpc, runghc, touchy

# _build/stage2/bin/haddock.exe
| ContextData oracle: resolving data for 'Cabal' (Stage1, v)...
# _build/stage1/libraries/Cabal/Cabal/setup-config
| Configure package 'Cabal'
# _build/stage2/bin/ghctags.exe
# _build/stage1/lib/package.conf.d/Win32-2.6.1.0.conf
# _build/stage1/lib/platformConstants
# _build/generated/platformConstants
# _build/stage1/bin/runghc.exe
| ContextData oracle: resolving data for 'Win32' (Stage1, v)...
# _build/stage1/libraries/Win32/setup-config
| Configure package 'Win32'
# _build/stage1/bin/hpc.exe
# _build/stage1/lib/package.conf.d/xhtml-3000.2.2.1.conf
# _build/stage1/lib/package.conf.d/time-1.8.0.2.conf
# _build/stage1/lib/package.conf.d/stm-2.5.0.0.conf
# _build/stage1/lib/package.conf.d/rts-1.0.conf
# _build/stage1/lib/package.conf.d/process-1.6.3.0.conf
# _build/stage1/lib/package.conf.d/pretty-1.1.3.6.conf
# _build/stage1/lib/package.conf.d/integer-gmp-1.0.2.0.conf
# _build/stage1/bin/hsc2hs.exe
# _build/stage1/lib/package.conf.d/haskeline-0.7.4.3.conf
# _build/stage1/lib/package.conf.d/ghc-prim-0.5.3.conf
# _build/stage1/bin/ghc-pkg.exe
# _build/stage1/lib/package.conf.d/ghc-compact-0.1.0.0.conf
# _build/stage1/bin/ghc.exe
# _build/stage1/lib/package.conf.d/filepath-1.4.2.1.conf
# _build/stage1/lib/package.conf.d/directory-1.3.3.0.conf
# _build/stage1/lib/package.conf.d/deepseq-1.4.4.0.conf
# _build/stage1/lib/package.conf.d/containers-0.6.0.1.conf
# _build/stage1/lib/package.conf.d/bytestring-0.10.8.2.conf
# _build/stage1/lib/package.conf.d/base-4.12.0.0.conf
# _build/stage1/lib/package.conf.d/array-0.5.2.0.conf
# _build/stage1/lib/package.conf.d/transformers-0.5.5.0.conf
# _build/stage1/lib/package.conf.d/text-1.2.3.1.conf
# _build/stage1/lib/package.conf.d/template-haskell-2.14.0.0.conf
# _build/stage1/lib/package.conf.d/parsec-3.1.13.0.conf
# _build/stage1/lib/package.conf.d/mtl-2.2.2.conf
# _build/stage1/lib/package.conf.d/hpc-0.6.0.3.conf
# _build/stage1/lib/package.conf.d/ghci-8.7.conf
# _build/stage1/lib/package.conf.d/ghc-heap-8.7.conf
# _build/stage1/lib/package.conf.d/ghc-boot-th-8.7.conf
# _build/stage1/lib/package.conf.d/ghc-boot-8.7.conf
# _build/stage1/lib/package.conf.d/ghc-8.7.conf
# _build/stage1/lib/package.conf.d/Cabal-2.4.0.1.conf
# _build/stage1/lib/package.conf.d/binary-0.8.6.0.conf
# _build/stage0/lib/package.conf.d/transformers-0.5.5.0.conf
# _build/stage0/lib/platformConstants
# _build/stage0/lib/package.conf.d/text-1.2.3.1.conf
# _build/stage0/lib/package.conf.d/template-haskell-2.14.0.0.conf
# _build/stage0/lib/package.conf.d/parsec-3.1.13.0.conf
# _build/stage0/lib/package.conf.d/mtl-2.2.2.conf
# _build/stage0/lib/package.conf.d/hpc-0.6.0.3.conf
# _build/stage0/bin/ghc-pkg.exe
| ContextData oracle: resolving data for 'Cabal' (Stage0, v)...
# _build/stage0/libraries/Cabal/Cabal/setup-config
| Configure package 'Cabal'
# _build/stage0/lib/package.conf.d/ghci-8.7.conf
# _build/stage0/lib/package.conf.d/ghc-heap-8.7.conf
# _build/stage0/lib/package.conf.d/ghc-boot-th-8.7.conf
# _build/stage0/lib/package.conf.d/ghc-boot-8.7.conf
# _build/stage0/bin/ghc.exe
# _build/stage0/bin/genprimopcode.exe
# _build/stage0/utils/genprimopcode/build/Syntax.o
# _build/stage0/utils/genprimopcode/build/Syntax.o _build/stage0/utils/genprimopcode/build/Syntax.hi
# _build/stage0/utils/genprimopcode/.dependencies
# _build/stage0/utils/genprimopcode/.dependencies.mk
# _build/stage0/utils/genprimopcode/build/Parser.hs
| Run Happy: utils/genprimopcode/Parser.y => _build/stage0/utils/genprimopcode/build/Parser.hs
C:/Users/Andi/AppData/Roaming/local/bin/happy.exe -agc --strict utils/genprimopcode/Parser.y -o _build/stage0/utils/genprimopcode/build/Parser.hs
happy.exe: C:\test\pyn\.stack-work\install\69301fa4\share\x86_64-windows-ghc-8.0.2\happy-1.19.5/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)
shakeArgsWith   0.000s    0%
Function shake  0.251s   16%  ====
Database read   0.002s    0%
With database   0.000s    0%
Running rules   1.294s   83%  =========================
Total           1.548s  100%
Error when running Shake build system:
* _build/stage0/bin/genprimopcode.exe
* _build/stage0/utils/genprimopcode/build/Syntax.o
* _build/stage0/utils/genprimopcode/build/Syntax.o _build/stage0/utils/genprimopcode/build/Syntax.hi
* OracleQ (KeyValues ("_build/stage0/utils/genprimopcode/.dependencies","_build/stage0/utils/genprimopcode/build/Syntax.o"))
* _build/stage0/utils/genprimopcode/.dependencies
* _build/stage0/utils/genprimopcode/.dependencies.mk
* _build/stage0/utils/genprimopcode/build/Parser.hs
user error (Development.Shake.cmd, system command failed
Command: C:/Users/Andi/AppData/Roaming/local/bin/happy.exe -agc --strict utils/genprimopcode/Parser.y -o _build/stage0/utils/genprimopcode/build/Parser.hs
Exit code: 1
Stderr:
happy.exe: C:\test\pyn\.stack-work\install\69301fa4\share\x86_64-windows-ghc-8.0.2\happy-1.19.5/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)
)

hadrian/build.bat -c --flavour=quickest --trace --verbose -j5
WARNING: Ignoring out of range dependency (allow-newer enabled): QuickCheck-2.11.3. hadrian requires: >=2.6 && <2.11
Error when reading Shake database _build/hadrian\.shake.database
  Witness type has disappeared, StepKey {7f27280ab3bbfbde}
  CallStack (from HasCallStack):
    error, called at src\Development\Shake\Internal\Core\Storage.hs:191:40 in shake-0.16.4-CXjNkJq2iLlIVaDYJLumnH:Development.Shake.Internal.Core.Storage
All files will be rebuilt

# hadrian/cfg/system.config
# hadrian/cfg/system.config settings mk/config.h compiler/ghc.cabal rts/rts.cabal
| Checking for Windows tarballs...
# mk/config.h.in
# rts/rts.cabal.in
# compiler/ghc.cabal.in
# hadrian/cfg/system.config.in
# settings.in
# configure mk/config.h.in
# configure.ac
| Running boot...
Booting .
Booting libraries/base/
Booting libraries/directory/
Booting libraries/integer-gmp/
Booting libraries/process/
Booting libraries/terminfo/
Booting libraries/time/
Booting libraries/unix/
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
autoreconf in . failed with exit code 2
autoreconf in libraries/base/ failed with exit code 2
autoreconf in libraries/directory/ failed with exit code 2
autoreconf in libraries/integer-gmp/ failed with exit code 2
autoreconf in libraries/process/ failed with exit code 2
autoreconf in libraries/terminfo/ failed with exit code 2
autoreconf in libraries/time/ failed with exit code 2
autoreconf in libraries/unix/ failed with exit code 2
shakeArgsWith   0.001s    0%
Function shake  0.257s   10%  ===
Database read   0.001s    0%
With database   0.000s    0%
Running rules   2.105s   89%  =========================
Total           2.363s  100%
Error when running Shake build system:
* OracleQ (KeyValue ("hadrian/cfg/system.config","host-os"))
* hadrian/cfg/system.config
* hadrian/cfg/system.config settings mk/config.h compiler/ghc.cabal rts/rts.cabal
* mk/config.h.in
* configure mk/config.h.in
user error (Development.Shake.cmd, system command failed
Command: python3 boot --hadrian
Exit code: 1
Stderr:
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /c/ghc/msys64/usr/bin/autoreconf line 39.
BEGIN failed--compilation aborted at /c/ghc/msys64/usr/bin/autoreconf line 39.
autoreconf in . failed with exit code 2
autoreconf in libraries/base/ failed with exit code 2
autoreconf in libraries/directory/ failed with exit code 2
autoreconf in libraries/integer-gmp/ failed with exit code 2
autoreconf in libraries/process/ failed with exit code 2
autoreconf in libraries/terminfo/ failed with exit code 2
autoreconf in libraries/time/ failed with exit code 2
autoreconf in libraries/unix/ failed with exit code 2
)

I have no idea where the C:\test\pyn.stack-work\install... path comes from tbh.

@AndreasPK
Copy link
Author

Deleting the " C:\test\pyn.." path made the build.sh script run through. Still not sure why that got picked up to begin with though. It's definitely not in PATH.

@snowleopard
Copy link
Owner

Some more dumps from build.sh/build.bat (are both supported on windows?)

@AndreasPK No. On Windows we only support build.bat (which currently redirects to build.stack.bat). There is also build.cabal.bat, although I believe it is not in the CI, so less reliable.

(Sorry, I can't be more helpful. This week is very busy.)

@snowleopard
Copy link
Owner

I reproduced the Happy-related failure on my machine:

| Run Happy: utils/genprimopcode/Parser.y => _build/stage0/utils/genprimopcode/build/Parser.hs
happy.exe: C:\msys\home\nam83\ghc\hadrian\.stack-work\install\db7ce97c\share\x86_64-windows-ghc-8.4.3\happy-1.19.9/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)
shakeArgsWith    0.001s    0%
Function shake   0.336s    0%
Database read    0.001s    0%
With database    0.000s    0%
Running rules  232.532s   99%  =========================
Total          232.870s  100%
Error when running Shake build system:
* _build/stage0/bin/genprimopcode.exe
* _build/stage0/utils/genprimopcode/build/Main.o
* _build/stage0/utils/genprimopcode/build/Main.o _build/stage0/utils/genprimopcode/build/Main.hi
* OracleQ (KeyValues ("_build/stage0/utils/genprimopcode/.dependencies","_build/stage0/utils/genprimopcode/build/Main.o"))
* _build/stage0/utils/genprimopcode/.dependencies
* _build/stage0/utils/genprimopcode/.dependencies.mk
* _build/stage0/utils/genprimopcode/build/Parser.hs
user error (Development.Shake.cmd, system command failed
Command: C:/Users/nam83/AppData/Roaming/local/bin/happy.exe -agc --strict utils/genprimopcode/Parser.y -o _build/stage0/utils/genprimopcode/build/Parser.hs
Exit code: 1
Stderr:
happy.exe: C:\msys\home\nam83\ghc\hadrian\.stack-work\install\db7ce97c\share\x86_64-windows-ghc-8.4.3\happy-1.19.9/HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory)
)

Just like in @AndreasPK's case, the path C:\msys\home\nam83\ghc\hadrian\.stack-work\install\db7ce97c\share\x86_64-windows-ghc-8.4.3\happy-1.19.9/HappyTemplate-arrays-coerce makes no sense.

@snowleopard
Copy link
Owner

snowleopard commented Oct 20, 2018

The problem seems to be not with Hadrian, but rather with the Happy installation. If I reinstall Happy, the build continues correctly.

Here is I think what happened in @AndreasPK's case: he installed Happy before trying Hadrian, and during the installation Happy put its HappyTemplate-arrays-coerce into the C:\test\pyn... directory, which later got removed breaking the Happy installation.

In my case, Happy was installed in the Hadrian's .stack-work\install\db7ce97c directory, which later was removed too, triggering the same failure in my case.

I don't really know whether we can do anything about this in Hadrian. It seems to me that the configure script should test that Happy actually works.

@snowleopard
Copy link
Owner

@AndreasPK Do you need any further help with using Hadrian on Windows?

@AndreasPK
Copy link
Author

For the moment I went back to make :/

Currently build.bat still doesn't work (see log above) only build.sh does after "fixing" the happy issue. So there is no officially supported way to run the build. I can work around that by using build.sh but given that it's not supported I'm not keen on going that way.

I wonder why build.sh is not supported if we require an msys installation anyway. Having differing default workflows for windows/linux does seem like it will only lead to issues down the road.

There is also #696 which for me is on it's own enough of a pain point to keep using make for now.

@snowleopard
Copy link
Owner

snowleopard commented Oct 20, 2018

@AndreasPK I couldn't reproduce your boot failure unfortunately, so I'm not sure what to do.

I wonder why build.sh is not supported if we require an msys installation anyway. Having differing default workflows for windows/linux does seem like it will only lead to issues down the road.

We do not require an MSYS installation (see the AppVeyor build script, for example). Hadrian can be used on Windows without installing MSYS manually -- this is handled by Stack.

Have you tried build.cabal.bat? Like build.sh it uses Cabal instead of Stack (and therefore does require an existing MSYS installation).

@AndreasPK
Copy link
Author

AndreasPK commented Oct 21, 2018

We do not require an MSYS installation: Hadrian can be used on Windows without installing MSYS manually -- this is handled by Stack.

I see. I must have misinterpreted something then and it's good to know! I did try it from powershell and from within an msys environment though.

Have you tried build.cabal.bat

I have not. I've started a build now but I can already say it's affected by #696 as I forgot to pass -j initially.
Seems to work otherwise. I did hit some "Bad interface file" errors but that was likely from earlier build artefacts.

edit: After running clean the cabal.bat version works.

@snowleopard
Copy link
Owner

@AndreasPK Thanks for giving the Cabal script a try!

I agree that #696 is annoying. As a workaround I sometimes terminate Hadrian in the Task manager, which is awkward, but seems to work.

The build.bat failure you reported above (when the boot script failed) seems to be not from a clean build state. Could you please try to reproduce it after a clean GHC checkout?

@AndreasPK
Copy link
Author

I agree that #696 is annoying. As a workaround I sometimes terminate Hadrian in the Task manager, which is awkward, but seems to work.

Yes it's what I did. But at that point I have to ask myself why not just stay on make for now.

The build.bat failure you reported above (when the boot script failed) seems to be not from a clean build state. Could you please try to reproduce it after a clean GHC checkout?

git clean -fxd wasn't enough at least to make build.bat work. There shouldn't be a difference but I will give a clean checkout a try.

@AndreasPK
Copy link
Author

AndreasPK commented Oct 21, 2018

So I got the same build.bat error with a clean check out.

A question about the shell requirements:

We do not require an MSYS installation: Hadrian can be used on Windows without installing MSYS manually -- this is handled by Stack.

From the quickstart page:

In particular for Windows users, all the commands below must be executed in the MinGW shell

Is this just plain wrong or are users supposed to do something like stack exec mintty and run hadrian from there? (Although not sure if this is the right place to discuss this).

@snowleopard
Copy link
Owner

So I got the same build.bat error with a clean check out.

Do you get the same error if you run the command in question python3 boot --hadrian manually?

Is this just plain wrong

Yes, I think the QuickStart page is wrong in this respect. Let me CC @alpmestan who wrote it -- is there any reason for requiring the MinGW shell when developing GHC on Windows? Even with Make I think we can now build GHC in other Windows shells.

Although not sure if this is the right place to discuss this

Don't worry, it's perfectly fine to discuss any Hadrian-related questions here.

@alpmestan
Copy link
Collaborator

I simply borrowed this bit from the guide for the make build system. Please feel free to edit the page and make all the necessary corrections. Since I'm not a Windows user, any Windows-specific details will be best taken care of by either/both of you. :-)

@snowleopard
Copy link
Owner

@alpmestan Thanks! :) Yes, I'll do some edits for Windows-specific bits.

@snowleopard
Copy link
Owner

I believe this has been fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants