Hadrian: generate JUnit testsuite report in Linux CI job
[ghc.git] / boot
diff --git a/boot b/boot
index f913724..1d7a01f 100755 (executable)
--- a/boot
+++ b/boot
@@ -13,7 +13,6 @@ cwd = os.getcwd()
 
 parser = argparse.ArgumentParser()
 parser.add_argument('--validate', action='store_true', help='Run in validate mode')
-parser.add_argument('--required-tag', type=str, action='append', default=set())
 parser.add_argument('--hadrian', action='store_true', help='Do not assume the make base build system')
 args = parser.parse_args()
 
@@ -51,11 +50,11 @@ def check_for_url_rewrites():
 
             Or start over, and clone the GHC repository from the haskell server:
 
-              git clone --recursive git://git.haskell.org/ghc.git
+              git clone --recursive git@gitlab.haskell.org:ghc/ghc.git
 
             For more information, see:
-              * https://ghc.haskell.org/trac/ghc/wiki/Newcomers or
-              * https://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources#CloningfromGitHub
+              * https://gitlab.haskell.org/ghc/ghc/wikis/newcomers or
+              * https://gitlab.haskell.org/ghc/ghc/wikis/building/getting-the-sources#cloning-from-github
         """)
 
 def check_boot_packages():
@@ -65,16 +64,16 @@ def check_boot_packages():
         if l.startswith('#'):
             continue
 
-        parts = l.split(' ')
+        parts = [part for part in l.split(' ') if part]
         if len(parts) != 4:
             die("Error: Bad line in packages file: " + l)
 
         dir_ = parts[0]
         tag = parts[1]
 
-        # If $tag is not "-" then it is an optional repository, so its
+        # If tag is not "-" then it is an optional repository, so its
         # absence isn't an error.
-        if tag in args.required_tag:
+        if tag == '-':
             # We would like to just check for a .git directory here,
             # but in an lndir tree we avoid making .git directories,
             # so it doesn't exist. We therefore require that every repo
@@ -82,9 +81,9 @@ def check_boot_packages():
             license_path = os.path.join(dir_, 'LICENSE')
             if not os.path.isfile(license_path):
                 die("""\
-                    Error: %s doesn't exist" % license_path)
+                    Error: %s doesn't exist
                     Maybe you haven't run 'git submodule update --init'?
-                    """)
+                    """ % license_path)
 
 # Create libraries/*/{ghc.mk,GNUmakefile}
 def boot_pkgs():
@@ -116,7 +115,7 @@ def boot_pkgs():
             if os.path.isfile(cabal):
                 # strip both .cabal and .in
                 pkg = os.path.splitext(os.path.splitext(os.path.basename(cabal))[0])[0]
-                top = package
+                top = os.path.join(*['..'] * len(os.path.normpath(package).split(os.path.sep)))
 
                 ghc_mk = os.path.join(package, 'ghc.mk')
                 print('Creating %s' % ghc_mk)
@@ -151,7 +150,7 @@ def autoreconf():
         # Get the normalized ACLOCAL_PATH for Windows
         # This is necessary since on Windows this will be a Windows
         # path, which autoreconf doesn't know doesn't know how to handle.
-        ac_local = os.environ['ACLOCAL_PATH']
+        ac_local = os.getenv('ACLOCAL_PATH', '')
         ac_local_arg = re.sub(r';', r':', ac_local)
         ac_local_arg = re.sub(r'\\', r'/', ac_local_arg)
         ac_local_arg = re.sub(r'(\w):/', r'/\1/', ac_local_arg)
@@ -187,10 +186,11 @@ def check_build_mk():
             than simply building it to use it.
 
             For information on creating a mk/build.mk file, please see:
-                http://ghc.haskell.org/trac/ghc/wiki/Building/Using#Buildconfiguration
+                https://gitlab.haskell.org/ghc/ghc/wikis/building/using#build-configuration
             """))
 
 check_for_url_rewrites()
+check_boot_packages()
 if not args.hadrian:
     boot_pkgs()
 autoreconf()