Skip to content

Commit b73edec

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stable
2 parents 31e2ffb + e9d2818 commit b73edec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1668
-1245
lines changed

.circleci/config.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: ~/dlang.org
5+
docker:
6+
- image: circleci/node:4.8.2
7+
parallelism: 1
8+
steps:
9+
- checkout
10+
- run:
11+
command: ./.circleci/run.sh install-deps
12+
name: Install DMD
13+
- run:
14+
command: ./.circleci/run.sh install-make
15+
name: Compile & install GNUmake
16+
- run:
17+
command: ./.circleci/run.sh setup-repos
18+
name: Clone DMD + DRuntime + Phobos
19+
- run:
20+
command: ./.circleci/run.sh run-make
21+
name: Run the Makefile in RELEASE=1 mode

.circleci/run.sh

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
#!/bin/bash
2+
3+
set -uexo pipefail
4+
5+
HOST_DMD_VER=2.072.2 # same as in dmd/src/posix.mak
6+
CURL_USER_AGENT="CirleCI $(curl --version | head -n 1)"
7+
DUB=${DUB:-$HOME/dlang/dub/dub}
8+
N=2
9+
CIRCLE_NODE_INDEX=${CIRCLE_NODE_INDEX:-0}
10+
11+
case $CIRCLE_NODE_INDEX in
12+
0) MODEL=64 ;;
13+
1) MODEL=32 ;;
14+
esac
15+
16+
install_deps() {
17+
if [ $MODEL -eq 32 ]; then
18+
sudo apt-get update
19+
sudo apt-get install g++-multilib
20+
fi
21+
22+
for i in {0..4}; do
23+
if curl -fsS -A "$CURL_USER_AGENT" --max-time 5 https://dlang.org/install.sh -O ||
24+
curl -fsS -A "$CURL_USER_AGENT" --max-time 5 https://nightlies.dlang.org/install.sh -O ||
25+
curl -fsS -A "$CURL_USER_AGENT" --max-time 5 https://raw.githubusercontent.com/dlang/installer/master/script/install.sh -O ; then
26+
break
27+
elif [ $i -ge 4 ]; then
28+
sleep $((1 << $i))
29+
else
30+
echo 'Failed to download install script' 1>&2
31+
exit 1
32+
fi
33+
done
34+
35+
source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash install.sh dmd-$HOST_DMD_VER --activate)"
36+
$DC --version
37+
env
38+
}
39+
40+
# clone dmd and druntime
41+
clone() {
42+
local url="$1"
43+
local path="$2"
44+
local branch="$3"
45+
for i in {0..4}; do
46+
if git clone --branch "$branch" "$url" "$path" "${@:4}"; then
47+
break
48+
elif [ $i -lt 4 ]; then
49+
sleep $((1 << $i))
50+
else
51+
echo "Failed to clone: ${url}"
52+
exit 1
53+
fi
54+
done
55+
}
56+
57+
install_make()
58+
{
59+
mkdir -p make
60+
cd make
61+
curl -L http://ftp.gnu.org/gnu/make/make-4.1.tar.gz | tar -zxf - --strip-components=1 && ./configure && make && ./make -v
62+
export PATH="$(pwd):${PATH}"
63+
cd ..
64+
}
65+
66+
setup_repos()
67+
{
68+
# Set a default in case we run into rate limit restrictions
69+
local base_branch=""
70+
if [ -n "${CIRCLE_PR_NUMBER:-}" ]; then
71+
base_branch=$((curl -fsSL https://api.github.com/repos/dlang/phobos/pulls/$CIRCLE_PR_NUMBER || echo) | jq -r '.base.ref')
72+
else
73+
base_branch=$CIRCLE_BRANCH
74+
fi
75+
base_branch=${base_branch:-"master"}
76+
77+
# Merge upstream branch with changes, s.t. we check with the latest changes
78+
if [ -n "${CIRCLE_PR_NUMBER:-}" ]; then
79+
local current_branch=$(git rev-parse --abbrev-ref HEAD)
80+
# work around weird CircleCi bug, see https://github.com/dlang/dlang.org/pull/1952
81+
git remote remove upstream || true
82+
git config user.name dummyuser
83+
git config user.email dummyuser@dummyserver.com
84+
git remote add upstream https://github.com/dlang/dlang.org.git
85+
git fetch upstream
86+
git checkout -f upstream/$base_branch
87+
git merge -m "Automatic merge" $current_branch
88+
fi
89+
90+
for proj in dmd druntime phobos ; do
91+
if [ $base_branch != master ] && [ $base_branch != stable ] &&
92+
! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $base_branch > /dev/null; then
93+
# use master as fallback for other repos to test feature branches
94+
clone https://github.com/dlang/$proj.git ../$proj master --depth 1
95+
else
96+
clone https://github.com/dlang/$proj.git ../$proj $base_branch --depth 1
97+
fi
98+
done
99+
100+
# Install the bootstrap compiler
101+
CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate
102+
}
103+
104+
run_make()
105+
{
106+
# Load environment for bootstrap compiler
107+
source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)"
108+
export PATH="$(pwd)/make:$PATH"
109+
make -v
110+
111+
make -f posix.mak RELEASE=1 release -j5 html dmd-release druntime-release phobos-release d-release.tag
112+
}
113+
114+
case $1 in
115+
install-deps) install_deps ;;
116+
install-make) install_make ;;
117+
setup-repos) setup_repos ;;
118+
run-make) run_make;;
119+
*) echo "Unknown command"; exit 1;;
120+
esac

