More windows

Simon Peyton Jones simonpj at
Wed Apr 4 21:26:19 UTC 2018

The solution seems to be to cache the user info locally instead of it having to query the domain controller everytime.

Ah yes: here’s a better expressed post:

I did the following

  *   commented out the “db” part for passwd and group in c:/msys64/etc/nsswitch.conf, to give this:

# Begin /etc/nsswitch.conf

passwd: files #db

group: files #db

db_enum: cache builtin

db_home: windows

db_shell: cygwin desc

db_gecos: cygwin desc

# End /etc/nsswitch.conf

  *   Note that I also set db_home to ‘windows’, so that it gets my windows home directory.  I think an explicit path would also be OK
  *   However I discovered that having just “files” for “passwd” in nsswitch.conf means that ssh looks in c:/msys64/etc/passwd to find the home directory for .ssh, totally ignoring the $HOME environment variable, and ignoring the db_home setting.
  *   But there IS no /etc/passwd file!   So I created one

mkpasswd -c > /etc/passwd

mkgroup -c > /etc/group

And then I manually edited /etc/passwd to put in the correct home directory.

What a saga!

Is it faster now?  Hard to tell.

From: Phyx <lonetiger at>
Sent: 03 April 2018 07:00
To: Simon Peyton Jones <simonpj at>
Cc: ghc-devs at
Subject: Re: More windows

Hi Simon,

Hmm I'm not sure about replacing sh with bash. I think bash has some Non-POSIX extensions that may affect the behavior of valid posix scripts.

Is bash --login slow as well? How about once sh or bash starts, are commands still slow then?

I assume your computer is domain joined and you may be hitting a very long standing issue with certain domain joined machines<>

The solution seems to be to cache the user info locally instead of it having to query the domain controller everytime. See solution 2 here<> for instructions

Does that help the problem?

I believe you had a similar problem last time setting up a new machine. At that time magit was also slow.

Kind regards,

On Mon, Apr 2, 2018, 23:23 Simon Peyton Jones <simonpj at<mailto:simonpj at>> wrote:
I’ve noticed that “sh” (which is invoked at lot by make etc) takes AGES to start up.  At least I think it’s ‘sh’ that is causing the delay.
I think it’s c:/msys64/usr/bin/sh.exe
From searching the web (eg<>)  it seems likely that it executes c:/msys64/etc/profile first.
And If I put an ‘echo’ at the start and end of that file, they do seem to take place with a significant gap between them.
I have not started sprinkling more echos, but does that ring any bells?
Can I replace ‘sh’ with c:/msys64/usr/bin/bash.exe, which seems to be faster?   (My evnt variable SHELL already points to bash.exe. )  And if so, how would I do that? An environment variable.  Physically copy bash.exe to sh.exe?  Or what?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list