Skip to content

Commit

Permalink
Merge branch 'sdk-installer'
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dscho committed Feb 16, 2016
2 parents afd777e + f740cf9 commit c58e4fa
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 30 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ The build environment brings all the necessary parts required to build a Git for

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).

## MSys2
## MSYS2

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.

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.
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.

### The difference between MSys2 and MinGW
### The difference between MSYS2 and MinGW

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.
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.

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

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.
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.

### MinGW packages

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

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`.

### MSys2 packages
### MSYS2 packages

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

```sh
cd /usr/src/MSYS2-packages
git fetch
git checkout master
```

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`.
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`.

## Installer generators

Expand Down
2 changes: 1 addition & 1 deletion get-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ do
;;
esac

# Work around mismatched version uploaded in MSys2
# Work around mismatched version uploaded in MSYS2
case $name-$version in
dash-0.5.8-1) version=0.5.8-2;;
mingw-w64-*-antiword-0.37-2) version=0.37-1;;
Expand Down
14 changes: 7 additions & 7 deletions installer/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Git is licensed under the GNU Public License version 2.

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).

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.
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.

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

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

* 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.
* 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).
* 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).
* 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).
* 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.
* 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).
* More file locking issues ("Unlink of file ... failed. Should I try again?") [were fixed](https://github.com/git-for-windows/git/issues/500).
Expand All @@ -94,7 +94,7 @@ This package contains software from a number of other projects including Bash, z
### New Features

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

## Bug Fixes

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

### Bug Fixes

* 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.
* 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.
* 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.
* The installer [no longer freezes](https://github.com/git-for-windows/git/issues/351) when there are interactive commands in the user's `.profile`.
* `git rebase --skip` [was speeded up again](https://github.com/git-for-windows/git/issues/365).
Expand Down Expand Up @@ -341,8 +341,8 @@ This package contains software from a number of other projects including Bash, z
### Bug Fixes
* Fixed a regression where *Git Bash* would not start properly on Windows XP
* Tab completion works like on Linux and MacOSX (double-Tab required to show ambiguous completions)
* In 32-bit setups, all the MSys2 `.dll`'s address ranges are adjusted ("auto-rebased") as part of the installation process
* The post-install scripts of MSys2 are now executed as part of the installation process, too
* In 32-bit setups, all the MSYS2 `.dll`'s address ranges are adjusted ("auto-rebased") as part of the installation process
* The post-install scripts of MSYS2 are now executed as part of the installation process, too
* All files that are part of the installation will now be registered so they are deleted upon uninstall

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

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

### Backwards-incompatible changes
Expand Down
2 changes: 1 addition & 1 deletion installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ begin
RdbBashTerminal[GB_MinTTY]:=TRadioButton.Create(BashTerminalPage);
with RdbBashTerminal[GB_MinTTY] do begin
Parent:=BashTerminalPage.Surface;
Caption:='Use MinTTY (the default terminal of MSys2)';
Caption:='Use MinTTY (the default terminal of MSYS2)';
Left:=ScaleX(4);
Top:=ScaleY(8);
Width:=ScaleX(405);
Expand Down
2 changes: 1 addition & 1 deletion pacman-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ die () {
fifo_find="/var/tmp/disowned.find"
fifo_pacman="/var/tmp/disowned.pacman"

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

Expand Down
2 changes: 1 addition & 1 deletion please.sh
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ upload () { # <package>

# Here, we exploit the fact that the 64-bit SDK is either the only
# SDK where the package was built (MinGW) or it agrees with thw 32-bit
# SDK's build product (MSys2).
# SDK's build product (MSYS2).
(cd "$sdk64/$path" &&
test -z "$(git rev-list @{u}..)" ||
if test refs/heads/master = \
Expand Down
34 changes: 26 additions & 8 deletions sdk-installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test -z "$1" && {
}

die () {
echo "$*" >&1
echo "$*" >&2
exit 1
}

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

fileList="$(cd / && echo \
etc/pacman.* \
dlls_for_exes () {
# Add DLLs' transitive dependencies
dlls=
todo="$* "
while test -n "$todo"
do
path=${todo%% *}
todo=${todo#* }
case "$path" in ''|' ') continue;; esac
for dll in $(objdump -p "$path" |
sed -n 's/^\tDLL Name: msys-/usr\/bin\/msys-/p')
do
case "$dlls" in
*"$dll"*) ;; # already found
*) dlls="$dlls $dll"; todo="$todo /$dll ";;
esac
done
done
echo "$dlls"
}

fileList="etc/pacman.conf \
etc/pacman.d \
usr/bin/pacman.exe \
usr/bin/curl.exe \
usr/bin/gpg.exe \
$(ldd /usr/bin/gpg.exe /usr/bin/curl.exe |
sed -n 's/.* \/\(usr\/bin\/.*\.dll\) .*/\1/p' |
sort |
uniq) \
$(dlls_for_exes /usr/bin/gpg.exe /usr/bin/curl.exe)
usr/ssl/certs/ca-bundle.crt \
var/lib/pacman)
var/lib/pacman
$FAKEROOTDIR/setup-git-sdk.bat $FAKEROOTDIR/etc $FAKEROOTDIR/usr"

type 7za ||
Expand Down
6 changes: 3 additions & 3 deletions sdk-installer/setup-git-sdk.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@REM set PATH
@set PATH=%cwd%\usr\bin;%PATH%

@REM set MSYSTEM so that MSys2 starts up in the correct mode
@REM set MSYSTEM so that MSYS2 starts up in the correct mode
@set MSYSTEM=MINGW@@BITNESS@@

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

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

Expand Down

0 comments on commit c58e4fa

Please sign in to comment.