...
 
Commits (908)

Too many changes to show.

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

Subproject commit 957f9e4e8eb422dcb72f02f07767a1ed5969baab
#!/usr/bin/env python3
# A linter to warn when binary files are added to the repository
import sys
import os
import json
path = sys.argv[1]
warnings = []
if os.path.isfile(path):
with open(path, 'rb') as f:
if b'\0' in f.read(8000):
warning = {
'severity': 'warning',
'message': 'This file appears to be a binary file; does it really belong in the repository?'
}
warnings.append(warning)
print(json.dumps(warnings))
#!/usr/bin/env python3
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
import sys
import logging
import os
import re
import json
def setup_logging(logger):
"""
``arc lint`` makes it quite tricky to catch debug output from linters.
Log to a file to work around this.
"""
hdlr = logging.FileHandler('linter.log', 'w')
logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)
return logger
logger = logging.getLogger()
#setup_logging(logger)
logger.debug(sys.argv)
def add_warning(severity, message, line):
entry = {
'severity': severity,
'message': message,
'line': line
}
warnings.append(entry)
class Linter(object):
def __init__(self):
self.warnings = []
def add_warning(self, **entry):
self.warnings.append(entry)
def lint(self, path):
pass
class LineLinter(Linter):
def lint(self, path):
if os.path.isfile(path):
with open(path, 'rb') as f:
for lineno, line in enumerate(f):
self.lint_line(lineno+1, line)
def lint_line(self, lineno, line):
pass
class RegexpLinter(LineLinter):
def __init__(self, regex, **warning):
LineLinter.__init__(self)
self.re = re.compile(regex)
self.warning = warning
def lint_line(self, lineno, line):
if self.re.search(line):
warning = {
'line': lineno,
}
warning.update(self.warning)
self.add_warning(**warning)
linters = [
RegexpLinter(br'ASSERT\s+\(',
message='CPP macros should not have a space between the macro name and their argument list'),
RegexpLinter(br'#ifdef\s+',
message='`#if defined(x)` is preferred to `#ifdef x`',
severity='warning'),
RegexpLinter(br'#if\s+defined\s+',
message='`#if defined(x)` is preferred to `#if defined x`',
severity='warning'),
RegexpLinter(br'#ifndef\s+',
message='`#if !defined(x)` is preferred to `#ifndef x`',
severity='warning'),
]
if __name__ == '__main__':
path = sys.argv[1]
for linter in linters:
linter.lint(path)
warnings = [warning
for linter in linters
for warning in linter.warnings]
logger.debug(warnings)
print(json.dumps(warnings))
#!/usr/bin/env python3
# Warn for use of `--interactive` inside Makefiles (#11468).
#
# 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.
import sys
import os
import json
import re
path = sys.argv[1]
warnings = []
if os.path.isfile(path):
with open(path) as f:
for lineno, line in enumerate(f):
if '--interactive' in line:
warning = {
'severity': 'warning',
'message': 'Use `$(TEST_HC_OPTS_INTERACTIVE)` instead of `--interactive -ignore-dot-ghci -v0`',
'line': lineno+1,
}
warnings.append(warning)
print(json.dumps(warnings))
{
"project.name" : "ghc",
"repository.callsign" : "GHC",
"phabricator.uri" : "https://phabricator.haskell.org",
"base" : "git:merge-base(origin/master), arc:prompt",
"load": [
".arc-linters/arcanist-external-json-linter"
]
}
{
"linters": {
"filename": {
"type": "filename"
},
"generated": {
"type": "generated"
},
"merge-conflict": {
"type": "merge-conflict",
"exclude": "(\\.rst$)"
},
"nolint": {
"type": "nolint"
},
"haskell": {
"type": "text",
"include": ["(\\.(l?hs(-boot)?|x|y\\.pp)(\\.in)?$)"],
"severity": {
"5": "disabled",
"2": "warning"
}
},
"c": {
"type": "text",
"include": ["(\\.(c|h)(\\.in)?$)"],
"severity": {
"2": "warning"
}
},
"text-xml": {
"type": "text",
"include": "(\\.xml$)",
"severity": {
"5": "disabled",
"3": "disabled",
"2": "warning"
}
},
"shell": {
"type": "text",
"include": [ "(\\.sh$)" ],
"text.max-line-length": 200,
"severity": {
"2": "warning"
}
},
"makefiles": {
"type": "text",
"include": [ "(Makefile$)", "(\\.mk$)" ],
"text.max-line-length": 400,
"severity": {
"2": "disabled"
}
},
"cabal": {
"type": "text",
"include": ["(\\.cabal(\\.in)?$)"],
"severity": {
"5": "disabled",
"2": "warning"
}
},
"other-text": {
"type": "text",
"include": ["(.travis.yml?)", "(.md$)", "(.txt$)"],
"severity": {
"5": "disabled",
"2": "warning"
}
},
"check-binaries": {
"type": "external-json",
"external-json.script": "python3 .arc-linters/check-binaries.py"
},
"check-makefiles": {
"type": "external-json",
"include": ["(Makefile$)"],
"external-json.script": "python3 .arc-linters/check-makefiles.py"
},
"bad-assert-clang-cpp": {
"type": "external-json",
"include": ["(\\.(l?hs|x|y\\.pp)(\\.in)?$)", "(\\.(c|h)$)"],
"external-json.script": "python3 .arc-linters/check-cpp.py"
}
},
"exclude":
[ "(^libffi-tarballs)",
"(^libraries/binary)",
"(^libraries/bytestring)",
"(^libraries/Cabal)",
"(^libraries/containers)",
"(^libraries/haskeline)",
"(^libraries/pretty)",
"(^libraries/terminfo)",
"(^libraries/transformers)",
"(^libraries/xhtml)",
"(^libraries/Win32)",
"(^libraries/primitive)",
"(^libraries/vector)",
"(^libraries/time)",
"(^libraries/random)",
"(^libraries/array)",
"(^libraries/deepseq)",
"(^libraries/directory)",
"(^libraries/filepath)",
"(^libraries/haskell98)",
"(^libraries/haskell2010)",
"(^libraries/hoopl)",
"(^libraries/hpc)",
"(^libraries/old-locale)",
"(^libraries/old-time)",
"(^libraries/process)",
"(^libraries/unix)",
"(^libraries/parallel)",
"(^libraries/stm)",
"(^libraries/dph)",
"(^utils/haddock)",
"(^nofib)",
"(^utils/hsc2hs)",
"(^libffi-tarballs)",
"(^ghc-tarballs)"
]
}
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.
FROM aarch64/debian:stretch
ENV LANG C.UTF-8
# Core build utilities
RUN apt-get update -qq
RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
ca-certificates g++ git make automake autoconf gcc \
perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo \
jq wget curl libnuma-dev
# Documentation tools
RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
# Boot LLVM
ENV PATH /usr/local/bin:$PATH
ENV LLVM_TARBALL http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-aarch64-linux-gnu.tar.xz
RUN curl $LLVM_TARBALL | tar -xJC .. && \
mkdir /opt/llvm6 && \
cp -R clang+llvm*/* /opt/llvm6 && \
rm -R clang+llvm* && \
/opt/llvm6/bin/llc --version
# GHC
#RUN curl http://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-aarch64-deb8-linux.tar.xz | tar -xJ && \
COPY ghc-8.6.2-aarch64-unknown-linux.tar.xz .
RUN cat ghc-8.6.2-aarch64-unknown-linux.tar.xz | tar -xJ && \
cd ghc-8.6.2 && \
./configure --prefix=/usr/local LLC=/opt/llvm6/bin/llc OPT=/opt/llvm6/bin/opt && \
make install && \
cd .. && \
rm -Rf ghc-*
RUN ghc --version
# LLVM
ENV LLVM_TARBALL http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-aarch64-linux-gnu.tar.xz
ENV LLC /opt/llvm7/bin/llc
ENV OPT /opt/llvm7/bin/opt
RUN curl $LLVM_TARBALL | tar -xJC .. && \
mkdir /opt/llvm7 && \
cp -R clang+llvm*/* /opt/llvm7 && \
rm -R clang+llvm* && \
$LLC --version
# Cabal
RUN git clone https://github.com/haskell/Cabal && \
cd Cabal && \
git checkout cabal-install-v2.4.1.0 && \
cd cabal-install && \
./bootstrap.sh --global --no-doc
RUN ls Cabal/cabal-install/dist/build
ENV PATH /home/ghc/.local/bin:/opt/cabal/2.2/bin:/opt/ghc/8.4.2/bin:$PATH
# Create a normal user.
RUN adduser ghc --gecos "GHC builds" --disabled-password
RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
USER ghc
# Build Haskell tools
RUN cabal update && \
cabal install hscolour happy alex
ENV PATH /home/ghc/.cabal/bin:$PATH
WORKDIR /home/ghc/
CMD ["bash"]
FROM i386/debian:jessie
ENV LANG C.UTF-8
RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu trusty main' > /etc/apt/sources.list.d/ghc.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
RUN apt-get update -qq
# Core build utilities
RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
ca-certificates g++ git make automake autoconf gcc \
perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo \
jq wget curl
# Documentation tools
RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
# Core build utilities
RUN apt-get install -qy libgmp-dev:i386
# Get i386 GHC bindist for 32 bit CI builds.
RUN cd /tmp && curl https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-i386-deb8-linux.tar.xz | tar -Jx
RUN cd /tmp/ghc-8.4.2 && setarch i386 ./configure --prefix=/opt/ghc-i386/8.4.2 CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux
RUN cd /tmp/ghc-8.4.2 && make install
RUN rm -rf /tmp/ghc-8.4.2
ENV PATH /opt/ghc-i386/8.4.2/bin:$PATH
# Get Cabal
RUN cd /tmp && \
curl https://www.haskell.org/cabal/release/cabal-install-2.2.0.0/cabal-install-2.2.0.0-i386-unknown-linux.tar.gz | tar -zx && \
mv cabal /usr/local/bin/cabal
# Create a normal user.
RUN adduser ghc --gecos "GHC builds" --disabled-password
RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
USER ghc
# Build Haskell tools
RUN cabal update && \
cabal install hscolour happy alex
ENV PATH /home/ghc/.cabal/bin:$PATH
WORKDIR /home/ghc/
CMD ["bash"]
FROM i386/debian:jessie
ENV LANG C.UTF-8
RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu trusty main' > /etc/apt/sources.list.d/ghc.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
RUN apt-get update -qq
# Core build utilities
RUN apt-get install -qy zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev \
ca-certificates g++ git make automake autoconf gcc \
perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo \
jq wget curl
# Documentation tools
RUN apt-get install -qy python3-sphinx texlive-xetex texlive-latex-extra
# Core build utilities
RUN apt-get install -qy libgmp-dev:i386
# Get i386 GHC bindist for 32 bit CI builds.
RUN cd /tmp && curl https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-i386-deb8-linux.tar.xz | tar -Jx
RUN cd /tmp/ghc-8.4.2 && setarch i386 ./configure --prefix=/opt/ghc-i386/8.4.2 CFLAGS=-m32 --target=i386-unknown-linux --build=i386-unknown-linux --host=i386-unknown-linux
RUN cd /tmp/ghc-8.4.2 && make install
RUN rm -rf /tmp/ghc-8.4.2
ENV PATH /opt/ghc-i386/8.4.2/bin:$PATH
# Get Cabal
RUN cd /tmp && \
curl https://www.haskell.org/cabal/release/cabal-install-2.2.0.0/cabal-install-2.2.0.0-i386-unknown-linux.tar.gz | tar -zx && \
mv cabal /usr/local/bin/cabal
# Create a normal user.
RUN adduser ghc --gecos "GHC builds" --disabled-password
RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
USER ghc
# Build Haskell tools
RUN cabal update && \
cabal install hscolour happy alex
ENV PATH /home/ghc/.cabal/bin:$PATH
WORKDIR /home/ghc/
CMD ["bash"]
FROM debian:stretch
ENV LANG C.UTF-8
RUN apt-get update -qq; apt-get install -qy gnupg sudo git python3
RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main' > /etc/apt/sources.list.d/ghc.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
RUN apt-get update -qq
# Basic Haskell toolchain
RUN apt-get install -qy cabal-install-2.2 ghc-8.4.2
ENV PATH /home/ghc/.local/bin:/opt/cabal/2.2/bin:/opt/ghc/8.4.2/bin:$PATH
# Create a normal user.
RUN adduser ghc --gecos "GHC builds" --disabled-password
RUN echo "ghc ALL = NOPASSWD : ALL" > /etc/sudoers.d/ghc
USER ghc
WORKDIR /home/ghc/
# Build Linting tools
RUN cabal update
RUN git clone git://github.com/haskell-infra/git-haskell-org-hooks && \
cd git-haskell-org-hooks && \
cabal install
ENV PATH /home/ghc/.cabal/bin:$PATH
CMD ["bash"]
#!/usr/bin/env bash
set -e
repo=ghcci
if [[ $# != 2 ]]; then
echo "Usage: $0 DIR VERSION"
echo
echo "Update Docker image in DIR, pushing it to the $repo repository as"
echo "version VERSION"
echo
echo "Example: $0 x86_64-linux-fedora 0.0.3"
exit 1
fi
name=$1
version=$2
#versions="$(curl -s https://registry.hub.docker.com/v1/repositories/$repo/$name/tags | jq -r .[].name)"
#if echo "$versions" | grep $version > /dev/null; then
# echo "Version $version of $name already exists"
# echo "Previous versions are:"
# echo "$versions"
# exit 1
#fi
docker build $name -t $repo/$name:$version
docker push $repo/$name:$version
repo_name="$repo/$name"
sed -i -E -e "s%$repo_name"':[0-9]+(\.[0-9]+)*%'"$repo_name:$version%" ../config.yml
sed -i -E -e "s%$repo_name"':[0-9]+(\.[0-9]+)*%'"$repo_name:$version%" ../../.gitlab-ci.yml
echo "Built, pushed, and bumped $name:$version"
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
bzip2 \
ca-certificates \
curl \
file \
g++ \
git \
make \
openssh-client \
patch \
perl \
python2.7 \
python3 \
software-properties-common \
sudo \
wget \
jq \
xz-utils
COPY build-toolchain.sh /tmp/