
I've just got a new laptop (the old one's hard disk died) so I'm trying to get to the point of being able to build GHC again. I'm currently stuck here: ./configure configure: loading site script /usr/local/etc/config.site checking for gfind... no checking for find... /usr/bin/find checking for sort... /usr/bin/sort checking for GHC version date... inferred 8.5.20180323 checking for GHC Git commit id... inferred affdea82bb70e5a912b679a169c6e9a230e4c93e checking for ghc... /c/fp/HP-8.2.2/bin/ghc checking version of ghc... 8.2.2 GHC path canonicalised to: c:/fp/HP-8.2.2/bin/ghc checking build system type... x86_64-pc-msys checking host system type... x86_64-pc-msys checking target system type... x86_64-pc-msys Unknown OS msys Any ideas? Thanks Simon

Hi Simon, You need export MSYSTEM=MINGW64 in your bash profile. Regards, Tamar From: Simon Peyton Jones via ghc-devs Sent: Friday, March 23, 2018 22:21 To: ghc-devs@haskell.org Subject: Windows I’ve just got a new laptop (the old one’s hard disk died) so I’m trying to get to the point of being able to build GHC again. I’m currently stuck here: ./configure configure: loading site script /usr/local/etc/config.site checking for gfind... no checking for find... /usr/bin/find checking for sort... /usr/bin/sort checking for GHC version date... inferred 8.5.20180323 checking for GHC Git commit id... inferred affdea82bb70e5a912b679a169c6e9a230e4c93e checking for ghc... /c/fp/HP-8.2.2/bin/ghc checking version of ghc... 8.2.2 GHC path canonicalised to: c:/fp/HP-8.2.2/bin/ghc checking build system type... x86_64-pc-msys checking host system type... x86_64-pc-msys checking target system type... x86_64-pc-msys Unknown OS msys Any ideas? Thanks Simon

Just an idea...
could this hint be part of the `configure` error message?
Gabor
On 3/23/18, lonetiger@gmail.com
Hi Simon,
You need
export MSYSTEM=MINGW64
in your bash profile.
Regards, Tamar
From: Simon Peyton Jones via ghc-devs Sent: Friday, March 23, 2018 22:21 To: ghc-devs@haskell.org Subject: Windows
I’ve just got a new laptop (the old one’s hard disk died) so I’m trying to get to the point of being able to build GHC again. I’m currently stuck here: ./configure configure: loading site script /usr/local/etc/config.site checking for gfind... no checking for find... /usr/bin/find checking for sort... /usr/bin/sort checking for GHC version date... inferred 8.5.20180323 checking for GHC Git commit id... inferred affdea82bb70e5a912b679a169c6e9a230e4c93e checking for ghc... /c/fp/HP-8.2.2/bin/ghc checking version of ghc... 8.2.2 GHC path canonicalised to: c:/fp/HP-8.2.2/bin/ghc checking build system type... x86_64-pc-msys checking host system type... x86_64-pc-msys checking target system type... x86_64-pc-msys Unknown OS msys Any ideas? Thanks Simon

Making it part of the error message would be v helpful.
I have added a section to "Troubleshooting" on
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
But it should really be part of the instructions higher up to sa
export MSYSTEM=MINGW64
Might someone do that? I wasn't quite sure where
Simon
| -----Original Message-----
| From: ghc-devs

Hi Simon, If the build environment is managed by an MSYS2 installation, then the MinGW64 shell startup script automatically sets up "MSYSTEM" for you. It can be launched like "C:\msys64\msys2_shell.cmd -mingw64 -mintty". On Mon, Mar 26, 2018 at 5:46 PM, Simon Peyton Jones via ghc-devs < ghc-devs@haskell.org> wrote:
Making it part of the error message would be v helpful.
I have added a section to "Troubleshooting" on https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
But it should really be part of the instructions higher up to sa export MSYSTEM=MINGW64
Might someone do that? I wasn't quite sure where
Simon
| -----Original Message----- | From: ghc-devs
On Behalf Of Ben Gamari | Sent: 24 March 2018 16:42 | To: Gabor Greif ; lonetiger@gmail.com | Cc: ghc-devs@haskell.org | Subject: Re: Windows | | Gabor Greif writes: | | > Just an idea... | > | > could this hint be part of the `configure` error message? | > | Indeed. See D4526. | | Cheers, | | - Ben _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

If the build environment is managed by an MSYS2 installation, then the MinGW64 shell startup script automatically sets up "MSYSTEM" for you. It can be launched like "C:\msys64\msys2_shell.cmd -mingw64 -mintty".
Well I just followed the Method A instructions at
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
Are you saying that I should run “C:\msys64\msys2_shell.cmd -mingw64 -mintty" just once, after installing? Or repeatedly? Or that I should somehow us it as my main shell? And what does that commend actually do?
Sorry to be dense
Simon
From: ghc-devs

Hi Simon,
Running “C:\msys64\msys2_shell.cmd -mingw64 -mintty" has the same effect as
clicking on the "MinGW-w64 Win64 Shell" shortcut. It is the proper way to
start an mingw64 shell. If you have run "pacman -S" to update the MSYS2
packages before, then the old shortcuts setup by the MSYS2 installer may
cease to function, and you can put a new shortcut on your desktop with that
command.
On Mon, Mar 26, 2018 at 6:02 PM, Simon Peyton Jones
If the build environment is managed by an MSYS2 installation, then the MinGW64 shell startup script automatically sets up "MSYSTEM" for you. It can be launched like "C:\msys64\msys2_shell.cmd -mingw64 -mintty".
Well I just followed the Method A instructions at
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
Are you saying that I should run “C:\msys64\msys2_shell.cmd -mingw64 -mintty" just once, after installing? Or repeatedly? Or that I should somehow us it as my main shell? And what does that commend actually do?
Sorry to be dense
Simon
*From:* ghc-devs
*On Behalf Of *Shao, Cheng *Sent:* 26 March 2018 10:59 *To:* ghc-devs@haskell.org *Subject:* Re: Windows Hi Simon,
If the build environment is managed by an MSYS2 installation, then the MinGW64 shell startup script automatically sets up "MSYSTEM" for you. It can be launched like "C:\msys64\msys2_shell.cmd -mingw64 -mintty".
On Mon, Mar 26, 2018 at 5:46 PM, Simon Peyton Jones via ghc-devs < ghc-devs@haskell.org> wrote:
Making it part of the error message would be v helpful.
I have added a section to "Troubleshooting" on https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
But it should really be part of the instructions higher up to sa export MSYSTEM=MINGW64
Might someone do that? I wasn't quite sure where
Simon
| -----Original Message----- | From: ghc-devs
On Behalf Of Ben Gamari | Sent: 24 March 2018 16:42 | To: Gabor Greif ; lonetiger@gmail.com | Cc: ghc-devs@haskell.org | Subject: Re: Windows | | Gabor Greif writes: | | > Just an idea... | > | > could this hint be part of the `configure` error message? | > | Indeed. See D4526. | | Cheers, | | - Ben _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Running “C:\msys64\msys2_shell.cmd -mingw64 -mintty" has the same effect as clicking on the "MinGW-w64 Win64 Shell" shortcut. It is the proper way to start an mingw64 shell.
Interesting. Most shells are started by ‘make’. I think it uses the SHELL envt variable to decide what to start. Currently I have that set to
* c:/msys64/usr/bin/bash
Are you saying that I should put
* C:\msys64\msys2_shell.cmd -mingw64 -mintty
into my SHELL envt variable?
(Also: I always a shell within emacs, rather that an msys window, and it uses SHELL to decide what to run.)
Also: is this related to the
export MSYSTEM=MINGW64
question?
Thanks
Simon
From: ghc-devs

“C:\msys64\msys2_shell.cmd -mingw64 -mintty”
Won’t work for you as it spawns a new process using mintty as your terminal emulator.
If I remember correctly you have a setup where you use bash directly in emacs. In which case you just need
To set the environment variables and add /mingw64/bin to your path.
I would personally avoid the use of mintty because of how it implements pty. Lots of interactive programs don’t work
Correctly under it, including ghci where we need specific hacks to work around some of it’s issues https://github.com/mintty/mintty/issues/56.
From: Simon Peyton Jones via ghc-devs
Sent: Monday, March 26, 2018 11:03
To: Shao, Cheng; ghc-devs@haskell.org
Subject: RE: Windows
If the build environment is managed by an MSYS2 installation, then the MinGW64 shell startup script automatically sets up "MSYSTEM" for you. It can be launched like "C:\msys64\msys2_shell.cmd -mingw64 -mintty".
Well I just followed the Method A instructions at
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
Are you saying that I should run “C:\msys64\msys2_shell.cmd -mingw64 -mintty" just once, after installing? Or repeatedly? Or that I should somehow us it as my main shell? And what does that commend actually do?
Sorry to be dense
Simon
From: ghc-devs

