[Git][ghc/ghc][wip/fix-linters] 4 commits: gitlab-ci: Linters, don't allow to fail

Ben Gamari gitlab at gitlab.haskell.org
Fri Jun 7 15:01:46 UTC 2019



Ben Gamari pushed to branch wip/fix-linters at Glasgow Haskell Compiler / GHC


Commits:
2c9fbf09 by Matthew Pickering at 2019-06-07T14:55:49Z
gitlab-ci: Linters, don't allow to fail

Ben disabled them in cd85f8a71bb56cff332560e1d571b3406789fb71 but didn't
say how or why they were broken.

- - - - -
ecb99799 by Matthew Pickering at 2019-06-07T14:55:49Z
gitlab-ci: Don't run two submodule checking jobs on Marge jobs

- - - - -
1e3f59eb by Matthew Pickering at 2019-06-07T14:55:49Z
Fix two lint failures in rts/linker/MachO.c

- - - - -
20822dd7 by Ben Gamari at 2019-06-07T15:01:20Z
gitlab-ci: Use --unshallow when fetching for linters

GitLab creates a shallow clone. However, this means that we may not have
the base commit of an MR when linting, causing `git merge-base` to fail.
Fix this by passing `--unshallow` to `git fetch`, ensuring that we have
the entire history.

- - - - -


2 changed files:

- .gitlab-ci.yml
- rts/linker/MachO.c


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -49,13 +49,16 @@ stages:
 ############################################################
 
 ghc-linters:
-  allow_failure: true
   stage: lint
   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
   script:
-    - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
+    # GitLab creates a shallow clone which means that we may not have the base
+    # commit of the MR being tested (e.g. if the MR is quite old), causing `git
+    # merge-base` to fail.  Passing `--unshallow` to `git fetch` ensures that
+    # we have the entire history.
+    - git fetch --unshallow "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
     - base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
-    - "echo Merge base $base"
+    - "echo Linting changes between $base..$CI_COMMIT_SHA"
     #    - validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
     - validate-whitespace .git $(git rev-list $base..$CI_COMMIT_SHA)
     - .gitlab/linters/check-makefiles.py $base $CI_COMMIT_SHA
@@ -101,6 +104,9 @@ lint-submods-mr:
   only:
     refs:
       - merge_requests
+  except:
+    variables:
+      - $CI_MERGE_REQUEST_LABELS =~ /.*wip/marge_bot_batch_merge_job.*/
 
 .lint-changelogs:
   stage: lint


=====================================
rts/linker/MachO.c
=====================================
@@ -1220,7 +1220,7 @@ ocGetNames_MachO(ObjectCode* oc)
     IF_DEBUG(linker, debugBelch("ocGetNames_MachO: will load %d sections\n",
                                 oc->n_sections));
 
-#if defined (ios_HOST_OS)
+#if defined(ios_HOST_OS)
     for(int i=0; i < oc->n_sections; i++)
     {
         MachOSection * section = &oc->info->macho_sections[i];
@@ -1645,7 +1645,7 @@ ocResolve_MachO(ObjectCode* oc)
     {
         IF_DEBUG(linker, debugBelch("ocResolve_MachO: relocating section %d\n", i));
 
-#if defined aarch64_HOST_ARCH
+#if defined(aarch64_HOST_ARCH)
         if (!relocateSectionAarch64(oc, &oc->sections[i]))
             return 0;
 #else



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/4c3bb004ca8e2222732f1883425de2ac90b43e92...20822dd763f97708017b872c1a34e331fac2006f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/4c3bb004ca8e2222732f1883425de2ac90b43e92...20822dd763f97708017b872c1a34e331fac2006f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190607/fa052b41/attachment-0001.html>


More information about the ghc-commits mailing list