.gitignore

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ Thumbs.db
1616
/chmgen
1717
*.o
1818

19-
# PDF / eBook
20-
dlangspec.d
21-
dlangspec-consolidated.d
22-
dlangspec.aux
23-
dlangspec.log
24-
dlangspec.out
25-
dlangspec.tex
26-
dlangspec.mobi
27-
dlangspec.toc
2819
images/*.pdf
2920

3021
/web
@@ -35,9 +26,11 @@ css/cssmenu.css
3526
.dub/
3627
dpl-docs/dpl-docs
3728

38-
/d.tag
39-
/d-tags.json
29+
/chm-nav*.json
30+
/d-*.tag
31+
/d-tags-*.json
4032
/.generated
4133

4234
# Generated changelogs
4335
changelog/*_pre.dd
36+
changelog/pending.dd

CODEOWNERS

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See also:
2+
# - https://github.com/blog/2392-introducing-code-owners
3+
# - https://help.github.com/articles/about-codeowners/
4+
5+
# Each line is a file pattern followed by one or more owners (sorted alphabetically).
6+
# Please feel free to add yourself to a module or create a new mapping.
7+
# Ideally each module should have two or more owners.
8+
9+
# Code owners are automatically requested for review
10+
# when someone opens a pull request that modifies code that they own.
11+
# Later matches take precedence.
12+
13+
spec/* @andralex @WalterBright
14+
foundation.dd @andralex @acehreli @WalterBright
15+
16+
posix.mak @andralex @CyberShadow @MartinNowak @wilzbach
17+
css/* @CyberShadow @MartinNowak @wilzbach
18+
js/* @CyberShadow @MartinNowak @wilzbach
19+
20+
assert_writeln_magic.d @wilzbach
21+
orgs-using-d.d @wilzbach
22+
chm* @CyberShadow
23+
24+
dpl-docs/ @s-ludwig

changelog/changelog.ddoc

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,23 @@ $(SMALL released $1, $2)
2424
$4
2525
)
2626

27-
NIGHTLY_VERSION=
28-
$(DIVC version,
29-
$(P
30-
$(B $(LARGE $(LINK2 http://nightlies.dlang.org, Download D nightlies)))$(BR)
31-
$(SMALL $1)
32-
)
33-
$4
34-
)
27+
_= The following CHANGELOG_SEP_ macros are emitted by the ../tools/changed.d script
28+
CHANGELOG_SEP_HEADER_TEXT_NONEMPTY=$(BR)$(BIG $(RELATIVE_LINK2 bugfix-list, List of all bug fixes and enhancements in D $(VER).))
29+
CHANGELOG_SEP_HEADER_TEXT=$(HR)
30+
CHANGELOG_SEP_TEXT_BUGZILLA=$(BR)$(BIG $(LNAME2 bugfix-list, List of all bug fixes and enhancements in D $(VER):))
31+
CHANGELOG_SEP_NO_TEXT_BUGZILLA=$(BR)$(BIG List of all bug fixes and enhancements in D $(VER).)
32+
33+
BUGSTITLE_TEXT_HEADER=$(BUGSTITLE $1, $+)
34+
BUGSTITLE_TEXT_BODY=$(BUGSTITLE $1, $+)
35+
BUGSTITLE_BUGZILLA=$(BUGSTITLE $1, $+)
36+
37+
_= The following D_CONTRIBUTOR macros are emitted by the ../tools/changed.d script
38+
D_CONTRIBUTORS_HEADER=$(H3 Contributors to this release ($1))
39+
$(P A huge thanks goes to all the awesome people who made this release possible.)
40+
D_CONTRIBUTORS=$(UL $1)
41+
D_CONTRIBUTOR=$(LI $1)
42+
D_CONTRIBUTORS_FOOTER=
43+
3544

3645
BUGZILLA = <a href="https://issues.dlang.org/show_bug.cgi?id=$0">Bugzilla $0</a>
3746
CPPBUGZILLA = <a href="http://bugzilla.digitalmars.com/issues/show_bug.cgi?id=$0">Bugzilla $0</a>

changelog/next_version.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -ueo pipefail
4+
5+
# cd and pwd to account for relative paths/symlinks. See also:
6+
# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
7+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8+
9+
VERSION=$(cat "${1:-$DIR/../../dmd/VERSION}")
10+
# v2.076.1-b1 -> 2.076.1
11+
VERSION=${VERSION:1:7}
12+
# 2.076.1 -> (2 076 1)
13+
PARTS=(${VERSION//./ })
14+
# use 10#076 prefix to read octal as base10 int
15+
PARTS[1]=0$((10#${PARTS[1]} + 1))
16+
PARTS[2]=0
17+
# 2 077 0 -> 2.077.0
18+
echo "${PARTS[0]}.${PARTS[1]}.${PARTS[2]}"

changelog/pending.ddoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
VERSION=
2+
$(DIVC version,
3+
$(P
4+
$(B $(LARGE $(LINK2 http://nightlies.dlang.org, Download D nightlies)))$(BR)
5+
$(SMALL $1)
6+
)
7+
$3
8+
)
9+
CHANGELOG_SEP_HEADER_TEXT_NONEMPTY=$(BR)$(BIG $(RELATIVE_LINK2 bugfix-list, List of all upcoming bug fixes and enhancements in D $(VER).))

chmgen.d

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ string[] brokenLinks = [
3434
string docRoot = `.`;
3535
string chmDir = "chm";
3636
bool prerelease;
37+
string target;
3738

3839
// ********************************************************************
3940

@@ -133,7 +134,9 @@ void main(string[] args)
133134
"root", &docRoot,
134135
"dir", &chmDir,
135136
"pre", &prerelease,
137+
"target", &target,
136138
);
139+
prerelease = target == "prerelease";
137140

138141
bool chm = !onlyTags;
139142

@@ -266,7 +269,7 @@ void loadNavigation()
266269
stderr.writeln("Loading navigation");
267270

268271
import std.json;
269-
auto text = (prerelease ? "chm-nav-pre.json" : "chm-nav.json")
272+
auto text = ("chm-nav-" ~ target ~ ".json")
270273
.readText()
271274
.replace("\r", "")
272275
.replace("\n", "")
@@ -515,7 +518,7 @@ void writeTags()
515518

516519
// D syntax
517520
File f;
518-
f.open(`d.tag`, "wt");
521+
f.open("d-" ~ target ~ ".tag", "wt");
519522
f.writeln("[");
520523
foreach (keyword; keywordList)
521524
{
@@ -538,7 +541,7 @@ void writeTags()
538541
.byKeyValue
539542
.map!(kv => JSONValue(`http://dlang.org/` ~ kv.key ~ kv.value.anchor))
540543
.array);
541-
std.file.write("d-tags.json", j.toString());
544+
std.file.write("d-tags-" ~ target ~ ".json", j.toString());
542545
}
543546

544547
// ********************************************************************

code_coverage.dd

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,48 @@ $(P When the $(DDSUBLINK dmd,switch-cov, $(B -cov)) switch is thrown,
219219
the $(DDSUBLINK spec/version, PredefinedVersions, version identifier)
220220
$(B D_Coverage) is defined.)
221221

222+
$(P The standard runtime option passing mechanism can also be used to control how
223+
code coverage reports are generated at runtime. The command-line option $(D
224+
--DRT-covopt) or the environment variable $(D DRT_COVOPT) can be used to pass
225+
options. Options are passed separated by spaces as key,value with the following
226+
format: $(D key:value). Current options are:)
227+
228+
$(DL
229+
$(SWITCH $(SWNAME merge),
230+
Merge the current run with existing reports if `1`, or overwrite the existing reports if `0`.
231+
)
232+
$(SWITCH $(SWNAME srcpath),
233+
Set path to where source files are located.
234+
)
235+
$(SWITCH $(SWNAME dstpath),
236+
Set path to where listing files are to be written (must exist).
237+
)
238+
)
239+
240+
$(H4 Example:)
241+
242+
$(CONSOLE
243+
sieve --DRT-covopt="merge:1"
244+
mkdir reports
245+
sieve --DRT-covopt="merge:1 dstpath:reports"
246+
)
247+
248+
$(P Will merge the results of this run with the previous run in the $(D
249+
sieve.lst) file in the current directory. While:)
250+
251+
$(CONSOLE
252+
mkdir reports
253+
sieve --DRT-covopt="dstpath:reports"
254+
)
255+
256+
$(P Will create a new report in $(D reports/sieve.lst). Another run adding $(D
257+
merge) will add to the new report:)
258+
259+
$(CONSOLE
260+
sieve --DRT-covopt="merge:1 dstpath:reports"
261+
)
262+
263+
222264
$(H3 References)
223265

224266
$(LINK2 https://en.wikipedia.org/wiki/Code_coverage, Wikipedia)

contributors.dd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Ddoc
2+
3+
$(D_S $(TITLE),
4+
5+
$(P
6+
A list of all the awesome people that made D possible.
7+
)
8+
9+
$(UL
10+
$(D_CONTRIBUTORS)
11+
)
12+
13+
)
14+
15+
Macros:
16+
TITLE=Contributors ($(NR_D_CONTRIBUTORS))
17+
D_CONTRIBUTOR=$(LI $1)

0 commit comments

Comments
 (0)