...
 
Commits (1355)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

--command ./hadrian/ghci.sh
--command sh ./hadrian/ghci
--reload compiler
--reload ghc
--reload includes
......
......@@ -31,6 +31,7 @@ Thumbs.db
*.dyn_o
*.dyn_hi
__pycache__
.mypy_cache
*.SYMDEF*
log
......@@ -50,6 +51,9 @@ stage0
stage1
stage2
_build
*/generated/
*/ghc-stage1
.shake.*
.hadrian_ghci
# -----------------------------------------------------------------------------
......@@ -69,6 +73,7 @@ _darcs/
/driver/ghc/dist/
/driver/haddock/dist/
/driver/ghci/dist/
/includes/dist/
/includes/dist-*/
/libffi/dist-install/
/libraries/*/dist-boot/
......@@ -102,6 +107,7 @@ _darcs/
/distrib/ghc.iss
/docs/man
/docs/index.html
/docs/users_guide/.log
/docs/users_guide/users_guide
/docs/users_guide/ghc.1
/docs/users_guide/flags.pyc
......@@ -124,9 +130,6 @@ _darcs/
/ghc.spec
/ghc/ghc-bin.cabal
/includes/dist/
/includes/ghcautoconf.h
/includes/ghcplatform.h
/includes/ghcversion.h
/index.html
/inplace/
/libffi/build/
......@@ -142,7 +145,6 @@ _darcs/
/libraries/frames.html
/libraries/ghc-boot/GNUmakefile
/libraries/ghc-boot/ghc-boot.cabal
/libraries/ghc-boot/ghc.mk
/libraries/ghc-boot-th/GNUmakefile
/libraries/ghc-boot-th/ghc-boot-th.cabal
/libraries/ghc-boot-th/ghc.mk
......@@ -221,5 +223,12 @@ GIT_COMMIT_ID
# ghc.nix
ghc.nix/
# gdb
.gdb_history
.gdbinit
# Tooling - direnv
.envrc
# Tooling - vscode
.vscode
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
set -e
toolchain=`pwd`/toolchain
PATH="$toolchain/bin:$PATH"
if [ -d "`pwd`/cabal-cache" ]; then
cp -Rf cabal-cache $HOME/.cabal
fi
if [ ! -e $toolchain/bin/ghc ]; then
mkdir -p tmp
cd tmp
ghc_tarball="https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-apple-darwin.tar.xz"
echo "Fetching GHC from $ghc_tarball"
curl $ghc_tarball | tar -xJ
cd ghc-$GHC_VERSION
./configure --prefix=$toolchain
make install
cd ../..
rm -Rf tmp
fi
if [ ! -e $toolchain/bin/cabal ]; then
cabal_tarball="https://downloads.haskell.org/~cabal/cabal-install-latest/cabal-install-2.4.1.0-x86_64-apple-darwin-sierra.tar.xz"
echo "Fetching cabal-install from $cabal_tarball"
curl $cabal_tarball | tar -xz
mv cabal $toolchain/bin
fi
if [ ! -e $toolchain/bin/happy ]; then
cabal update
cabal new-install happy --symlink-bindir=$toolchain/bin
fi
if [ ! -e $toolchain/bin/alex ]; then
cabal update
cabal new-install alex --symlink-bindir=$toolchain/bin
fi
#!/usr/bin/env python3
"""
Fix submodule upstream URLs. This ensures that CI builds of GHC forks
clone their submodules from its usual location. Otherwise users would need to
fork all submodules before their CI builds would succeed.
"""
from pathlib import Path
import re
x = open('.gitmodules').read()
x = re.sub(r"url *= *\.\.", "url = https://gitlab.haskell.org/ghc", x)
open('.gitmodules', 'w').write(x)
import subprocess
def get_configs(config_file):
args = ['git', 'config', '-f', config_file.as_posix(), '--list']
out = subprocess.check_output(args)
configs = {}
for line in out.decode('UTF-8').split('\n'):
if '=' in line:
k,v = line.split('=')
configs[k] = v
return configs
def set_config(config_file, key, value):
args = ['git', 'config', '-f', config_file.as_posix(), '--replace', key, value]
subprocess.check_call(args)
upstreams = {
'utils/haddock': 'https://github.com/haskell/haddock'
}
modules_config = Path('.gitmodules')
def main():
for k,v in get_configs(modules_config).items():
match = re.match('submodule\.(.+)\.url', k)
if match is not None:
submod = match.group(1)
if submod in upstreams:
url = upstreams[submod]
else:
url = re.sub('\.\.', 'https://gitlab.haskell.org/ghc', v)
print('Using {submod} from {url}'.format(submod=submod, url=url))
set_config(modules_config, k, url)
if __name__ == '__main__':
main()
# 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:
......
## Summary
Location of documentation issue: (e.g. the Haddocks of `base`, the GHC user's guide)
Write a brief description of the issue.
## Proposed improvements or changes
Feel free to propose changes, either concrete or abstract.
## Environment
* GHC version used (if appropriate):
/label ~bug
/label ~documentation
/label ~"needs triage"
# Motivation
## Motivation
Briefly describe the problem your proposal solves and why this problem should
be solved.
# Proposal
## Proposal
Describe your proposed feature here.
......
#!/usr/bin/env bash
set -e
COLOR_RED="\e[31m"
COLOR_GREEN="\e[32m"
COLOR_NONE="\e[0m"
grep TBA libraries/*/changelog.md && (
echo -e "${COLOR_RED}Error: Found \"TBA\"s in changelogs.${COLOR_NONE}"
exit 1
) || (
echo -e "${COLOR_GREEN}changelogs look okay.${COLOR_NONE}"
exit 0
)
......@@ -3,6 +3,7 @@
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
from pathlib import Path
from linter import run_linters, RegexpLinter
linters = [
......@@ -20,5 +21,16 @@ linters = [
message='`#if !defined(x)` is preferred to `#ifndef x`'),
]
for l in linters:
# Need do document rules!
l.add_path_filter(lambda path: path != Path('docs', 'coding-style.html'))
# Don't lint vendored code
l.add_path_filter(lambda path: not path.name == 'config.guess')
# Don't lint font files
l.add_path_filter(lambda path: not path.parent == Path('docs','users_guide',
'rtd-theme', 'static', 'fonts'))
# Don't lint core spec
l.add_path_filter(lambda path: not path.name == 'core-spec.pdf')
if __name__ == '__main__':
run_linters(linters)
#!/usr/bin/env python3
"""
Linters for testsuite makefiles
"""
from linter import run_linters, RegexpLinter
"""
Warn for use of `--interactive` inside Makefiles (#11468).
......@@ -7,13 +13,19 @@ Encourage the use of `$(TEST_HC_OPTS_INTERACTIVE)` instead of
`$(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0`. It's too easy to
forget one of those flags when adding a new test.
"""
interactive_linter = \
RegexpLinter(r'--interactive',
message = "Warning: Use `$(TEST_HC_OPTS_INTERACTIVE)` instead of `--interactive -ignore-dot-ghci -v0`."
).add_path_filter(lambda path: path.name == 'Makefile')
from linter import run_linters, RegexpLinter
test_hc_quotes_linter = \
RegexpLinter('\t\\$\\(TEST_HC\\)',
message = "Warning: $(TEST_HC) should be quoted in Makefiles.",
).add_path_filter(lambda path: path.name == 'Makefile')
linters = [
RegexpLinter(r'--interactive',
message = "Warning: Use `$(TEST_HC_OPTS_INTERACTIVE)` instead of `--interactive -ignore-dot-ghci -v0`."
).add_path_filter(lambda path: path.suffix == '.T')
interactive_linter,
test_hc_quotes_linter,
]
if __name__ == '__main__':
......
......@@ -98,11 +98,22 @@ def run_linters(linters: Sequence[Linter],
subdir: str = '.') -> None:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('base', help='Base commit')
parser.add_argument('head', help='Head commit')
subparsers = parser.add_subparsers()
subparser = subparsers.add_parser('commits', help='Lint a range of commits')
subparser.add_argument('base', help='Base commit')
subparser.add_argument('head', help='Head commit')
subparser.set_defaults(get_linted_files=lambda args:
get_changed_files(args.base, args.head, subdir))
subparser = subparsers.add_parser('files', help='Lint a range of commits')
subparser.add_argument('file', nargs='+', help='File to lint')
subparser.set_defaults(get_linted_files=lambda args: args.file)
args = parser.parse_args()
for path in get_changed_files(args.base, args.head, subdir):
linted_files = args.get_linted_files(args)
for path in linted_files:
if path.startswith('.gitlab/linters'):
continue
for linter in linters:
......
......@@ -9,10 +9,11 @@ Please take a few moments to verify that your commits fulfill the following:
* [ ] have added source comments describing your change. For larger changes you
likely should add a [Note][notes] and cross-reference it from the relevant
places.
* [ ] add a [testcase to the
testsuite](https://gitlab.haskell.org/ghc/ghc/wikis/building/running-tests/adding).
* [ ] add a [testcase to the testsuite](https://gitlab.haskell.org/ghc/ghc/wikis/building/running-tests/adding).
* [ ] if your MR affects library interfaces (e.g. changes `base`) please add
the ~"user facing" label.
* [ ] updates the users guide if applicable
* [ ] mentions new features in the release notes for the next release
If you have any questions don't hesitate to open your merge request and inquire
in a comment. If your patch isn't quite done yet please do add prefix your MR
......
#!/usr/bin/env bash
# vim: sw=2 et
set -euo pipefail
fail() {
echo "ERROR: $*" >&2
exit 1
}
hackage_index_state="@1522046735"
if [[ -z ${BUILD_SPHINX_HTML:-} ]]; then BUILD_SPHINX_HTML=YES; fi
if [[ -z ${BUILD_SPHINX_PDF:-} ]]; then BUILD_SPHINX_PDF=YES; fi
if [[ -z ${INTEGER_LIBRARY:-} ]]; then INTEGER_LIBRARY=integer-gmp; fi
if [[ -z ${BUILD_FLAVOUR:-} ]]; then BUILD_FLAVOUR=perf; fi
cat > mk/build.mk <<EOF
V=1
HADDOCK_DOCS=YES
LATEX_DOCS=YES
HSCOLOUR_SRCS=YES
BUILD_SPHINX_HTML=$BUILD_SPHINX_HTML
BUILD_SPHINX_PDF=$BUILD_SPHINX_PDF
BeConservative=YES
INTEGER_LIBRARY=$INTEGER_LIBRARY
EOF
cat <<EOF >> mk/build.mk
BuildFlavour=$BUILD_FLAVOUR
ifneq "\$(BuildFlavour)" ""
include mk/flavours/\$(BuildFlavour).mk
endif
GhcLibHcOpts+=-haddock
EOF
case "$(uname)" in
Linux)
if [[ -n ${TARGET:-} ]]; then
if [[ $TARGET = FreeBSD ]]; then
# cross-compiling to FreeBSD
echo 'HADDOCK_DOCS = NO' >> mk/build.mk
echo 'WERROR=' >> mk/build.mk
# https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
echo 'export PATH=/opt/ghc/bin:$PATH' >> $BASH_ENV
else
fail "TARGET=$target not supported"
fi
fi
;;
Darwin)
if [[ -n ${TARGET:-} ]]; then
fail "uname=$(uname) not supported for cross-compilation"
fi
# It looks like we already have python2 here and just installing python3
# does not work.
brew upgrade python
brew install ghc cabal-install ncurses gmp
pip3 install sphinx
# PDF documentation disabled as MacTeX apparently doesn't include xelatex.
#brew cask install mactex
cabal update
cabal install --reinstall alex happy haddock hscolour --index-state=$hackage_index_state
# put them on the $PATH, don't fail if already installed
ln -s $HOME/.cabal/bin/alex /usr/local/bin/alex || true
ln -s $HOME/.cabal/bin/happy /usr/local/bin/happy || true
ln -s $HOME/.cabal/bin/HsColour /usr/local/bin/HsColour || true
echo "libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp" >> mk/build.mk
;;
*)
fail "uname=$(uname) not supported"
esac
echo "================================================="
echo "Build.mk:"
echo ""
cat mk/build.mk
echo "================================================="
#!/usr/bin/env bash
# vim: sw=2 et
set -euo pipefail
NOTES_ORIGIN="git@gitlab.haskell.org:ghc/ghc-performance-notes.git"
REF="perf"
fail() {
echo "ERROR: $*" >&2
exit 1
}
# Check that private key is available (Set on all GitLab protected branches).
if [ -z ${PERF_NOTE_KEY+"$PERF_NOTE_KEY"} ]
then
echo "Not pushing performance git notes: PERF_NOTE_KEY is not set."
exit 0
fi
# TEST_ENV must be set.
if [ -z ${TEST_ENV+"$TEST_ENV"} ]
then
fail "Not pushing performance git notes: TEST_ENV must be set."
fi
# Assert that the METRICS_FILE exists and can be read.
if [ -z ${METRICS_FILE+"$METRICS_FILE"} ]
then
fail "\$METRICS_FILE not set."
fi
if ! [ -r $METRICS_FILE ]
then
fail "Metrics file not found: $METRICS_FILE"
fi
# Add gitlab as a known host.
mkdir -p ~/.ssh
echo "|1|+AUrMGS1elvPeLNt+NHGa5+c6pU=|4XvfRsQftO1OgZD4c0JJ7oNaii8= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDXilA5l4kOZPx0nM6xDATF+t4fS6te0eYPDwBI/jLWD9cJVtCnsrwMl5ar+/NfmcD0jnCYztUiVHuXyTaWPJYSQpwltfpTeqpo9/z/0MxkPtSl1uMP2cLbDiqA01OWveChktOXwU6hRQ+7MmO+dNRS/iXrRmYrGv/p1W811QgLBLS9fefEdF25n+0dP71L7Ov7riOawlDmd0C11FraE/R8HX6gs6lbXta1kisdxGyKojYSiCtobUaJxRoatMfUP0a9rwTAyl8tf56LgB+igjMky879VAbL7eQ/AmfHYPrSGJ/YlWP6Jj23Dnos5nOVlWL/rVTs9Y/NakLpPwMs75KTC0Pd74hdf2e3folDdAi2kLrQgO2SI6so7rOYZ+mFkCM751QdDVy4DzjmDvSgSIVf9SV7RQf7e7unE7pSZ/ILupZqz9KhR1MOwVO+ePa5qJMNSdC204PIsRWkIO5KP0QLl507NI9Ri84+aODoHD7gDIWNhU08J2P8/E6r0wcC8uWaxh+HaOjI9BkHjqRYsrgfn54BAuO9kw1cDvyi3c8n7VFlNtvQP15lANwim3gr9upV+r95KEPJCgZMYWJBDPIVtp4GdYxCfXxWj5oMXbA5pf0tNixwNJjAsY7I6RN2htHbuySH36JybOZk+gCj6mQkxpCT/tKaUn14hBJWLq7Q+Q==" >> ~/.ssh/known_hosts
echo "|1|JZkdAPJmpX6SzGeqhmQLfMWLGQA=|4vTELroOlbFxbCr0WX+PK9EcpD0= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJknufU+I6A5Nm58lmse4/o11Ai2UzYbYe7782J1+kRk" >> ~/.ssh/known_hosts