I would personally avoid the use of mintty because of how it implements pty
OK thanks.
If I remember correctly you have a setup where you use bash directly in emacs.
Correct
In which case you just need To set the environment variables and add /mingw64/bin to your path.
But set which envt variables to what, precisely?
As I say in another email, c:/mingw64 doesn’t exist. c:/msys64 does, and c:/msys64/mingw64. Very confusing!
Thanks
Simon
From: lonetiger@gmail.com

One other thing. The instructions at
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
say to set PATH thus
export PATH=/mingw64/bin:\$PATH
But
* in the installation tree I got from msys, there IS no c:/mingw64/bin.
* I have a root directory c:/msys64.
* Most binaries (eg bash, find) seem to be in c:/mingw64/usr/bin
* But there is also c:/msys64/mingw64/bin, which (perhaps as a result of the pacman step) has lots more stuf like ar, cc, etc.
All very confusing. For now I have put both c:/msys64/usr/bin and c:/msys64/mingw64/bin in my path. That seems to work, but is clearly not what the instructions say.
Thanks
Simon
From: ghc-devs

On Mon, Mar 26, 2018 at 11:08 AM, Simon Peyton Jones via ghc-devs < ghc-devs@haskell.org> wrote:
One other thing. The instructions at
https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
say to set PATH thus
export PATH=/mingw64/bin:\$PATH
But
- in the installation tree I got from msys, *there IS no c:/mingw64/bin*. - I have a root directory c:/msys64.
These are correct, the instructions are written from the point of view of a msys2 environment and not the Windows one. So /mingw64 refers to an msys2 path not a windows path. In windows the / would indeed be interpreted to %HOMEDRIVE%/mingw64 but in msys2 this refers to what the msy2 filesystem has been mounted to. This is usually C:\msys64. Tamar@Yelow ~/ghc2> cygpath -w /mingw64/bin/ E:\msys64\mingw64\bin\ the msys2 tool cygpath converts between the two usually on demand. but you can query it for paths. What the instructions intended was for you to modify your msys2 environment, not your Windows one, as generally putting Cygwin derived programs on your global windows path is not advisable.
- - Most binaries (eg *bash*, *find*) seem to be in c:/mingw64/usr/bin
Yes, any binary that is a posix port, e.g. depends on newlib crt instead
of the Microsoft runtime goes into the usual /usr/bin folder. This would include core-utils, make etc.
- - But there is also c:/msys64/mingw64/bin, which (perhaps as a result of the pacman step) has lots more stuf like *ar*, *cc*, etc.
This folder is meant to contain native ports, e.g. programs that have been
"ported" to work on Windows using a standard windows runtime. These have no dependencies on newlib/Cygwin. This is the distinctions between these two folders.
-
All very confusing. For now I have put both c:/msys64/usr/bin and c:/msys64/mingw64/bin in my path. That seems to work, but is clearly not what the instructions say.
The instruction could be somewhat clearer here, but they are intended to only affect your msys2 installation, and never your global Windows system.
Thanks
Simon
*From:* ghc-devs
*On Behalf Of *Shao, Cheng *Sent:* 26 March 2018 10:59 *To:* ghc-devs@haskell.org *Subject:* Re: Windows Hi Simon,
If the build environment is managed by an MSYS2 installation, then the MinGW64 shell startup script automatically sets up "MSYSTEM" for you. It can be launched like "C:\msys64\msys2_shell.cmd -mingw64 -mintty".
On Mon, Mar 26, 2018 at 5:46 PM, Simon Peyton Jones via ghc-devs < ghc-devs@haskell.org> wrote:
Making it part of the error message would be v helpful.
I have added a section to "Troubleshooting" on https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows
But it should really be part of the instructions higher up to sa export MSYSTEM=MINGW64
Might someone do that? I wasn't quite sure where
Simon
| -----Original Message----- | From: ghc-devs
On Behalf Of Ben Gamari | Sent: 24 March 2018 16:42 | To: Gabor Greif ; lonetiger@gmail.com | Cc: ghc-devs@haskell.org | Subject: Re: Windows | | Gabor Greif writes: | | > Just an idea... | > | > could this hint be part of the `configure` error message? | > | Indeed. See D4526. | | Cheers, | | - Ben _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (6)
-
Ben Gamari
-
Gabor Greif
-
lonetiger@gmail.com
-
Phyx
-
Shao, Cheng
-
Simon Peyton Jones