[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 6 commits: gitlab-ci: Disable shallow clones

Marge Bot gitlab at gitlab.haskell.org
Sat Jun 8 22:58:16 UTC 2019



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
b2f106f5 by Ben Gamari at 2019-06-08T18:02:02Z
gitlab-ci: Disable shallow clones

Previously we were passing `--unshallow` to `git fetch` in the linting
rules to ensure that the base commit which we were linting with respect
to was available. However, this breaks due to GitLab's re-use of
working directories since `git fetch --unshallow` fails on a repository
which is not currently shallow.

Given that `git fetch --unshallow` circumvents the efficiencies provided
by shallow clones anyways, let's just disable them entirely.

There is no documented way to do disable shallow clones but on checking
the GitLab implementation it seems that setting `GIT_DEPTH=0` should do
the trick.

- - - - -
4a72259d by Ben Gamari at 2019-06-08T18:40:55Z
gitlab-ci: Fix submodule linting of commits

There is no notion of a base commit when we aren't checking a merge
request. Just check the HEAD commit.

- - - - -
87540029 by Ben Gamari at 2019-06-08T20:44:55Z
gitlab-ci: Ensure that all commits on a branch are submodule-linted

The previous commit reworked things such that the submodule linter would
only run on the head commit. However, the linter only checks the
submodules which are touched by the commits it is asked to lint.
Consequently it would be possible for a bad submodule to sneak through.

Thankfully, we can use the handy CI_COMMIT_BEFORE_SHA attribute to
find the base commit of the push.

- - - - -
6817c640 by Alexandre Baldé at 2019-06-08T22:58:12Z
Explain that 'mappend' and '(<>)' should be the same [skip ci]

- - - - -
943662c5 by Matthew Pickering at 2019-06-08T22:58:12Z
hadrian: Properly partition options in sourceArgs

Previously if you build the `ghc` package then it would has the default
opts and the library opts. This is different behaviour to make where the
library opts are only reserved for things in the `libraries`
subdirectory (I believe)

Fixes #16716

- - - - -
97ba5bf5 by Ben Gamari at 2019-06-08T22:58:12Z
testsuite: Suppress ticks in T4918 output

As noted in #16741, this test otherwise breaks when `base` is compiled
with `-g`.

- - - - -


4 changed files:

- .gitlab-ci.yml
- hadrian/src/Settings/Default.hs
- libraries/base/GHC/Base.hs
- testsuite/tests/simplCore/should_compile/Makefile


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -8,6 +8,9 @@ variables:
   # .gitlab/win32-init.sh.
   WINDOWS_TOOLCHAIN_VERSION: 1
 
+  # Disable shallow clones; they break our linting rules
+  GIT_DEPTH: 0
+
 before_script:
   - python3 .gitlab/fix-submodules.py
   - git submodule sync --recursive
@@ -52,13 +55,7 @@ ghc-linters:
   stage: lint
   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
   script:
-    # Note [Unshallow clone for linting]
-    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    # 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
+    - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
     - base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
     - "echo Linting changes between $base..$CI_COMMIT_SHA"
     #    - validate-commit-msg .git $(git rev-list $base..$CI_COMMIT_SHA)
@@ -80,22 +77,14 @@ ghc-linters:
   stage: lint
   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
   script:
-    # See Note [Unshallow clone for linting]
-    - git fetch --unshallow "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
+    - git fetch "$CI_MERGE_REQUEST_PROJECT_URL" $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
     - base="$(git merge-base FETCH_HEAD $CI_COMMIT_SHA)"
-    - "echo Linting changes between $base..$CI_COMMIT_SHA"
+    - "echo Linting submodule changes between $base..$CI_COMMIT_SHA"
     - submodchecker .git $(git rev-list $base..$CI_COMMIT_SHA)
   dependencies: []
   tags:
     - lint
 
-lint-submods:
-  extends: .lint-submods
-  only:
-    refs:
-      - master
-      - /ghc-[0-9]+\.[0-9]+/
-
 lint-submods-marge:
   extends: .lint-submods
   only:
@@ -116,6 +105,16 @@ lint-submods-mr:
     variables:
       - $CI_MERGE_REQUEST_LABELS =~ /.*wip/marge_bot_batch_merge_job.*/
 
+lint-submods-branch:
+  extends: .lint-submods
+  script:
+    - "echo Linting submodule changes between $CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA"
+    - submodchecker .git $(git rev-list $CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA)
+  only:
+    refs:
+      - master
+      - /ghc-[0-9]+\.[0-9]+/
+
 .lint-changelogs:
   stage: lint
   image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"


=====================================
hadrian/src/Settings/Default.hs
=====================================
@@ -179,7 +179,10 @@ sourceArgs :: SourceArgs -> Args
 sourceArgs SourceArgs {..} = builder Ghc ? mconcat
     [ hsDefault
     , getContextData hcOpts
-    , libraryPackage   ? hsLibrary
+    -- `compiler` is also a library but the specific arguments that we want
+    -- to apply to that are given by the hsCompiler option. `ghc` is an
+    -- executable so we don't have to exclude that.
+    , libraryPackage   ? notM (packageOneOf [compiler]) ? hsLibrary
     , package compiler ? hsCompiler
     , package ghc      ? hsGhc ]
 


=====================================
libraries/base/GHC/Base.hs
=====================================
@@ -271,6 +271,9 @@ class Semigroup a => Monoid a where
         --
         -- __NOTE__: This method is redundant and has the default
         -- implementation @'mappend' = ('<>')@ since /base-4.11.0.0/.
+        -- Should it be implemented manually, since 'mappend' is a synonym for
+        -- ('<>'), it is expected that the two functions are defined the same
+        -- way. In a future GHC release 'mappend' will be removed from 'Monoid'.
         mappend :: a -> a -> a
         mappend = (<>)
         {-# INLINE mappend #-}


=====================================
testsuite/tests/simplCore/should_compile/Makefile
=====================================
@@ -106,11 +106,13 @@ T4903:
 	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903a.hs -dcore-lint
 	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903.hs -dcore-lint
 
+# N.B. Suppress ticks to ensure that the test result doesn't change if `base`
+# is compiled with -g. See #16741.
 T4918:
 	$(RM) -f T4918.hi T4918.o T4918a.hi T4918a.o
 	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918a.hs
 	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918.hs
-	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4918.hi | grep 'C#'
+	'$(TEST_HC)' $(TEST_HC_OPTS) -dsuppress-ticks --show-iface T4918.hi | grep 'C#'
 
 EvalTest:
 	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O EvalTest.hs -ddump-simpl -dsuppress-uniques | grep 'rght.*Dmd' | sed 's/^ *//'



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/bb8bb1cf61a1eb10b7bfda3e9a8f37929c8d3df6...97ba5bf55882e2a6ca22cbae1c6526b3fdf9800b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/bb8bb1cf61a1eb10b7bfda3e9a8f37929c8d3df6...97ba5bf55882e2a6ca22cbae1c6526b3fdf9800b
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/20190608/117d13d6/attachment-0001.html>


More information about the ghc-commits mailing list