-
Notifications
You must be signed in to change notification settings - Fork 613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove getent calls from /etc/bash.bashrc #146
Conversation
Yes, I would like that better. Something similar to b333b6a. |
@dscho Before I go down that route, can you tell me if there are any expected differences (code signing excluded) when manually building an installer? It turns out that the If we can get the massive size increase resolved, I'm thinking that integrating That being said, I'll be happy to pursue the removal of |
In case there's any confusion, my build process was:
|
I occasionally see a CI build resulting in a Portable git of 45MB (instead of the expected 35MB). I thought that I had resolved this issue by upgrading p7zip, but apparently not... My preference is still to remove the |
OK, I'll go ahead and proceed with removing the Incidentally, my build of the 64-bit portable installer ended up being a whopping 89 MB. No idea what's going on with that, especially since it was a fresh install of the SDK with no changes. I'll see if I can figure it out later... once the current PR is out of the way. |
@dscho I've pushed a new commit which removes the I'm still getting surprisingly large installers (48 MB for the standard 64-bit installer, and a whopping 89 MB for 64-bit portable) for some reason, but that's clearly unrelated to the commit in question. |
git-extra/git-extra.install.in
Outdated
end="$(($start+${line%%:*}+1))" | ||
sed -ie "${start},${end}d" /etc/bash.bashrc | ||
fi | ||
fi |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
You're clearly more familiar with |
Remove calls to the "getent" utility, which is not currently included in Git for Windows, from the system /etc/bash.bashrc file. Its presence is not usually a problem, but when Cygwin is installed and also in the PATH then Git Bash will encounter the following error during startup (see issue #1226). 1 [main] getent (14752) C:\cygwin\bin\getent.exe: *** fatal error - cygheap base mismatch detected - 0x1802FF408/0x180304408. Signed-off-by: Adric Norris <[email protected]>
I'm getting closer. The current version (based upon your suggestion) seems to work perfectly if I run the commands manually from within the SDK. For some reason, however, the lines are still uncommented after building and installing a new installer. I'm currently trying to figure out if |
I tested this locally and it worked... I had to build & install a new In any case, this fix is part of git-extra 1.1.145.7d1d6ea. Thank you so much! |
FWIW the huge size may be due to unstripped binaries: by default, Git for Windows' SDK builds Git with debug information and installs those executables unstripped. If you do not reinstall the |
Ah, that explains it. On a related note, thank you @dscho for taking the time to explain the recommended |
I figured it was something like that, but hadn't tracked it all the way down yet. Thanx for the info! |
@landstander668 you're welcome, and thank you for this lovely Pull Request! |
This is my initial attempt to add
getent
to the Git for Windows package, in order to address issue #1226. It seems to work exactly as expected for the 64-bit release on Windows 10, but I want to do some additional validation (portable and SDK installers, as well as the 32-bit variants) before considering it ready to merge... I probably won't have an opportunity to do this until Sunday.The only downside I see thus far is that it increased the size of the installer binary by approximately 10 MB, which is roughly 20 percent. This might be enough of a jump to be problematic for folks with less-than-ideal connectivity speeds.
An alternate, potential fix would be to include just /usr/bin/getent (along with any hard dependencies) instead of the full getent package. That will of course require more effort to implement and validate, and I don't know if GfW already has a precedent for that. So I'm currently unsure if this would be a good idea to pursue.
A simpler alternate fix would be to remove the
getent
calls from /etc/bash.bashrc. That would remove the ability to customize the prompt based on admin/non-admin user status (see this commit), when that status can actually be determined... it apparently requiresgroup: db
to be enabled, which is disabled by default in GfW. I assume this would require in-place editing of bash.bashrc during either the installer build or installation, however, since it's part of MSYS2-packages rather than being directly owned by GfW.@dscho Do you have any preference as to the possible approaches?
Add
getent
to the list of pacman MSYS2 packages to be included in thebuild. This utility is used, if available, by /etc/bash.bashrc in order
to customize the shell prompt to distinguish between admin and non-admin
users. It is not currently included in Git for Windows, however.
Normally its omission is not a problem, but when Cygwin is installed
and also in the PATH -- even if Git appears first -- then Git Bash will
encounter the following error during startup (from issue #1226).
1 [main] getent (14752) C:\cygwin\bin\getent.exe: *** fatal error - cygheap base mismatch detected - 0x1802FF408/0x180304408.
During test builds, this increased the size of the 64-bit installer by
approximately 10 MB (47,154 vs 37,848 MB).
Signed-off-by: Adric Norris [email protected]