Commits (363)
This diff is collapsed.
#!/usr/bin/env bash
set -euo pipefail
# Use github.com/ghc for those submodule repositories we couldn't connect to.
git config remote.origin.url git://github.com/ghc/ghc.git
git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/
git submodule init # Don't be quiet, we want to show these urls.
git submodule --quiet update --recursive # Now we can be quiet again.
#!/usr/bin/env bash
# vim: sw=2 et
set -euo pipefail
fail() {
echo "ERROR: $*" >&2
exit 1
if [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:ghc/ghc.git" ]; then
exit 0
# Add git.haskell.org as a known host.
echo "|1|F3mPVCE55+KfApNIMYQ3Dv39sGE=|1bRkvJEJhAN2R0LE/lAjFCEJGl0= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBUZS9jGBkE5UzpSo6irnIgcQcfzvbuIOsFc8+N61FwtZncRntbaKPuUimOFPgeaUZLl6Iajz6IIs7aduU0/v+I=" >> ~/.ssh/known_hosts
echo "|1|2VUMjYSRVpT2qJPA0rA9ap9xILY=|5OThkI4ED9V0J+Es7D5FOD55Klk= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+3TLluLAO4lkW60W+N2DFkS+WoRFGqLwHzgd1ifxG9TIm31wChPY3E/hgMnJmgGqWCF4UDUemmyCycEaL7FtKfzjTAclg9EfpQnozyE3T5hIo2WL7SN5O8ttG/bYGuDnn14jLnWwJyN4oz/znWFiDG9e2Oc9YFNlQ+PK8ae5xR4gqBB7EOoj9J1EiPqG2OXRr5Mei3TLsRDU6fnz/e4oFJpKWWeN6M63oePv0qoaGjxcrATZUWsuWrxVMmYo9kP1xRuFJbAUw2m4uVP+793SW1zxySi1HBMtJG+gCDdZZSwYbkV1hassLWBHv1qPttncfX8Zek3Z3VolaTmfWJTo9" >> ~/.ssh/known_hosts
# Check that a git notes dont already exist.
# This is a percausion as we reset refs/notes/perf and we want to avoid data loss.
if [ $(git notes --ref=perf list | wc -l) -ne 0 ]
fail "Found an existing git note on HEAD. Expected no git note."
# Assert that the METRICS_FILE exists and can be read.
if [ "$METRICS_FILE" = "" ] || ! [ -r $METRICS_FILE ]
fail "Metrics file not found: $METRICS_FILE"
# Reset the git notes and append the metrics file to the notes, then push and return the result.
# This is favoured over a git notes merge as it avoids potential data loss/duplication from the merge strategy.
function reset_append_note_push {
git fetch -f $GHC_ORIGIN refs/notes/perf:refs/notes/perf || true
echo "git notes --ref=perf append -F $METRICS_FILE HEAD"
git notes --ref=perf append -F $METRICS_FILE HEAD
git push $GHC_ORIGIN refs/notes/perf
# Push the metrics file as a git note. This may fail if another task pushes a note first. In that case
# the latest note is fetched and appended.
until reset_append_note_push || [ $MAX_RETRY -le 0 ]
echo ""
echo "Failed to push git notes. Fetching, appending, and retrying... $MAX_RETRY retries left."
......@@ -142,7 +142,6 @@ _darcs/
This diff is collapsed.
# Summary
## Summary
Write a brief description of the issue.
# Steps to reproduce
## Steps to reproduce
Please provide a set of concrete steps to reproduce the issue.
# Expected behavior
## Expected behavior
What do you expect the reproducer described above to do?
# Environment
## Environment
* GHC version used:
# Motivation
## Motivation
Briefly describe the problem your proposal solves and why this problem should
be solved.
# Proposal
## Proposal
Describe your proposed feature here.
......@@ -12,8 +12,10 @@ from linter import run_linters, RegexpLinter
linters = [
message = "Warning: Use `$(TEST_HC_OPTS_INTERACTIVE)` instead of `--interactive -ignore-dot-ghci -v0`.")
message = "Warning: Use `$(TEST_HC_OPTS_INTERACTIVE)` instead of `--interactive -ignore-dot-ghci -v0`."
).add_path_filter(lambda path: path.name == 'Makefile')
if __name__ == '__main__':
run_linters(linters, subdir='testsuite')
......@@ -7,10 +7,11 @@ import sys
import re
import textwrap
import subprocess
from typing import List, Optional
from pathlib import Path
from typing import List, Optional, Callable, Sequence
from collections import namedtuple
def lint_failure(file, line_no, line_content, message):
def lint_failure(file, line_no: int, line_content: str, message: str):
""" Print a lint failure message. """
wrapper = textwrap.TextWrapper(initial_indent=' ',
subsequent_indent=' ')
......@@ -29,7 +30,7 @@ def lint_failure(file, line_no, line_content, message):
def get_changed_files(base_commit, head_commit,
def get_changed_files(base_commit: str, head_commit: str,
subdir: str = '.'):
""" Get the files changed by the given range of commits. """
cmd = ['git', 'diff', '--name-only',
......@@ -46,12 +47,21 @@ class Linter(object):
def __init__(self):
self.warnings = [] # type: List[Warning]
self.path_filters = [] # type: List[Callable[[Path], bool]]
def add_warning(self, w: Warning):
def lint(self, path):
def add_path_filter(self, f: Callable[[Path], bool]) -> "Linter":
return self
def do_lint(self, path: Path):
if all(f(path) for f in self.path_filters):
def lint(self, path: Path):
raise NotImplementedError
class LineLinter(Linter):
......@@ -59,32 +69,32 @@ class LineLinter(Linter):
the given line from a file and calls :func:`add_warning` for any lint
issues found.
def lint(self, path):
if os.path.isfile(path):
with open(path, 'r') as f:
def lint(self, path: Path):
if path.is_file():
with path.open('r') as f:
for line_no, line in enumerate(f):
self.lint_line(path, line_no+1, line)
def lint_line(self, path, line_no, line):
def lint_line(self, path: Path, line_no: int, line: str):
raise NotImplementedError
class RegexpLinter(LineLinter):
A :class:`RegexpLinter` produces the given warning message for
all lines matching the given regular expression.
def __init__(self, regex, message):
def __init__(self, regex: str, message: str):
self.re = re.compile(regex)
self.message = message
def lint_line(self, path, line_no, line):
def lint_line(self, path: Path, line_no: int, line: str):
if self.re.search(line):
w = Warning(path=path, line_no=line_no, line_content=line[:-1],
def run_linters(linters: List[Linter],
def run_linters(linters: Sequence[Linter],
subdir: str = '.') -> None:
import argparse
parser = argparse.ArgumentParser()
......@@ -96,7 +106,7 @@ def run_linters(linters: List[Linter],
if path.startswith('.gitlab/linters'):
for linter in linters:
warnings = [warning
for linter in linters
......@@ -30,6 +30,7 @@ BuildFlavour=$BUILD_FLAVOUR
ifneq "\$(BuildFlavour)" ""
include mk/flavours/\$(BuildFlavour).mk
case "$(uname)" in
[submodule "libraries/binary"]
path = libraries/binary
url = ../packages/binary.git
url = https://gitlab.haskell.org/ghc/packages/binary.git
ignore = untracked
[submodule "libraries/bytestring"]
path = libraries/bytestring
url = ../packages/bytestring.git
url = https://gitlab.haskell.org/ghc/packages/bytestring.git
ignore = untracked
[submodule "libraries/Cabal"]
path = libraries/Cabal
url = ../packages/Cabal.git
url = https://gitlab.haskell.org/ghc/packages/Cabal.git
ignore = untracked
[submodule "libraries/containers"]
path = libraries/containers
url = ../packages/containers.git
url = https://gitlab.haskell.org/ghc/packages/containers.git
ignore = untracked
[submodule "libraries/haskeline"]
path = libraries/haskeline
url = ../packages/haskeline.git
url = https://gitlab.haskell.org/ghc/packages/haskeline.git
ignore = untracked
[submodule "libraries/pretty"]
path = libraries/pretty
url = ../packages/pretty.git
url = https://gitlab.haskell.org/ghc/packages/pretty.git
ignore = untracked
[submodule "libraries/terminfo"]
path = libraries/terminfo
url = ../packages/terminfo.git
url = https://gitlab.haskell.org/ghc/packages/terminfo.git
ignore = untracked
[submodule "libraries/transformers"]
path = libraries/transformers
url = ../packages/transformers.git
url = https://gitlab.haskell.org/ghc/packages/transformers.git
ignore = untracked
[submodule "libraries/xhtml"]
path = libraries/xhtml
url = ../packages/xhtml.git
url = https://gitlab.haskell.org/ghc/packages/xhtml.git
ignore = untracked
[submodule "libraries/Win32"]
path = libraries/Win32
url = ../packages/Win32.git
url = https://gitlab.haskell.org/ghc/packages/Win32.git
ignore = untracked
[submodule "libraries/time"]
path = libraries/time
url = ../packages/time.git
url = https://gitlab.haskell.org/ghc/packages/time.git
ignore = untracked
[submodule "libraries/array"]
path = libraries/array
url = ../packages/array.git
url = https://gitlab.haskell.org/ghc/packages/array.git
ignore = untracked
[submodule "libraries/deepseq"]
path = libraries/deepseq
url = ../packages/deepseq.git
url = https://gitlab.haskell.org/ghc/packages/deepseq.git
ignore = untracked
[submodule "libraries/directory"]
path = libraries/directory
url = ../packages/directory.git
url = https://gitlab.haskell.org/ghc/packages/directory.git
ignore = untracked
[submodule "libraries/filepath"]
path = libraries/filepath
url = ../packages/filepath.git
url = https://gitlab.haskell.org/ghc/packages/filepath.git
ignore = untracked
[submodule "libraries/hpc"]
path = libraries/hpc
url = ../packages/hpc.git
url = https://gitlab.haskell.org/ghc/packages/hpc.git
ignore = untracked
[submodule "libraries/parsec"]
path = libraries/parsec
url = ../packages/parsec.git
url = https://gitlab.haskell.org/ghc/packages/parsec.git
ignore = untracked
[submodule "libraries/text"]
path = libraries/text
url = ../packages/text.git
url = https://gitlab.haskell.org/ghc/packages/text.git
ignore = untracked
[submodule "libraries/mtl"]
path = libraries/mtl
url = ../packages/mtl.git
url = https://gitlab.haskell.org/ghc/packages/mtl.git
ignore = untracked
[submodule "libraries/process"]
path = libraries/process
url = ../packages/process.git
url = https://gitlab.haskell.org/ghc/packages/process.git
ignore = untracked
[submodule "libraries/unix"]
path = libraries/unix
url = ../packages/unix.git
url = https://gitlab.haskell.org/ghc/packages/unix.git
ignore = untracked
branch = 2.7
[submodule "libraries/stm"]
path = libraries/stm
url = ../packages/stm.git
url = https://gitlab.haskell.org/ghc/packages/stm.git
ignore = untracked
[submodule "utils/haddock"]
path = utils/haddock
url = ../haddock.git
url = https://github.com/haskell/haddock.git
ignore = untracked
branch = ghc-head
[submodule "nofib"]
path = nofib
url = ../nofib.git
url = https://gitlab.haskell.org/ghc/nofib.git
ignore = untracked
[submodule "utils/hsc2hs"]
path = utils/hsc2hs
url = ../hsc2hs.git
url = https://gitlab.haskell.org/ghc/hsc2hs.git
ignore = untracked
[submodule "libffi-tarballs"]
path = libffi-tarballs
url = ../libffi-tarballs.git
url = https://gitlab.haskell.org/ghc/libffi-tarballs.git
ignore = untracked
[submodule "gmp-tarballs"]
path = libraries/integer-gmp/gmp/gmp-tarballs
url = ../gmp-tarballs.git
url = https://gitlab.haskell.org/ghc/gmp-tarballs.git
......@@ -17,10 +17,10 @@
# The compiler
/compiler/parser/ @int-index
/compiler/typecheck/ @simonpj @goldfire
/compiler/rename/ @simonpj @goldfire
/compiler/types/ @simonpj @goldfire
/compiler/deSugar/ @simonpj @goldfire
/compiler/typecheck/ @simonpj @rae
/compiler/rename/ @simonpj @rae
/compiler/types/ @simonpj @rae
/compiler/deSugar/ @simonpj @rae
/compiler/typecheck/TcDeriv* @RyanGlScott
/compiler/nativeGen/ @simonmar @bgamari @AndreasK
/compiler/llvmGen/ @angerman
......@@ -34,12 +34,12 @@
/compiler/simplStg/StgLiftLams.hs @sgraf
/compiler/cmm/CmmSwitch.hs @nomeata
/compiler/stranal/DmdAnal.hs @simonpj @sgraf
/compiler/hsSyn/Convert.hs @goldfire
/compiler/hsSyn/Convert.hs @rae
# Core libraries
/libraries/base/ @hvr
/libraries/ghci/ @simonmar
/libraries/template-haskell/ @goldfire
/libraries/template-haskell/ @rae
# Internal utilities and libraries
/libraries/libiserv/ @angerman @simonmar
......@@ -63,10 +63,8 @@ Now, hack on your copy and rebuild (with `make`) as necessary.
Then start by making your commits however you want. When you're done, you can submit
a pull request on Github for small changes. For larger changes the patch needs to be
submitted to [Phabricator](https://phabricator.haskell.org/) for code review.
The GHC Wiki has a good summary for the [overall process](https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions/fixing-bugs)
as well as a guide on
[how to use Phabricator/arcanist](https://gitlab.haskell.org/ghc/ghc/wikis/phabricator).
submitted to [GitLab](https://gitlab.haskell.org/ghc/ghc/merge_requests) for code review.
The GHC Wiki has a good summary for the [overall process](https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions/fixing-bugs).
Useful links:
......@@ -75,23 +73,34 @@ Useful links:
An overview of things like using git, the release process, filing bugs
and more can be located here:
You can find our coding conventions for the compiler and RTS here:
A high level overview of the bug tracker:
If you're going to contribute regularly, **learning how to use the
build system is important** and will save you lots of time. You should
read over this page carefully:
A web based code explorer for the GHC source code with semantic analysis
and type information of the GHC sources is available at:
Look for `GHC` in `Package-name`. For example, here is the link to
If you want to watch issues and code review activities, the following page is a good start:
How to communicate with us
......@@ -126,10 +135,6 @@ undoubtedly also interested in the other mailing lists:
* [glasgow-haskell-users](http://www.haskell.org/mailman/listinfo/glasgow-haskell-users)
is where developers/users meet.
* [ghc-tickets](http://www.haskell.org/mailman/listinfo/ghc-tickets)
for email from Trac.
* [ghc-builds](http://www.haskell.org/mailman/listinfo/ghc-builds)
for nightly build emails.
* [ghc-commits](http://www.haskell.org/mailman/listinfo/ghc-commits)
for commit messages when someone pushes to the repository.
......@@ -18,7 +18,7 @@ XeLaTex (only for PDF output).
Quick start: the following gives you a default build:
$ python3 boot
$ ./boot
$ ./configure
$ make
$ make install
......@@ -31,7 +31,7 @@ Quick start: the following gives you a default build:
You can use Make's `-jN` option to parallelize the build. It's generally best
to set `N` somewhere around the core count of the build machine.
The `python3 boot` step is only necessary if this is a tree checked out from
The `./boot` step is only necessary if this is a tree checked out from
git. For source distributions downloaded from GHC's web site, this step has
already been performed.
......@@ -43,6 +43,6 @@ It can take a long time. To customise the build, see the file
[1] http://www.haskell.org/ghc/
[2] https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation
[3] http://www.haskell.org/haddock/
- [1] http://www.haskell.org/ghc/
- [2] https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation
- [3] http://www.haskell.org/haddock/