$ stack exec hadrian -- --directory ".." --flavour=quickestStack has not been tested with GHC versions above 9.0, and using 9.2, this may failStack has not been tested with Cabal versions above 3.4, but version 3.6.3.0 was found, this may fail[...]| Configure package 'rts'| In tree GMP will be built| Run Make "_build/stage1/libffi/build": none => noneCommand line: C:/msys64/usr/bin/make.exe -C _build/stage1/libffi/build MAKEFLAGS=-j4 install===> Command failed with error code: 2/usr/bin/sh: line 10: /usr/bin/make: No such file or directorymake: *** [Makefile:2906: install] Error 127make: Entering directory '/home/carri/ghc/ghc/_build/stage1/libffi/build'MAKE x86_64-pc-mingw64 : 0 * installmake: Leaving directory '/home/carri/ghc/ghc/_build/stage1/libffi/build'Command failedBuild failed.
Environment
GHC version used: 9.2.2
Optional:
Operating System: Windows(msys64)
System Architecture: x86_64
Edited
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
I tried to run two ways below but it does not work. What else information is needed? Please kindly let me know.
~/ghc/ghc$ stack exec ./configureDid not find executable at specified path: ./configure
~/ghc/ghc/hadrian$ stack exec ./configureStack has not been tested with GHC versions above 9.0, and using 9.2, this may failStack has not been tested with Cabal versions above 3.4, but version 3.6.3.0 was found, this may failDid not find executable at specified path: ./configure
Configure step succeeded.
A further question, what to do next? I tried hadrian/build-stack in~/ghc/ghc but get below error. Looks like same as what I reported in the issue description.
Thanks for sharing that instructions. I don't have enough time now and will read it through later.
Before reading it, I have a quick question about the commands you mentioned above. Shall it run under ghc instead of ghc/hadrian? If that is the case, I got below.
$ stack --stack-yaml hadrian/stack.yaml exec -- ./boot --hadrianDid not find executable at specified path: ./boot
Neither does stack exec -- python boot work in my case.
Since I still got same error, I rerun using build-stack -V and found error message similar to #19233 (closed) . So I followed the suggestion there to clean before building. But the error continues.
[... doing a lot of work ..]===> Command failed with error code: 2clang: error: unable to make temporary file: No such file or directorymake: *** [Makefile:1454: gen-fac.exe] Error 1make: *** Waiting for unfinished jobs....clang: error: unable to make temporary file: No such file or directorymake: *** [Makefile:1463: gen-fib.exe] Error 1clang: error: unable to make temporary file: No such file or directoryclang: error: unable to make temporary file: No such file or directorymake: *** [Makefile:1472: gen-bases.exe] Error 1make: *** [Makefile:1478: gen-trialdivtab.exe] Error 1make: Entering directory '/home/carri/ghc/ghc/_build/stage1/gmp/gmpbuild'C:/msys64/home/carri/ghc/ghc/inplace/mingw/bin/clang.exe `test -f 'gen-fac.c' || echo './'`gen-fac.c -o gen-fac.exeC:/msys64/home/carri/ghc/ghc/inplace/mingw/bin/clang.exe `test -f 'gen-fib.c' || echo './'`gen-fib.c -o gen-fib.exeC:/msys64/home/carri/ghc/ghc/inplace/mingw/bin/clang.exe `test -f 'gen-bases.c' || echo './'`gen-bases.c -o gen-bases.exe -lmC:/msys64/home/carri/ghc/ghc/inplace/mingw/bin/clang.exe `test -f 'gen-trialdivtab.c' || echo './'`gen-trialdivtab.c -o gen-trialdivtab.exe -lmmake: Leaving directory '/home/carri/ghc/ghc/_build/stage1/gmp/gmpbuild'Error when running Shake build system: at action, called at src\Rules.hs:38:19 in main:Rules at need, called at src\Rules.hs:60:5 in main:Rules* Depends on: _build/stage1/lib/package.conf.d/ghc-bignum-1.3.conf at apply1, called at src\Development\Shake\Internal\Rules\Oracle.hs:159:32 in shake-0.19.6-2soLMUISCU7LqLi9ornNvM:Development.Shake.Internal.Rules.Oracle* Depends on: OracleQ (ContextDataKey (Context {stage = Stage1, package = Package {pkgType = Library, pkgName = "ghc-bignum", pkgPath = "libraries/ghc-bignum"}, way = v})) at need, called at src\Hadrian\Oracles\Cabal\Rules.hs:54:9 in main:Hadrian.Oracles.Cabal.Rules* Depends on: _build/stage1/libraries/ghc-bignum/setup-config at need, called at src\Rules\Register.hs:47:13 in main:Rules.Register* Depends on: _build/stage1/libraries/ghc-bignum/build/include/ghc-gmp.h at need, called at src\Rules\Gmp.hs:73:13 in main:Rules.Gmp* Depends on: _build/stage1/gmp/gmp.h at &%>, called at src\Rules\Gmp.hs:99:55 in main:Rules.Gmp* Depends on: _build/stage1/gmp/libgmp.a _build/stage1/gmp/gmp.h at cmd', called at src\Builder.hs:358:29 in main:Builder at cmdArgs, called at src\Builder.hs:539:8 in main:Builder at cmdArgs, called at src\Builder.hs:563:18 in main:Builder at cmdArgs, called at src\Builder.hs:563:18 in main:Builder at cmdArgs, called at src\Builder.hs:563:18 in main:Builder at error, called at src\Builder.hs:608:13 in main:Builder* Raised the exception:Command failedBuild failed.
I set up the toolchain quite a while ago. I think I followed this wiki page. How shall I check it now?
Btw if the problem I reported is not an issue shared by others, probably just leave it as it is. I will switch to a different OS to build GHC. Many thanks for spending so much time and effort on this ticket.
Thanks! I tried just now. Boot step failed with error message that "Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module)". So I am now trying to install as instructed. I will let you know how that goes.
A quick update. I tried to reinstall but still has below error. But I indeed have the file /usr/share/autoconf-2.71/Autom4te/ChannelDefs.pm. I found some online discussion about this error but cannot solve it yet.
Can't locate Autom4te/ChannelDefs.pm in @INC (you may need to install the Autom4te::ChannelDefs module) (@INC contains: /usr/share/autoconf-2.71 /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/msys64/usr/bin/autoreconf-2.71 line 52.
hopefully the above will resolve the autoconf issue. if so, before invoking e.g. hadrian/stack.bat --flavour=quickest -j to build ghc it will probably be necessary to run stack build alex happy one time.
stack exec -- pacman -S autoconf automake-wrapper make patch python tar \ --noconfirm
This cause a error
:: Proceed with installation? [Y/n]checking keyring...checking package integrity...loading package files...checking for file conflicts...error: failed to commit transaction (conflicting files)tar: /usr/bin/tar.exe exists in filesystemErrors occurred, no packages were upgraded.
Arch wiki's solution does not work. I tried to omit tar and installed the rest and that works (probably wrongly already).
Then I booted as suggested above and got below output. Is it already booted? (If you spot any mistake, please kindly let me know. Meanwhile I am running the rest steps and will update later.)
aclocal-1.16: error: aclocal: file '/msys64/usr/share/aclocal/tcl-tea.m4' does not existautoreconf-2.71: error: aclocal failed with exit status: 1aclocal-1.16: error: aclocal: file '/msys64/usr/share/aclocal/tcl-tea.m4' does not existautoreconf-2.71: error: aclocal failed with exit status: 1autoreconf in . failed with exit code 1aclocal-1.16: error: aclocal: file '/msys64/usr/share/aclocal/tcl-tea.m4' does not existautoreconf-2.71: error: aclocal failed with exit status: 1configure.ac:111: warning: The macro `AC_FOREACH' is obsolete.configure.ac:111: You should run autoupdate.../autoconf-2.71/lib/autoconf/general.m4:191: AC_FOREACH is expanded from...aclocal.m4:43: FP_CHECK_CONSTS is expanded from...configure.ac:111: the top levelconfigure.ac:111: warning: The macro `_AC_COMPUTE_INT' is obsolete.configure.ac:111: You should run autoupdate.../autoconf-2.71/lib/autoconf/general.m4:3376: _AC_COMPUTE_INT is expanded from...aclocal.m4:10: FP_COMPUTE_INT is expanded from...../autoconf-2.71/lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...../autoconf-2.71/lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...../autoconf-2.71/lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...../autoconf-2.71/lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...aclocal.m4:19: FP_CHECK_CONST is expanded from...aclocal.m4:43: FP_CHECK_CONSTS is expanded from...configure.ac:111: the top levelautoreconf in libraries/directory/ failed with exit code 1autoreconf in libraries/terminfo/ failed with exit code 1libraries/array/libraries/base/[...continues..]Booting libraries/base/Booting libraries/directory/Booting libraries/ghc-bignum/Booting libraries/process/Booting libraries/terminfo/Booting libraries/time/Booting libraries/unix/
the warnings from configure.ac are normal but the errors and non-zero exit codes are not
by any chance are there any spaces in the path of your working directory? e.g. C:\Program Files\Users\...? if so, i recommend using a directory path that doesn't contain any like, C:\project.
i think in your situation, i would be inclined to start over. clear out any vestiges of any preceding installs (if possible, perhaps even reimage the box) then, in a directory like c:\project:
curl -sSL https://get.haskellstack.org/ | sh -s - -fstack exec -- pacman -Syu --noconfirmstack exec -- pacman -S autoconf automake-wrapper make patch python mintty tar --noconfirmstack build alex happy
then clone ghc into 'c:\project' with git clone --recursive https://gitlab.haskell.org/ghc/ghc.git and
Thanks for the detailed guidance. My previous attempt failed and I am going to have "a clean install" over weekend. I will let you know how that goes. Finger crossed.
"Build completed in xxhxxm" Soooo excited! Thanks so much for everyone's help.
I mainly followed @shayne-fletcher-da 's scripts, except that I have some workarounds when things do not turn out as expected. I recorded as below. Maybe it help users in similar situations. Or more likely, I get some suggestions on improvements.
tl;dr stack is installed manually by downloading and double clicking. curl -sSL https://get.haskellstack.org/ | sh -s - -f failed many times, either silently or blaming "7z" missing. However, I somehow succeeded once. (Feeling like rolling a dice) However after that success, for some reasons, I have to start all over from the beginning again. Then never got that "lucky" again. Neither pacman -S helps. So my last resort is a manual installation.
boot step can only run on "MSYS" but the rest on "MINGW64".
If boot runs on "MINGW64", the error I reported above on "autoreconf" are there again. configure requires "MINGW64", I have to switched back.
specify alex and happy (>= 1.20) version, currently default goes to an unqualified version
a nitpicking for @shayne-fletcher-da 's excellent work. hadrian/build.stack.bat should be hadrian/build-stack.bat
Thanks again!
Btw, is it fine to update our wiki pages related based discussions in this issue? I am willing to draft that but would like to have some proof reading from others with better knowledge on the topic.
regarding 1. that's surprising. i have found that procedure reliable (at least on azure)
regarding 2. do you mean that you mean you are executing the boot and configure commands from msys or mingw shells? in general, i execute all commands from a regular cmd.exe prompt (and never explicitly install msys/mingw or go looking for their shells preferring stack manage the installations)
regarding 3. if the stack exec/stack build steps had the form stack --stack-yaml hadrian/stack.yaml ... i expect the desired alex and happy would be installed (and the barest minimum of ghc installs).
do you mean that you mean you are executing the boot and configure commands from msys or mingw shells?
yes
in general, i execute all commands from a regular cmd.exe prompt (and never explicitly install msys/mingw or go looking for their shells preferring stack manage the installations)
Could you elaborate on how to do that?
I am thinking about putting your script somewhere in Wiki pages. Would here be a proper place?
in general, i execute all commands from a regular cmd.exe prompt (and never explicitly install msys/mingw or go looking for their shells preferring stack manage the installations)
Could you elaborate on how to do that?
On installing stack, the first stack command you execute (e.g. stack setup, stack exec, ...) will result in it downloading and installing MSYS2 into a location of its choosing. There is no need to manually execute an MSYS2 or MINGW installer. This is what I mean by preferring "stack manage the installation"
Search the start menu for Command Prompt or Windows Terminal. This page appears to document a variety of methods.
For the procedure we are discussing I guess preconditions are that git (and perhaps 7-zip according to your earlier comments?) have been manually installed into locations reachable via your PATH system variable.
I am thinking about putting your script somewhere in Wiki pages. Would here be a proper place?