Commit 554be5e7 authored by Thomas Miedema's avatar Thomas Miedema
Browse files

Build system: detect when user cloned from GitHub

Cloning the ghc repository from GitHub doesn't work out of the box. It
requires installing some special url rewrites into ~/.gitconfig. The
build fails mysteriously if you forget. This patch tries to detect when
you cloned from GitHub, and warns you if you didn't set those url

This hopefully lowers to barrier to contribute to GHC by a tiny bit. At
least one /r/haskell user ran into this recently.

Test Plan:
cloned from github, ran ./boot, saw the message. Installed url
rewrites, and ran ./boot again, didn't see the message.

Reviewed by: austin

Differential Revision:
parent c6b82e99
......@@ -53,6 +53,40 @@ sub sanity_check_tree {
my $tag;
my $dir;
if (-d ".git" &&
system("git config remote.origin.url | grep > /dev/null") == 0 &&
system("git config --get-regexp '^url.**/packages-.insteadOf' > /dev/null") != 0) {
# If we cloned from github, make sure the url rewrites are set.
# Otherwise 'git submodule update --init' prints confusing errors.
die <<EOF;
It seems you cloned this repository from GitHub. But your git config files
don't contain the url rewrites that are needed to make this work (GitHub
doesn't support '/' in repository names, so we use a different naming scheme
for the submodule repositories there).
Please run the following commands first:
git config --global url."git://".insteadOf git://
git config --global url."".insteadOf
git config --global url."".insteadOf
git config --global url."ssh://git\".insteadOf ssh://git\
git config --global url."git\".insteadOf git\
And then:
git submodule update --init
Or start over, and clone the GHC repository from the haskell server:
git clone --recursive git://
For more information, see:
* or
# Check that we have all boot packages.
open PACKAGES, "< packages";
while (<PACKAGES>) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment