Skip to content

Commit c58e4fa

Browse files
committed
Merge branch 'sdk-installer'
This topic branch brings various fixes/improvements to the SDK installer so that we can release a new SDK installer, which in turn addresses git-for-windows/git#537 and git-for-windows/git#630 Signed-off-by: Johannes Schindelin <[email protected]>
2 parents afd777e + f740cf9 commit c58e4fa

8 files changed

+48
-30
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ The build environment brings all the necessary parts required to build a Git for
2020

2121
The most important part of Git for Windows is [Git](https://git-scm.com/), obviously. The Git for Windows project maintains [a friendly fork](https://github.com/git-for-windows/git) of the "upstream" [Git project](https://github.com/git/git). The idea is that the Git for Windows repository serves as a test bed to develop patches and patch series that are specific to the Windows port, and once the patches stabilized, they are [submitted upstream](https://github.com/git-for-windows/git/tree/master/Documentation/SubmittingPatches).
2222

23-
## MSys2
23+
## MSYS2
2424

2525
Git is not a monolithic executable, but consists of a couple of executables written in C, a couple of Bash scripts, a couple of Perl scripts, and a couple of Tcl/Tk scripts. Some parts (not supported by Git for Windows yet) are written in other script languages, still.
2626

27-
To support those scripts, Git for Windows uses [MSys2](https://msys2.github.io/), a project providing a minimal POSIX emulation layer (based on [Cygwin](https://cygwin.com)), a package management system (named "Pacman", borrowed from Arch Linux) and a number of packages that are kept up-to-date by an active team of maintainers, including Bash, Perl, Subversion, etc.
27+
To support those scripts, Git for Windows uses [MSYS2](https://msys2.github.io/), a project providing a minimal POSIX emulation layer (based on [Cygwin](https://cygwin.com)), a package management system (named "Pacman", borrowed from Arch Linux) and a number of packages that are kept up-to-date by an active team of maintainers, including Bash, Perl, Subversion, etc.
2828

29-
### The difference between MSys2 and MinGW
29+
### The difference between MSYS2 and MinGW
3030

31-
MSys2 refers to the libraries and programs that use the POSIX emulation layer ("msys2 runtime", derived from Cygwin's `cygwin1.dll`). It is very easy to port libraries and programs from Unix/Linux because most of the POSIX semantics is emulated reasonably well, for example [the `fork()` function](http://pubs.opengroup.org/onlinepubs/000095399/functions/fork.html). Bash and Perl are examples of MSys2 programs.
31+
MSYS2 refers to the libraries and programs that use the POSIX emulation layer ("msys2 runtime", derived from Cygwin's `cygwin1.dll`). It is very easy to port libraries and programs from Unix/Linux because most of the POSIX semantics is emulated reasonably well, for example [the `fork()` function](http://pubs.opengroup.org/onlinepubs/000095399/functions/fork.html). Bash and Perl are examples of MSYS2 programs.
3232

3333
MinGW refers to libraries and programs that are compiled using GNU tools but do not require any POSIX semantics, instead relying on the standard Win32 API and the C runtime library. MinGW stands for "Minimal GNU for Windows". Examples: cURL (a library to talk to remote servers via HTTP(S), (S)FTP, etc), emacs, Inkscape, etc
3434

35-
The POSIX emulation layer of MSys2 binaries is convenient, but comes at a cost: Typically, MSys2 programs are noticably slower than their MinGW counterparts (if there are such counterparts). As a consequence, the Git for Windows project tries to provide as many components as possible as MinGW binaries.
35+
The POSIX emulation layer of MSYS2 binaries is convenient, but comes at a cost: Typically, MSYS2 programs are noticably slower than their MinGW counterparts (if there are such counterparts). As a consequence, the Git for Windows project tries to provide as many components as possible as MinGW binaries.
3636

3737
### MinGW packages
3838

@@ -48,17 +48,17 @@ The packages inside the `/usr/src/MINGW-packages/` directory can then be built b
4848

4949
MinGW packages can be built for both `i686` and `x86_64` architectures at the same time by making sure that both toolchains are installed (`pacman -Sy mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain`) before running `makepkg-mingw`.
5050

51-
### MSys2 packages
51+
### MSYS2 packages
5252

53-
The MSys2 packages are built from the `MSYS2-packages` repository which can be initialized in the Git SDK Bash via
53+
The MSYS2 packages are built from the `MSYS2-packages` repository which can be initialized in the Git SDK Bash via
5454

5555
```sh
5656
cd /usr/src/MSYS2-packages
5757
git fetch
5858
git checkout master
5959
```
6060

61-
To build the packages inside the `/usr/src/MSYS2-packages/` directory, the user has to launch a special shell by double-clicking the `msys2_shell.bat` script in the top-level directory of the Git SDK, switch the working directory to the appropriate subdirectory of `/usr/src/MSYS2-packages/` and then execute `makepkg -s`. Before the first MSys2 package is built, the prerequisite development packages have to be installed by executing `pacman -Sy base-devel binutils`.
61+
To build the packages inside the `/usr/src/MSYS2-packages/` directory, the user has to launch a special shell by double-clicking the `msys2_shell.bat` script in the top-level directory of the Git SDK, switch the working directory to the appropriate subdirectory of `/usr/src/MSYS2-packages/` and then execute `makepkg -s`. Before the first MSYS2 package is built, the prerequisite development packages have to be installed by executing `pacman -Sy base-devel binutils`.
6262

6363
## Installer generators
6464

get-sources.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ do
6262
;;
6363
esac
6464

65-
# Work around mismatched version uploaded in MSys2
65+
# Work around mismatched version uploaded in MSYS2
6666
case $name-$version in
6767
dash-0.5.8-1) version=0.5.8-2;;
6868
mingw-w64-*-antiword-0.37-2) version=0.37-1;;

installer/ReleaseNotes.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Git is licensed under the GNU Public License version 2.
3030

3131
Git for Windows also contains Embedded CAcert Root Certificates. For more information please go to [https://www.cacert.org/policy/RootDistributionLicense.php](https://www.cacert.org/policy/RootDistributionLicense.php).
3232

33-
This package contains software from a number of other projects including Bash, zlib, curl, msmtp, tcl/tk, perl, MSys2 and a number of libraries and utilities from the GNU project, licensed under the GNU Public License. Likewise, it contains Perl which is dual licensed under the GNU Public License and the Artistic License.
33+
This package contains software from a number of other projects including Bash, zlib, curl, msmtp, tcl/tk, perl, MSYS2 and a number of libraries and utilities from the GNU project, licensed under the GNU Public License. Likewise, it contains Perl which is dual licensed under the GNU Public License and the Artistic License.
3434

3535
## Changes since Git for Windows v2.7.1(2) (February 12th 2016)
3636

@@ -74,7 +74,7 @@ This package contains software from a number of other projects including Bash, z
7474

7575
* When installing as administrator, we [no longer offer the option to install quiicklaunch icons](https://github.com/git-for-windows/build-extra/commit/a13ffd7c3fa24e2ac1ef3561d7a7f09a0b924338) because quicklaunch icons can only be installed per-user.
7676
* If a `~/.bashrc` is detected without a `~/.bash_profile`, the generated file will now [also source `~/.profile` if that exists](https://github.com/git-for-windows/build-extra/pull/91).
77-
* The environment variable `HOME` can now be used to set the home directory [even when running with accounts that are part of a different domain than the current (non-domain-joined) machine](https://github.com/git-for-windows/msys2-runtime/commit/9660c5ffe82b921dd2193efa18e9721f47a6b22f) (in which case the MSys2 runtime has no way to emulate POSIX-style UIDs).
77+
* The environment variable `HOME` can now be used to set the home directory [even when running with accounts that are part of a different domain than the current (non-domain-joined) machine](https://github.com/git-for-windows/msys2-runtime/commit/9660c5ffe82b921dd2193efa18e9721f47a6b22f) (in which case the MSYS2 runtime has no way to emulate POSIX-style UIDs).
7878
* Git [can now fetch and push via HTTPS](https://github.com/Alexpux/MINGW-packages/pull/986) even when the `http.sslCAInfo` config variable was unset.
7979
* Git for Windows is now [handling the case gracefully where the current user has no permission to list the parent of the current directory](https://github.com/git-for-windows/git/pull/606).
8080
* More file locking issues ("Unlink of file ... failed. Should I try again?") [were fixed](https://github.com/git-for-windows/git/issues/500).
@@ -94,7 +94,7 @@ This package contains software from a number of other projects including Bash, z
9494
### New Features
9595

9696
* Comes with [Git v2.6.4](http://article.gmane.org/gmane.linux.kernel/2103498).
97-
* Also available as `.tar.bz2` packages (you need an MSys2/Cygwin-compatible unpacker to recreate the symbolic links correctly).
97+
* Also available as `.tar.bz2` packages (you need an MSYS2/Cygwin-compatible unpacker to recreate the symbolic links correctly).
9898

9999
## Bug Fixes
100100

@@ -209,7 +209,7 @@ This package contains software from a number of other projects including Bash, z
209209

210210
### Bug Fixes
211211

212-
* The MSys2 runtime was taught [not to look hard for groups](https://github.com/git-for-windows/git/issues/193), speeding up *Git Bash*'s startup time.
212+
* The MSYS2 runtime was taught [not to look hard for groups](https://github.com/git-for-windows/git/issues/193), speeding up *Git Bash*'s startup time.
213213
* A [work around](https://github.com/git-for-windows/git/issues/361) was added for [issues](https://github.com/git-for-windows/git/wiki/32-bit-issues) when installing 32-bit Git for Windows on 64-bit Windows 10.
214214
* The installer [no longer freezes](https://github.com/git-for-windows/git/issues/351) when there are interactive commands in the user's `.profile`.
215215
* `git rebase --skip` [was speeded up again](https://github.com/git-for-windows/git/issues/365).
@@ -341,8 +341,8 @@ This package contains software from a number of other projects including Bash, z
341341
### Bug Fixes
342342
* Fixed a regression where *Git Bash* would not start properly on Windows XP
343343
* Tab completion works like on Linux and MacOSX (double-Tab required to show ambiguous completions)
344-
* In 32-bit setups, all the MSys2 `.dll`'s address ranges are adjusted ("auto-rebased") as part of the installation process
345-
* The post-install scripts of MSys2 are now executed as part of the installation process, too
344+
* In 32-bit setups, all the MSYS2 `.dll`'s address ranges are adjusted ("auto-rebased") as part of the installation process
345+
* The post-install scripts of MSYS2 are now executed as part of the installation process, too
346346
* All files that are part of the installation will now be registered so they are deleted upon uninstall
347347

348348
## Changes since Git-2.3.6-preview20150425
@@ -371,7 +371,7 @@ This package contains software from a number of other projects including Bash, z
371371

372372
### New Features
373373
* Comes with Git 2.3.5 plus Windows-specific patches.
374-
* First release based on [MSys2](https://msys2.github.io/).
374+
* First release based on [MSYS2](https://msys2.github.io/).
375375
* Support for 64-bit!
376376

377377
### Backwards-incompatible changes

installer/install.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ begin
903903
RdbBashTerminal[GB_MinTTY]:=TRadioButton.Create(BashTerminalPage);
904904
with RdbBashTerminal[GB_MinTTY] do begin
905905
Parent:=BashTerminalPage.Surface;
906-
Caption:='Use MinTTY (the default terminal of MSys2)';
906+
Caption:='Use MinTTY (the default terminal of MSYS2)';
907907
Left:=ScaleX(4);
908908
Top:=ScaleY(8);
909909
Width:=ScaleX(405);

pacman-helper.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ die () {
3131
fifo_find="/var/tmp/disowned.find"
3232
fifo_pacman="/var/tmp/disowned.pacman"
3333

34-
# MSys2's mingw-w64-$arch-ca-certificates seem to lag behind ca-certificates
34+
# MSYS2's mingw-w64-$arch-ca-certificates seem to lag behind ca-certificates
3535
CURL_CA_BUNDLE=/usr/ssl/certs/ca-bundle.crt
3636
export CURL_CA_BUNDLE
3737

please.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ upload () { # <package>
569569

570570
# Here, we exploit the fact that the 64-bit SDK is either the only
571571
# SDK where the package was built (MinGW) or it agrees with thw 32-bit
572-
# SDK's build product (MSys2).
572+
# SDK's build product (MSYS2).
573573
(cd "$sdk64/$path" &&
574574
test -z "$(git rev-list @{u}..)" ||
575575
if test refs/heads/master = \

sdk-installer/release.sh

+26-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test -z "$1" && {
88
}
99

1010
die () {
11-
echo "$*" >&1
11+
echo "$*" >&2
1212
exit 1
1313
}
1414

@@ -49,17 +49,35 @@ sed -e 's/^#\(XferCommand.*curl\).*/\1 --anyauth -C - -L -f %u >%o/' \
4949
</etc/pacman.conf >"$FAKEROOTDIR/etc/pacman.conf.proxy" ||
5050
die "Could not copy extra files into fake root"
5151

52-
fileList="$(cd / && echo \
53-
etc/pacman.* \
52+
dlls_for_exes () {
53+
# Add DLLs' transitive dependencies
54+
dlls=
55+
todo="$* "
56+
while test -n "$todo"
57+
do
58+
path=${todo%% *}
59+
todo=${todo#* }
60+
case "$path" in ''|' ') continue;; esac
61+
for dll in $(objdump -p "$path" |
62+
sed -n 's/^\tDLL Name: msys-/usr\/bin\/msys-/p')
63+
do
64+
case "$dlls" in
65+
*"$dll"*) ;; # already found
66+
*) dlls="$dlls $dll"; todo="$todo /$dll ";;
67+
esac
68+
done
69+
done
70+
echo "$dlls"
71+
}
72+
73+
fileList="etc/pacman.conf \
74+
etc/pacman.d \
5475
usr/bin/pacman.exe \
5576
usr/bin/curl.exe \
5677
usr/bin/gpg.exe \
57-
$(ldd /usr/bin/gpg.exe /usr/bin/curl.exe |
58-
sed -n 's/.* \/\(usr\/bin\/.*\.dll\) .*/\1/p' |
59-
sort |
60-
uniq) \
78+
$(dlls_for_exes /usr/bin/gpg.exe /usr/bin/curl.exe)
6179
usr/ssl/certs/ca-bundle.crt \
62-
var/lib/pacman)
80+
var/lib/pacman
6381
$FAKEROOTDIR/setup-git-sdk.bat $FAKEROOTDIR/etc $FAKEROOTDIR/usr"
6482

6583
type 7za ||

sdk-installer/setup-git-sdk.bat

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@REM set PATH
1111
@set PATH=%cwd%\usr\bin;%PATH%
1212

13-
@REM set MSYSTEM so that MSys2 starts up in the correct mode
13+
@REM set MSYSTEM so that MSYS2 starts up in the correct mode
1414
@set MSYSTEM=MINGW@@BITNESS@@
1515

1616
@REM need to rebase just to make sure that it still works even with Windows 10
@@ -44,7 +44,7 @@
4444
@REM Maybe we need a proxy?
4545
@IF %counter% GEQ 2 @(
4646
@ECHO.
47-
@ECHO There was a problem accessing the MSys2 repositories
47+
@ECHO There was a problem accessing the MSYS2 repositories
4848
@ECHO If your setup requires an HTTP proxy to access the web,
4949
@ECHO please specify it here, otherwise leave it empty.
5050
@ECHO.
@@ -126,7 +126,7 @@
126126
)
127127

128128
@REM Before running a shell, let's prevent complaints about "permission denied"
129-
@REM from MSys2's /etc/post-install/01-devices.post
129+
@REM from MSYS2's /etc/post-install/01-devices.post
130130
@MKDIR "%cwd%"\dev\shm 2> NUL
131131
@MKDIR "%cwd%"\dev\mqueue 2> NUL
132132

0 commit comments

Comments
 (0)