From 2ec2d2da630963f28cea65eb230cfecf9db91a1e Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 24 Dec 2016 12:19:19 +0100 Subject: [PATCH 01/70] move example buttons to the left --- css/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index 7575bc9b4a..aa68ddcc3e 100644 --- a/css/style.css +++ b/css/style.css @@ -2116,5 +2116,5 @@ dt.d_decl:hover .decl_anchor { /* Style for the example run buttons on the Phobos library documentation */ .d_example_buttons { - text-align: right; + text-align: left; } From 3ac7e4618c5c8f7a6fa9cdcbe2b72c09bc76f36a Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 24 Dec 2016 12:19:44 +0100 Subject: [PATCH 02/70] update ddox to 0.15.18 --- dpl-docs/dub.selections.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dpl-docs/dub.selections.json b/dpl-docs/dub.selections.json index 940e1a480a..461d91224a 100644 --- a/dpl-docs/dub.selections.json +++ b/dpl-docs/dub.selections.json @@ -1,15 +1,15 @@ { "fileVersion": 1, "versions": { - "ddox": "0.15.15", + "ddox": "0.15.18", "experimental_allocator": "2.70.0-b1", "hyphenate": "1.1.1", "libasync": "0.7.9", - "libdparse": "0.6.0", + "libdparse": "0.7.0-beta.2", "libev": "5.0.0+4.04", - "libevent": "2.0.1+2.0.16", - "memutils": "0.4.5", + "libevent": "2.0.2+2.0.16", + "memutils": "0.4.8", "openssl": "1.1.4+1.0.1g", - "vibe-d": "0.7.28" + "vibe-d": "0.7.30" } } From 5e3ad15a196f0066144050fb96d769385f11d3c4 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 24 Dec 2016 12:20:29 +0100 Subject: [PATCH 03/70] Use new DDOX_UNITTEST_HEADER macro to define custom behavior of unittest blocks --- std-ddox.ddoc | 1 + 1 file changed, 1 insertion(+) diff --git a/std-ddox.ddoc b/std-ddox.ddoc index a2e3230bb1..5129a2961f 100644 --- a/std-ddox.ddoc +++ b/std-ddox.ddoc @@ -9,4 +9,5 @@ REF_ALTTEXT=$(DDOX_NAMED_REF $(REF_HELPER $+), $1) MREF_HELPER=$1$(DOT_PREFIXED $+) MREF=$(D $(MREF_HELPER $1, $+)) MREF_ALTTEXT=$(DDOX_NAMED_REF $(MREF_HELPER $+), $1) +DDOX_UNITTEST_HEADER= _= From fa4c1564e659396737847908bd26db57e8f8653e Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 24 Dec 2016 12:21:23 +0100 Subject: [PATCH 04/70] Ddox view: include run_examples.js & fix body id to the module (as ddoc) --- dpl-docs/views/layout.dt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dpl-docs/views/layout.dt b/dpl-docs/views/layout.dt index 6e127c1fd4..9f081901bc 100644 --- a/dpl-docs/views/layout.dt +++ b/dpl-docs/views/layout.dt @@ -28,7 +28,7 @@ html(lang='en-US') script(type="text/javascript", src="#{root_dir}js/ddox.js") meta(name='viewport', content='width=device-width, initial-scale=1.0, minimum-scale=0.1, maximum-scale=10.0') - body.std(id='Phobos Runtime Library') + body.std(id='#{info.node.moduleName}') script(type='text/javascript'). document.body.className += ' have-javascript'; #top @@ -223,7 +223,8 @@ html(lang='en-US') script(type='text/javascript', src='#{root_dir}js/codemirror-compressed.js') | script(type='text/javascript', src='#{root_dir}js/run.js') - | + - if (!haveVersion) + script(type='text/javascript', src='#{root_dir}js/run_examples.js') script(type='text/javascript', src='#{root_dir}js/dlang.js') script(type='text/javascript', src='#{root_dir}js/listanchors.js') script(type='text/javascript'). From 8d18fa7975a261279382dadfb2160a6beba08cf0 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 24 Dec 2016 12:21:52 +0100 Subject: [PATCH 05/70] update js/run_examples code s.t. it supports ddox --- js/run.js | 16 ++++++++-------- js/run_examples.js | 12 ++++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/js/run.js b/js/run.js index afddb1403b..75cd7f03d3 100644 --- a/js/run.js +++ b/js/run.js @@ -471,9 +471,9 @@ function setupTextarea(el, opts) var orgStdin = stdin.val(); } - var hideAllWindows = function(args) + var hideAllWindows = function(optArguments) { - args = args || {}; + optArguments = optArguments || {}; if (opts.stdin) { stdinDiv.css('display', 'none'); } @@ -481,10 +481,10 @@ function setupTextarea(el, opts) argsDiv.css('display', 'none'); } outputDiv.css('display', 'none'); - if (!args.keepPlainSourceCode) { + if (!optArguments.keepPlainSourceCode) { plainSourceCode.css('display', 'none'); } - if (!args.keepCode) { + if (!optArguments.keepCode) { code.css('display', 'none'); } }; @@ -531,13 +531,13 @@ function setupTextarea(el, opts) runBtn.click(function(){ resetBtn.css('display', 'inline-block'); $(this).attr("disabled", true); - var args = {}; + var optArguments = {}; // check what boxes are currently open if (opts.keepCode) { - args.keepCode = code.is(":visible"); - args.keepPlainSourceCode = plainSourceCode.is(":visible"); + optArguments.keepCode = code.is(":visible"); + optArguments.keepPlainSourceCode = plainSourceCode.is(":visible"); } - hideAllWindows(args); + hideAllWindows(optArguments); output.css('height', opts.outputHeight || height(31)); outputDiv.css('display', 'block'); outputTitle.text("Application output"); diff --git a/js/run_examples.js b/js/run_examples.js index 28804beb93..48b448cf8e 100644 --- a/js/run_examples.js +++ b/js/run_examples.js @@ -51,12 +51,14 @@ $(document).ready(function() // ignore not yet compatible modules // copied from Phobos posix.mak var ignoredModulesList = "allocator/allocator_list.d,allocator/building_blocks/allocator_list.d,allocator/building_blocks/free_list.d,allocator/building_blocks/quantizer,allocator/building_blocks/quantizer,allocator/building_blocks/stats_collector.d,base64.d,bitmanip.d,concurrency.d,conv.d,csv.d,datetime.d,digest/hmac.d,digest/sha.d,file.d,index.d,isemail.d,logger/core.d,logger/nulllogger.d,math.d,ndslice/selection.d,ndslice/slice.d,numeric.d,stdio.d,traits.d,typecons.d,uni.d,utf.d,uuid.d".split(",") - var currentModulePath = $('body')[0].id.replace('.', '/') + '.d'; - if (ignoredModulesList.filter(function(x) { currentModulePath.indexOf(x) >= 0 }).length > 0) { + var currentModulePath = $('body')[0].id.split('.').join('/') + '.d'; + if (ignoredModulesList.filter(function(x) { return currentModulePath.indexOf(x) >= 0 }).length > 0) { return; } - $('pre[class~=d_code]').each(function(index) + // first selector is for ddoc - second for ddox + var codeBlocks = $('pre[class~=d_code]').add('pre[class~=code]'); + codeBlocks.each(function(index) { var currentExample = $(this); var orig = currentExample.html(); @@ -64,8 +66,10 @@ $(document).ready(function() orig = reformatExample(orig); // check whether it is from a ddoced unittest + // 1) check is for ddoc, 2) for ddox // manual created tests most likely can't be run without modifications - if (!$(this).parent().parent().prev().hasClass("dlang_runnable")) + if (!($(this).parent().parent().prev().hasClass("dlang_runnable") || + $(this).prev().children(":first").hasClass("dlang_runnable"))) return; currentExample.replaceWith( From 456a6a93197828d9f260734fd440da9b7b166ebf Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Tue, 27 Dec 2016 12:45:54 +0100 Subject: [PATCH 06/70] Ddox: Show exact source code links for multiple declarations --- dpl-docs/views/layout.dt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpl-docs/views/layout.dt b/dpl-docs/views/layout.dt index 6e127c1fd4..e45285befa 100644 --- a/dpl-docs/views/layout.dt +++ b/dpl-docs/views/layout.dt @@ -164,7 +164,7 @@ html(lang='en-US') - project = "druntime", path_prefix = "src/"; - else - project = "phobos", path_prefix = ""; - - if (info.docGroups.length == 1) + - if (info.docGroups.length >= 1) - if (auto decl = cast(Declaration)info.docGroups[0].members[0]) line_suffix = "#L"~to!string(decl.line); - if (info.node.module_.isPackageModule) - filename = replace(modname, ".", "/") ~ "/package.d"; From 19f73b8390de200ae22cfbbef55f579a8d7a0683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chaloupka?= Date: Sat, 7 Jan 2017 14:33:25 +0100 Subject: [PATCH 07/70] Fix typo minIndex -> maxIndex --- changelog/2.073.0_pre.dd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog/2.073.0_pre.dd b/changelog/2.073.0_pre.dd index 1e9bca0ba1..34d3e1464f 100644 --- a/changelog/2.073.0_pre.dd +++ b/changelog/2.073.0_pre.dd @@ -74,10 +74,10 @@ $(LI $(LNAME2 std-algorithm-searching-maxindex,Added `std.algorithm.searching.ma ------- import std.algorithm.searching : maxIndex; int[] a = [5, 4, 2, 1, 9, 10]; - assert(a.minIndex == 5); + assert(a.maxIndex == 5); int[] a; - assert(a.minIndex == -1); + assert(a.maxIndex == -1); ------- ) From da5236890152e328637a537a63dff11cd3125173 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 7 Jan 2017 16:19:55 +0100 Subject: [PATCH 08/70] ddox runnable examples: use :last to avoid interference with inline text --- js/run_examples.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/run_examples.js b/js/run_examples.js index 48b448cf8e..22e75afb5c 100644 --- a/js/run_examples.js +++ b/js/run_examples.js @@ -69,7 +69,7 @@ $(document).ready(function() // 1) check is for ddoc, 2) for ddox // manual created tests most likely can't be run without modifications if (!($(this).parent().parent().prev().hasClass("dlang_runnable") || - $(this).prev().children(":first").hasClass("dlang_runnable"))) + $(this).prev().children(":last").hasClass("dlang_runnable"))) return; currentExample.replaceWith( From 3ed4ef3f48be2a93b4278bfac390e45e87355942 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 7 Jan 2017 18:49:23 +0100 Subject: [PATCH 09/70] Update runnable modules blacklist --- js/run_examples.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/run_examples.js b/js/run_examples.js index 22e75afb5c..474fbd2636 100644 --- a/js/run_examples.js +++ b/js/run_examples.js @@ -50,7 +50,7 @@ $(document).ready(function() // ignore not yet compatible modules // copied from Phobos posix.mak - var ignoredModulesList = "allocator/allocator_list.d,allocator/building_blocks/allocator_list.d,allocator/building_blocks/free_list.d,allocator/building_blocks/quantizer,allocator/building_blocks/quantizer,allocator/building_blocks/stats_collector.d,base64.d,bitmanip.d,concurrency.d,conv.d,csv.d,datetime.d,digest/hmac.d,digest/sha.d,file.d,index.d,isemail.d,logger/core.d,logger/nulllogger.d,math.d,ndslice/selection.d,ndslice/slice.d,numeric.d,stdio.d,traits.d,typecons.d,uni.d,utf.d,uuid.d".split(",") + var ignoredModulesList = "base64.d,building_blocks/free_list,building_blocks/quantizer,digest/hmac.d,file.d,index.d,math.d,ndslice/selection.d,stdio.d,traits.d,typecons.d,uuid.d".split(",") var currentModulePath = $('body')[0].id.split('.').join('/') + '.d'; if (ignoredModulesList.filter(function(x) { return currentModulePath.indexOf(x) >= 0 }).length > 0) { return; From e22187edc61489d2dd4df532a28a5096543533e2 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Thu, 12 Jan 2017 14:32:07 +0000 Subject: [PATCH 10/70] Tweak D for C, C++ programmers --- cpptod.dd | 25 +++++++++++++++++-------- ctod.dd | 26 +++++++++++++------------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/cpptod.dd b/cpptod.dd index 83efe76167..0bc5b3e2ef 100644 --- a/cpptod.dd +++ b/cpptod.dd @@ -45,7 +45,7 @@ class Foo $(H4 The D Way) - Constructors are defined with the this keyword: + Constructors are defined with the `this` keyword: ------ class Foo @@ -76,7 +76,7 @@ class B : A $(H4 The D Way) - The base class constructor is called with the super syntax: + The base class constructor is called with the `super` syntax: ------ class A { this() { ... } } @@ -573,24 +573,33 @@ void test() $(H4 The D Way) The D version is analogous, though a little simpler, taking - advantage of promotion of single template members to the + advantage of + $(HTTPS dlang.org/spec/template.html#implicit_template_properties, + Eponymous Templates) - promotion of single template members to the enclosing name space: - ------ template factorial(int n) { - enum { factorial = n * .factorial!(n-1) } + enum factorial = n * .factorial!(n-1); } template factorial(int n : 1) { - enum { factorial = 1 } + enum factorial = 1; } void test() { - writefln("%d", factorial!(4)); // prints 24 + writeln(factorial!(4)); // prints 24 } +------ + The template blocks can be made shorter using + $(HTTPS dlang.org/spec/template.html#variable-template, + Enum Template) syntax: +------ +enum factorial(int n) = n * .factorial!(n-1); + +enum factorial(int n : 1) = 1; ------
$(COMMENT -------------------------------------------- ) @@ -800,7 +809,7 @@ template IsFunctionT(T) void test() { - typedef int fp(int); + alias int fp(int); assert(IsFunctionT!(fp) == 1); } diff --git a/ctod.dd b/ctod.dd index d40703191b..35f14036e9 100644 --- a/ctod.dd +++ b/ctod.dd @@ -78,7 +78,7 @@ sizeof(struct Foo) $(H4 The D Way) -$(P Use the size property:) +$(P Use the `sizeof` property:) ---------------------------- int.sizeof @@ -137,8 +137,8 @@ _Imaginary long double => ireal _Complex long double => creal ) $(P - Although char is an unsigned 8 bit type, and - wchar is an unsigned 16 bit type, they have their own separate types + Although `char` is an unsigned 8-bit type, and + `wchar` is an unsigned 16-bit type, they have their own separate types in order to aid overloading and type safety. ) $(P Ints and unsigneds in C are of varying size; not so in D.) @@ -194,7 +194,7 @@ long double r = fmodl(x,y); $(H4 The D Way) -D supports the remainder ('%') operator on floating point operands: +D supports the remainder (`%`) operator on floating point operands: ---------------------------- float f = x % y; @@ -295,7 +295,7 @@ for (i = 0; i < sizeof(array) / sizeof(array[0]); i++) $(H4 The D Way) -The length of an array is accessible through the property "length". +The length of an array is accessible through the property `length`. ---------------------------- int[17] array; @@ -319,7 +319,7 @@ foreach (value; array) func(value); ---------------------------- -or through the ref keyword (for reference access): +or through the `ref` keyword (for reference access): ---------------------------- int[17] array; @@ -406,7 +406,7 @@ memcpy(s + lens, hello, sizeof(hello)); $(H4 The D Way) - D overloads the operators ~ and ~= for char and wchar arrays to mean + D overloads the operators `~` and `~=` for char and wchar arrays to mean concatenate and append, respectively: ---------------------------- @@ -582,7 +582,7 @@ $(H3 Struct tag name space) $(H4 The C Way) - It's annoying to have to put the struct keyword every time a type is specified, + It's annoying to have to put the `struct` keyword every time a type is specified, so a common idiom is to use: $(CCODE @@ -1181,7 +1181,7 @@ if (strcmp(str, "betty") == 0) // do strings match? $(H4 The D Way) - Why not use the == operator? + Why not use the `==` operator? ----------------------------- string str = "hello"; @@ -1394,7 +1394,7 @@ $(H3 Unsigned Right Shift) $(H4 The C Way) - The right shift operators >> and >>= are signed + The right shift operators `>>` and `>>=` are signed shifts if the left operand is a signed integral type, and are unsigned right shifts if the left operand is an unsigned integral type. To produce an unsigned right shift on an int, @@ -1422,9 +1422,9 @@ j = (unsigned)i >> 3; $(H4 The D Way) - D has the right shift operators >> and >>= which + D has the right shift operators `>>` and `>>=` which behave as they do in C. But D also has explicitly unsigned - right shift operators >>> and >>>= which will + right shift operators `>>>` and `>>>=` which will do an unsigned right shift regardless of the sign of the left operand. Hence, @@ -1579,7 +1579,7 @@ int main() $(H4 The D Way) - The ... following an array parameter declaration means that + The `...` following an array parameter declaration means that the trailing arguments are collected together to form an array. The arguments are type checked against the array type, and the number of arguments becomes a property From 551af09a6407be1fc6e42848c11eec49c09b2fad Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Fri, 13 Jan 2017 11:58:44 +0000 Subject: [PATCH 11/70] Make suggested edits --- ctod.dd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctod.dd b/ctod.dd index 35f14036e9..6112b67316 100644 --- a/ctod.dd +++ b/ctod.dd @@ -295,7 +295,7 @@ for (i = 0; i < sizeof(array) / sizeof(array[0]); i++) $(H4 The D Way) -The length of an array is accessible through the property `length`. +The length of an array is accessible through the `length` property. ---------------------------- int[17] array; @@ -582,7 +582,7 @@ $(H3 Struct tag name space) $(H4 The C Way) - It's annoying to have to put the `struct` keyword every time a type is specified, + It's annoying to have to use the `struct` keyword every time a type is specified, so a common idiom is to use: $(CCODE From c14b46884a07468d6f8dee3992e53a9b665083cc Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 28 Jan 2017 12:05:25 +0100 Subject: [PATCH 12/70] Use runnable examples for released docs --- js/run_examples.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/js/run_examples.js b/js/run_examples.js index 22e75afb5c..3dad58a223 100644 --- a/js/run_examples.js +++ b/js/run_examples.js @@ -44,10 +44,6 @@ $(document).ready(function() if (!$('body').hasClass("std")) return; - // only enable for pre-release version - if (location.pathname.indexOf("prerelease") < 0) - return; - // ignore not yet compatible modules // copied from Phobos posix.mak var ignoredModulesList = "allocator/allocator_list.d,allocator/building_blocks/allocator_list.d,allocator/building_blocks/free_list.d,allocator/building_blocks/quantizer,allocator/building_blocks/quantizer,allocator/building_blocks/stats_collector.d,base64.d,bitmanip.d,concurrency.d,conv.d,csv.d,datetime.d,digest/hmac.d,digest/sha.d,file.d,index.d,isemail.d,logger/core.d,logger/nulllogger.d,math.d,ndslice/selection.d,ndslice/slice.d,numeric.d,stdio.d,traits.d,typecons.d,uni.d,utf.d,uuid.d".split(",") From 6f300576c2d2aa5b119f0cc487e8062b46cc42e3 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Mon, 6 Feb 2017 11:09:03 +0100 Subject: [PATCH 13/70] Update high-level vision link --- index.dd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.dd b/index.dd index a75a365fd6..1ee8261b5c 100644 --- a/index.dd +++ b/index.dd @@ -125,7 +125,7 @@ $(DIVC boxes, on $(LINK2 https://twitter.com/D_Programming, Twitter). Browse the $(LINK2 https://wiki.dlang.org/, wiki) where among other things you can find the - $(LINK2 https://wiki.dlang.org/Vision/2016H2, high-level vision) + $(LINK2 https://wiki.dlang.org/Vision/2017H1, high-level vision) of the $(LINK2 $(ROOT_DIR)foundation.html, D foundation). ) ) From 9bcdcaca792e5f69f398a41ee92d44e76f7ce211 Mon Sep 17 00:00:00 2001 From: alphaKAI Date: Mon, 30 Jan 2017 04:07:07 +0900 Subject: [PATCH 14/70] add gnex into orgs --- images/orgs-using-d/gnex.png | Bin 0 -> 2984 bytes images/orgs-using-d/gnex_hq.png | Bin 0 -> 9619 bytes orgs-using-d.dd | 7 +++++++ 3 files changed, 7 insertions(+) create mode 100644 images/orgs-using-d/gnex.png create mode 100644 images/orgs-using-d/gnex_hq.png diff --git a/images/orgs-using-d/gnex.png b/images/orgs-using-d/gnex.png new file mode 100644 index 0000000000000000000000000000000000000000..dc6a145079c34c98588267bea3ed8ebe4bcb1465 GIT binary patch literal 2984 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 xF`STktqNG literal 0 HcmV?d00001 diff --git a/orgs-using-d.dd b/orgs-using-d.dd index fb71da6e94..14926d7140 100644 --- a/orgs-using-d.dd +++ b/orgs-using-d.dd @@ -100,6 +100,13 @@ $(DIVC orgs-using-d center, $(FA_HIRING www.funkwerk.com/karriere/stellenangebote) ) ) + $(DORG GNEX, https://globalnet-ex.com, gnex.png, + Digital Marketing Solutions Company., + $(LINK_ROW + $(FA_GITHUB gnexltd) $(FA_SEPARATOR) + $(FA_HIRING globalnet-ex.com/employment/engineer) + ) + ) $(DORG Infognition, http://www.infognition.com, infognition.svg, Video processing, $(FA_QUOTE From b376ace49946a29366d6e2248dbc67bd3167539e Mon Sep 17 00:00:00 2001 From: e-y-e Date: Wed, 8 Feb 2017 20:27:54 +0000 Subject: [PATCH 15/70] Add RISCV32 and RISCV64 version identifiers --- spec/version.dd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/version.dd b/spec/version.dd index 5964007d45..e5550068c2 100644 --- a/spec/version.dd +++ b/spec/version.dd @@ -279,6 +279,8 @@ $(H3 $(LEGACY_LNAME2 PredefinedVersions, predefined-versions, Predefined Version $(TROW $(ARGS $(D MIPS_HardFloat)) , $(ARGS The MIPS $(D hard-float) ABI)) $(TROW $(ARGS $(D NVPTX)) , $(ARGS The Nvidia Parallel Thread Execution (PTX) architecture, 32-bit)) $(TROW $(ARGS $(D NVPTX64)) , $(ARGS The Nvidia Parallel Thread Execution (PTX) architecture, 64-bit)) + $(TROW $(ARGS $(D RISCV32)) , $(ARGS The RISC-V architecture, 32-bit)) + $(TROW $(ARGS $(D RISCV64)) , $(ARGS The RISC-V architecture, 64-bit)) $(TROW $(ARGS $(D SPARC)) , $(ARGS The SPARC architecture, 32-bit)) $(TROW $(ARGS $(D SPARC_V8Plus)) , $(ARGS The SPARC v8+ ABI)) $(TROW $(ARGS $(D SPARC_SoftFloat)) , $(ARGS The SPARC soft float ABI)) From 69e7b93e5078f00afcb70cd7ddb58fc7d63671e8 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sat, 11 Feb 2017 19:27:41 +0000 Subject: [PATCH 16/70] posix.mak: Work around DMD bug manifesting on certain filesystems If the files are passed to DMD in a different order, Phobos fails to compile. For example, this happens when the Phobos source code is on a tmpfs, but not on ext4 or btrfs. Work around this by sorting the Phobos source file list before passing in to DMD. --- posix.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posix.mak b/posix.mak index 5bc1207ea3..454ad8380e 100644 --- a/posix.mak +++ b/posix.mak @@ -455,7 +455,7 @@ docs.json : ${DMD_REL} ${DRUNTIME_DIR}-${LATEST} \ find ${DRUNTIME_DIR}-${LATEST}/src -name '*.d' | \ sed -e /unittest.d/d -e /gcstub/d > .release-files.txt find ${PHOBOS_DIR}-${LATEST} -name '*.d' | \ - sed -e /unittest.d/d -e /windows/d >> .release-files.txt + sed -e /unittest.d/d -e /windows/d | sort >> .release-files.txt ${DMD_REL} -c -o- -version=CoreDdoc -version=StdDdoc -Df.release-dummy.html \ -Xfdocs.json -I${PHOBOS_DIR}-${LATEST} @.release-files.txt ${DPL_DOCS} filter docs.json --min-protection=Protected \ From f49c3460b94f024d6920ecb05604bb75f7c5a3fc Mon Sep 17 00:00:00 2001 From: Johannes Pfau Date: Tue, 14 Feb 2017 16:26:11 +0100 Subject: [PATCH 17/70] Update FAQ: Shared does not cause memory barriers See https://github.com/dlang/dlang.org/pull/1570 https://issues.dlang.org/show_bug.cgi?id=14932 https://issues.dlang.org/show_bug.cgi?id=16198 --- faq.dd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/faq.dd b/faq.dd index c59bd63e9f..a803a26717 100644 --- a/faq.dd +++ b/faq.dd @@ -118,8 +118,7 @@ $(ITEM shared_synchronized, What does shared have to do with synchronization?) $(ITEM shared_memory_barriers, What does shared have to do with memory barriers?) - $(P Reading/writing shared data emits memory barriers to ensure sequential consistency (not - implemented). + $(Currently the compiler does not insert memory barriers around shared variables. ) $(ITEM casting_to_shared, What are the semantics of casting FROM unshared TO shared?) From 457e4a38bd192915a7a038c30da47215e5831581 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 15 Feb 2017 23:07:07 +0100 Subject: [PATCH 18/70] Enable runnable examples on releases docs --- dpl-docs/views/layout.dt | 3 +-- std_navbar-release.ddoc | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dpl-docs/views/layout.dt b/dpl-docs/views/layout.dt index d778c8c76a..08e2aede10 100644 --- a/dpl-docs/views/layout.dt +++ b/dpl-docs/views/layout.dt @@ -223,8 +223,7 @@ html(lang='en-US') script(type='text/javascript', src='#{root_dir}js/codemirror-compressed.js') | script(type='text/javascript', src='#{root_dir}js/run.js') - - if (!haveVersion) - script(type='text/javascript', src='#{root_dir}js/run_examples.js') + script(type='text/javascript', src='#{root_dir}js/run_examples.js') script(type='text/javascript', src='#{root_dir}js/dlang.js') script(type='text/javascript', src='#{root_dir}js/listanchors.js') script(type='text/javascript'). diff --git a/std_navbar-release.ddoc b/std_navbar-release.ddoc index 7899a22e2c..3712f926fe 100644 --- a/std_navbar-release.ddoc +++ b/std_navbar-release.ddoc @@ -13,3 +13,4 @@ $(SUBNAV_TEMPLATE $(UL $(MODULE_MENU)) ) _= +EXTRA_FOOTERS=$(SCRIPTLOAD $(STATIC js/run_examples.js)) From ab5ba6b4de189c30d963d9c04c06d7ca55b927ad Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 7 Jan 2017 22:01:22 +0100 Subject: [PATCH 19/70] Return editor instance from bootstrap function --- js/run.js | 1 + js/run_examples.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/js/run.js b/js/run.js index 75cd7f03d3..a5095cdeb6 100644 --- a/js/run.js +++ b/js/run.js @@ -576,6 +576,7 @@ function setupTextarea(el, opts) } }); }); + return editor; }; diff --git a/js/run_examples.js b/js/run_examples.js index 1d7c155c95..3c169b8f41 100644 --- a/js/run_examples.js +++ b/js/run_examples.js @@ -90,15 +90,15 @@ $(document).ready(function() var parent = $(this).parent(); var btnParent = parent.parent().children(".d_example_buttons"); var outputDiv = parent.parent().children(".d_code_output"); - setupTextarea(this, { - parent: btnParent, - outputDiv: outputDiv, - stdin: false, - args: false, - transformOutput: wrapIntoMain, - defaultOutput: "All tests passed", - keepCode: true, - outputHeight: "auto" - }); + var editor = setupTextarea(this, { + parent: btnParent, + outputDiv: outputDiv, + stdin: false, + args: false, + transformOutput: wrapIntoMain, + defaultOutput: "All tests passed", + keepCode: true, + outputHeight: "auto" + }); }); }); From 7e75b64eb52ee3b916e7fe745923086cb894893a Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 7 Jan 2017 22:02:30 +0100 Subject: [PATCH 20/70] Support assert to writeln rewrite magic with ddox --- js/run_examples.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/run_examples.js b/js/run_examples.js index 3c169b8f41..ecfcb8fa4a 100644 --- a/js/run_examples.js +++ b/js/run_examples.js @@ -8,7 +8,7 @@ // turns asserts into writeln function reformatExample(code) { - return code.replace(/(assert<\/span>\((.*)==(.*)\);)+/g, function(match, text, left, right) { + return code.replace(/(assert<\/span>(?:)?\((.*)==(.*)\);)+/g, function(match, text, left, right) { return "writeln(" + left.trim() + "); " + "// " + right.trim() + ""; }); From 0fd2bdecba01e57bf548fb23d06d30772acf3988 Mon Sep 17 00:00:00 2001 From: "H. S. Teoh" Date: Fri, 17 Feb 2017 09:34:40 -0800 Subject: [PATCH 21/70] Point user to std.array.byPair if compatibility with Tuple is desired. --- spec/hash-map.dd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/hash-map.dd b/spec/hash-map.dd index f27753df00..2facff429f 100644 --- a/spec/hash-map.dd +++ b/spec/hash-map.dd @@ -341,7 +341,11 @@ Properties for associative arrays are: ForeachStatement) which will iterate over key-value pairs of the associative array. The returned pairs are represented by an opaque type with $(D .key) and $(D .value) properties for accessing the key and - value of the pair, respectively.)) + value of the pair, respectively. Note that this is a low-level + interface to iterating over the associative array and is not compatible + with the $(LINK2 $(ROOT_DIR)phobos/std_typecons.html#.Tuple,`Tuple`) + type in Phobos. For compatibility with `Tuple`, use + $(LINK2 $(ROOT_DIR)phobos/std_array.html#.byPair,std.array.byPair) instead.)) $(TROW $(D .get(Key key, lazy Value defVal)), $(ARGS Looks up $(D key); if it exists returns corresponding value else evaluates and returns $(D defVal).)) From d5f86f090009a6ad5b42adfc80b1d3a261e5a301 Mon Sep 17 00:00:00 2001 From: Steven Schveighoffer Date: Fri, 17 Feb 2017 13:10:11 -0500 Subject: [PATCH 22/70] Update documentation to reflect new defaults for cycle detection --- spec/module.dd | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/spec/module.dd b/spec/module.dd index 547cb3469e..3efab02bc1 100644 --- a/spec/module.dd +++ b/spec/module.dd @@ -549,18 +549,19 @@ $(H3 $(LNAME2 override_cycle_abort, Overriding Cycle Detection Abort)) ) $(OL - $(LI `deprecate` The default behavior. This functions just like `abort`, - but will use the pre-2.072 algorithm to determine if the cycle was - undetected. If so, the old algorithm is used, but a deprecation - message is printed. After 2.073, the `abort` option will be the default.) - $(LI `abort` The normal behavior as described in the previous section. - After 2.073, this will be the default behavior.) + $(LI `abort` The default behavior. The normal behavior as described + in the previous section) + $(LI `deprecate` This functions just like `abort`, but upon cycle + detection the runtime will use a flawed pre-2.072 algorithm to + determine if the cycle was previously detected. If no cycles are + detected in the old algorithm, execution continues, but a + deprecation message is printed.) $(LI `print` Print all cycles detected, but do not abort execution. - Order of static construction is implementation defined, and not - guaranteed to be valid.) - $(LI `ignore` Do not abort execution or print any cycles. Order of - static construction is implementation defined, and not guaranteed - to be valid.) + When cycles are present, order of static construction is + implementation defined, and not guaranteed to be valid.) + $(LI `ignore` Do not abort execution or print any cycles. When + cycles are present, order of static construction is implementation + defined, and not guaranteed to be valid.) ) $(H3 $(LNAME2 order_of_static_ctors, Order of Static Construction within a Module)) From 81d4acb703ebd63a681dd34aa50668f3dc2417c1 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 18 Feb 2017 17:31:44 +0100 Subject: [PATCH 23/70] Disable regex assert -> writeln rewrite logic (for now) --- js/run.js | 4 ++-- js/run_examples.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/run.js b/js/run.js index a5095cdeb6..63a82ed5d4 100644 --- a/js/run.js +++ b/js/run.js @@ -370,7 +370,7 @@ $(document).ready(function() + '' + '
Command line arguments
' + '
' - + '
Application output
' + + '
Application output
Running...
' + '' + '' + '' @@ -456,7 +456,7 @@ function setupTextarea(el, opts) var plainSourceCode = parent.parent().children("div.d_code"); - var output = outputDiv.children("textarea.d_code_output"); + var output = outputDiv.children("pre.d_code_output"); var outputTitle = outputDiv.children("span.d_code_title"); if (opts.args) { var argsBtn = parent.children("input.argsButton"); diff --git a/js/run_examples.js b/js/run_examples.js index ecfcb8fa4a..ec29230e9d 100644 --- a/js/run_examples.js +++ b/js/run_examples.js @@ -59,7 +59,8 @@ $(document).ready(function() var currentExample = $(this); var orig = currentExample.html(); - orig = reformatExample(orig); + // disable regex assert -> writeln rewrite logic (for now) + //orig = reformatExample(orig); // check whether it is from a ddoced unittest // 1) check is for ddoc, 2) for ddox From d82ab8bb030b75312a4ff8ad13e1e485fab32fd2 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 18 Feb 2017 17:32:25 +0100 Subject: [PATCH 24/70] Run.js: make the output a pre area (-> allows auto-expand) --- css/style.css | 17 +++++++++++------ js/run_examples.js | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/css/style.css b/css/style.css index aa68ddcc3e..99f7409d82 100644 --- a/css/style.css +++ b/css/style.css @@ -1610,7 +1610,7 @@ div.changelog-nav /* Runnable-examples css */ textarea.d_code {display: none;} -textarea.d_code_output, textarea.d_code_stdin, textarea.d_code_args +textarea.d_code_stdin, textarea.d_code_args { text-align: left; border: none; @@ -1624,6 +1624,11 @@ textarea.d_code_output, textarea.d_code_stdin, textarea.d_code_args outline: none; } +pre.d_code_output { + border: none; + max-height: 30em; +} + div.d_code {margin: 0; padding: 0; background: #F5F5F5;} div.d_run_code {display: none;} div.d_code_output, div.d_code_stdin, div.d_code_args, div.d_code_unittest @@ -1681,6 +1686,11 @@ input.editButton:active position: relative; top: 1px; } input.resetButton{display: none} + +/* Style for the example run buttons on the Phobos library documentation */ +.d_example_buttons { + text-align: left; +} /* Runnable-examples css -end */ .page-contents @@ -2113,8 +2123,3 @@ dt.d_decl:hover .decl_anchor { text-decoration: none; color: #333; } - -/* Style for the example run buttons on the Phobos library documentation */ -.d_example_buttons { - text-align: left; -} diff --git a/js/run_examples.js b/js/run_examples.js index ec29230e9d..a7b775cf92 100644 --- a/js/run_examples.js +++ b/js/run_examples.js @@ -82,7 +82,7 @@ $(document).ready(function() + '
' + '' + '
' - + '
Application output
' + + '
Application output
Running...
' + '
' ); }); From c5ebd4d6a1f587e4aae91baeacf72537fa6f2a29 Mon Sep 17 00:00:00 2001 From: Nick Sabalausky Date: Sat, 18 Feb 2017 20:56:21 -0500 Subject: [PATCH 25/70] Fix: Invisible input/textarea text for light-on-dark systems --- css/style.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/css/style.css b/css/style.css index aa68ddcc3e..2e42179bf9 100644 --- a/css/style.css +++ b/css/style.css @@ -79,6 +79,12 @@ body > .container position: relative; } +input, textarea +{ + background: white; + color: #333; +} + /* top nav bar */ #top From 166af2aadd021752172d3cb8de2a104ddd2d1d97 Mon Sep 17 00:00:00 2001 From: Brian Zou Date: Thu, 9 Feb 2017 23:15:50 +0800 Subject: [PATCH 26/70] update putao github url --- orgs-using-d.dd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orgs-using-d.dd b/orgs-using-d.dd index 14926d7140..ad5eb657b8 100644 --- a/orgs-using-d.dd +++ b/orgs-using-d.dd @@ -120,7 +120,7 @@ $(DIVC orgs-using-d center, Science and technology for kids, Large scale use of D for distributed systems and cloud storage. $(LINK_ROW - $(FA_GITHUB putaolabs) $(FA_SEPARATOR) + $(FA_GITHUB huntlabs) $(FA_SEPARATOR) $(FA_HIRING job.oschina.net/position/792_118197_21895) ) ) From 9453d801020166e1d19f8f4584ee2dbeccd7a892 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Tue, 21 Feb 2017 03:19:07 +0100 Subject: [PATCH 27/70] Extend and beautify the Phobos style guide - Use H4 sections instead of nested lists - Apply better grouping - Moved unittest requirement to own "Template" group - Created a group "Brackets" for "Braces" and "Parentheses" - Added: - avoid unnecessary parentheses - space between binary operators, cast or lambdas - no space after unary operators, assert and function calls - Fix function declaration in the style example --- dstyle.dd | 96 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 32 deletions(-) diff --git a/dstyle.dd b/dstyle.dd index 63c8707341..1ada5f0acb 100644 --- a/dstyle.dd +++ b/dstyle.dd @@ -252,10 +252,10 @@ $(P Phobos and other official D source code, there are additional requirements: ) -$(UL - $(LI Braces should be on their own line. There are a few exceptions to this - (such as when declaring lambda functions), but with any normal function - block or type definition, the braces should be on their own line.) +$(H4 Brackets) + $(P Braces should be on their own line. There are a few exceptions to this + (such as when declaring lambda functions), but with any normal function + block or type definition, the braces should be on their own line.) ------------------------------- void func(int param) @@ -270,12 +270,17 @@ void func(int param) } } ------------------------------- - - $(LI Lines have a soft limit of 80 characters and a hard limit of 120 + $(P Avoid unnecessary parentheses:) +------------------------------- +(a == b) ? "foo" : "bar"; // NO +a == b ? "foo" : "bar"; // OK +------------------------------- +$(H4 Line length) + $(P Lines have a soft limit of 80 characters and a hard limit of 120 characters. This means that most lines of code should be no longer than 80 characters long but that they $(I can) exceed 80 characters when appropriate. However, they can $(I never) exceed 120 characters.) - +$(LISTSECTION Whitespace, $(LI Put a space after `for`, `foreach`, `if`, and `while`: ) ------------------------------- for (…) { … } @@ -286,7 +291,7 @@ while (…) { … } do { … } while (…); ------------------------------- $(LI Chains containing `else if (…)` or `else static if (…)` should set the - keywords on the same line:) + keywords on the same line:) ------------------------------- if (…) { @@ -297,38 +302,65 @@ else if (…) … } ------------------------------- + $(LI Put a space between binary operators, assignments, `cast`, and lambdas:) +------------------------------- +a + b +a / b +a == b +a && b +arr[1 .. 2] +int a = 100; +b += 1; +short c = cast(short) a; +filter!(a => a == 42); +------------------------------- + $(LI Put no space between unary operators, after `assert`, function calls:) +------------------------------- +a = !a && !(2 == -1); +bool b = ~a; +auto d = &c; +e++; +assert(*d == 42); +callMyFancyFunction("hello world"); +------------------------------- +) +$(LISTSECTION Imports, + $(LI Local, selective imports should be preferred over global imports) + $(LI Selective imports should have a space before and after the colon (`:`) like + `import std.range : zip`) + $(LI Imports should be sorted lexiographically.) +) +$(LISTSECTION Return type, + $(LI The return type should be stated $(I explicitly) wherever possible, + as it makes the documentation and source code easier to read.) + $(LI $(LINK2 https://dlang.org/spec/struct.html#nested, Function-nested) structs + (aka $(LINK2 https://wiki.dlang.org/Voldemort_types, Voldemort types)) + should be preferred over public `struct`s.) +) +$(LISTSECTION Attributes, + $(LI $(I Non-templated) functions should be annotated with + matching attributes (`@nogc`, `@safe`, `pure`, `nothrow`).) + $(LI $(I Templated) functions should $(B not) be annotated with attributes + as the compiler can infer them.) + $(LI $(B Every) $(I unittest) should be annotated + (e.g. `pure nothrow @nogc @safe unittest { ... }`) + to ensure the existence of attributes on the templated function.) +) +$(LISTSECTION Templates, $(LI `unittest` blocks should be avoided in templates. They will generate a new `unittest` for each instance, hence tests should be put outside of the template.) - ) - $(SUBLIST Imports, - $(LI Local, selective imports should be preferred over global imports) - $(LI Selective imports should have a space before and after the colon (`:`) like - `import std.range : zip`) - ) - $(SUBLIST Return type, - $(LI The return type should be stated $(I explicitly) wherever possible, - as it makes the documentation and source code easier to read.) - $(LI $(LINK2 https://dlang.org/spec/struct.html#nested, Function-nested) structs - (aka $(LINK2 https://wiki.dlang.org/Voldemort_types, Voldemort types)) - should be preferred over public `struct`s.) - ) - $(SUBLIST Attributes, - $(LI $(I Non-templated) functions should be annotated with - matching attributes (`@nogc`, `@safe`, `pure`, `nothrow`).) - $(LI $(I Templated) functions should $(B not) be annotated with attributes - as the compiler can infer them.) - $(LI $(B Every) $(I unittest) should be annotated - (e.g. `pure nothrow @nogc @safe unittest { ... }`) - to ensure the existence of attributes on the templated function.) - ) +) +$(LISTSECTION Declarations, $(LI Constraints on declarations should have the same indentation level as their declaration:) ------------------------------- -void foo(R) +void foo(R)(R r) if (R == 1) ------------------------------- +) +$(BR) $(P We are not necessarily recommending that all code follow these rules. They're likely to be controversial in any discussion on coding standards. @@ -339,5 +371,5 @@ $(P Macros: TITLE=The D Style - SUBLIST=$(H4 $1) $(UL $+) + LISTSECTION=$(H4 $1) $(UL $+) From 386c894b3e90ac265dc1f87e0dd8eaf9a02a3a99 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 22 Feb 2017 03:11:07 +0100 Subject: [PATCH 28/70] Fix Issue 17115 - Remove std.concurrencybase and std.stdiobase from the Doc's menu --- posix.mak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/posix.mak b/posix.mak index 3934c16f9a..5256232bef 100644 --- a/posix.mak +++ b/posix.mak @@ -41,9 +41,9 @@ STABLE_RDMD=$(STABLE_DMD_ROOT)/dmd2/$(OS)/$(if $(filter $(OS),osx),bin,bin$(MODE # exclude lists MOD_EXCLUDES_PRERELEASE=$(addprefix --ex=, gc. rt. core.internal. core.stdc.config core.sys. \ - std.c. std.algorithm.internal std.internal. std.regex.internal. \ - std.windows.iunknown std.windows.registry etc.linux.memoryerror std.stream std.cstream \ - std.socketstream std.experimental.ndslice.internal) + std.algorithm.internal std.c. std.concurrencybase std.internal. std.regex.internal. \ + std.windows.iunknown std.windows.registry etc.linux.memoryerror \ + std.experimental.ndslice.internal std.stdiobase) MOD_EXCLUDES_RELEASE=$(MOD_EXCLUDES_PRERELEASE) From a7e7c0be54a00f0abec8480633076bb0e8c6e13b Mon Sep 17 00:00:00 2001 From: Jonas Drewsen Date: Sat, 25 Feb 2017 16:17:06 +0100 Subject: [PATCH 29/70] Specify exact type of 501(c) organization According to http://forum.dlang.org/post/nq1pt6$1mba$1@digitalmars.com the exact type is (3). This change adds that to the foundation page. --- foundation.dd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundation.dd b/foundation.dd index d7a39abcd7..43222b0824 100644 --- a/foundation.dd +++ b/foundation.dd @@ -3,7 +3,7 @@ Ddoc $(D_S $(TITLE), $(H4 The D Language Foundation is a - $(HTTPS en.wikipedia.org/wiki/501(c)_organization, 501(c) non-profit public charity) + $(HTTPS en.wikipedia.org/wiki/501(c)_organization, 501(c)(3) non-profit public charity) devoted to advancing open source technology related to the D programming language. ) From a7232deccb85897dc2217337252614c88d57e982 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 22 Feb 2017 14:30:36 +0100 Subject: [PATCH 30/70] Add a conservative assert to writeln transformer --- assert_writeln_magic.d | 310 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 310 insertions(+) create mode 100755 assert_writeln_magic.d diff --git a/assert_writeln_magic.d b/assert_writeln_magic.d new file mode 100755 index 0000000000..6b7433bdd5 --- /dev/null +++ b/assert_writeln_magic.d @@ -0,0 +1,310 @@ +#!/usr/bin/env dub +/++ +dub.sdl: +dependency "libdparse" version="~>0.7.0-beta.6" +name "assert_writeln_magic" ++/ +/* + * Tries to convert `assert`'s into user-friendly `writeln` calls. + * The objective of this tool is to be conservative as + * broken example look a lot worse than a few statements + * that could have potentially been rewritten. + * + * - only EqualExpressions are "lowered" + * - static asserts are ignored + * - only single-line assers are rewritten + * + * Copyright (C) 2017 by D Language Foundation + * + * Author: Sebastian Wilzbach + * + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) +*/ +// Written in the D programming language. + +import dparse.ast; +import std.algorithm; +import std.conv; +import std.experimental.logger; +import std.range; +import std.stdio; +import std.typecons; + +private string formatNode(T)(const T t) +{ + import dparse.formatter; + import std.array : appender; + + auto writer = appender!string(); + auto formatter = new Formatter!(typeof(writer))(writer); + formatter.format(t); + return writer.data; +} + +class TestVisitor : ASTVisitor +{ + import dparse.lexer : tok, Token; + + this(string fileName) + { + this.fileName = fileName; + fl = FileLines(fileName); + } + + alias visit = ASTVisitor.visit; + + override void visit(const Unittest test) + { + resetTestState(); + inTest = true; + scope(exit) inTest = false; + test.accept(this); + + processLastAssert(); + } + + override void visit(const EqualExpression expr) + { + enum eqToken = tok!"=="; + if (inAssert && expr.operator == eqToken && expr.left !is null && expr.right !is null) + lastEqualExpression = expr; + } + + override void visit(const AssertExpression expr) + { + if (inFunctionCall) + return; + + lastAssert = expr; + inAssert = true; + expr.accept(this); + inAssert = false; + fromAssert = true; + } + + // for now static asserts are ignored + override void visit(const StaticAssertStatement expr) + { + fromStaticAssert = true; + expr.accept(this); + } + + /** + The following code (in std.concurrency) leads to false positives: + + assertNotThrown!AssertError(assert(receiveOnly!int() == i)); + + Hence we simply ignore all asserts in function calls. + */ + override void visit(const FunctionCallExpression expr) + { + inFunctionCall = true; + expr.accept(this); + inFunctionCall = false; + } + + /// A single line + override void visit(const DeclarationOrStatement expr) + { + processLastAssert(); + expr.accept(this); + } + + void processLastAssert() + { + import std.uni : isWhite; + import std.format : format; + + if (fromAssert && !fromStaticAssert && + lastEqualExpression !is null && lastAssert !is null) + { + auto e = lastEqualExpression; + if (e.left !is null && e.right !is null) + { + // libdparse starts the line count with 1 + auto lineNr = lastAssert.line - 1; + + // only replace single-line expressions (for now) + if (fl[lineNr].endsWith(";")) + { + auto wsLen = fl[lineNr].countUntil!(u => !u.isWhite); + auto indent = fl[lineNr][0 .. wsLen]; + + if (fl[lineNr][wsLen .. $].startsWith("assert", "static assert")) + { + auto left = lastEqualExpression.left.formatNode; + auto right = lastEqualExpression.right.formatNode; + + if (left.length + right.length > 80) + fl[lineNr] = format("%s// %s\n%swriteln(%s);", indent, right, indent, left); + else + fl[lineNr] = format("%swriteln(%s); // %s", indent, left, right); + + //writefln("line: %d, column: %d", lastAssert.line, lastAssert.column); + } + } + } + } + resetTestState(); + } + +private: + + void resetTestState() + { + + fromAssert = false; + fromStaticAssert = false; + lastEqualExpression = null; + lastAssert = null; + } + + /// within in the node + bool inTest; + bool inAssert; + bool inFunctionCall; + + /// at a sibling after the node was seen, but the upper parent hasn't been reached yet + bool fromAssert; + bool fromStaticAssert; + + Rebindable!(const AssertExpression) lastAssert; + Rebindable!(const EqualExpression) lastEqualExpression; + + string fileName; + FileLines fl; +} + +void parseFile(string fileName) +{ + import dparse.lexer; + import dparse.parser : parseModule; + import dparse.rollback_allocator : RollbackAllocator; + import std.array : uninitializedArray; + + auto inFile = File(fileName); + if (inFile.size == 0) + warningf("%s is empty", inFile.name); + + ubyte[] sourceCode = uninitializedArray!(ubyte[])(to!size_t(inFile.size)); + inFile.rawRead(sourceCode); + LexerConfig config; + auto cache = StringCache(StringCache.defaultBucketCount); + const(Token)[] tokens = getTokensForParser(sourceCode, config, &cache).array; + + RollbackAllocator rba; + auto m = parseModule(tokens, fileName, &rba); + auto visitor = new TestVisitor(fileName); + visitor.visit(m); + delete visitor; +} + +void main(string[] args) +{ + import std.file; + import std.getopt; + import std.path : asNormalizedPath; + + string inputDir; + string[] ignoredFiles; + + auto helpInfo = getopt(args, config.required, + "inputdir|i", "Folder to start the recursive search for unittest blocks (can be a single file)", &inputDir, + "ignore", "List of files to exclude (partial matching is supported)", &ignoredFiles); + + if (helpInfo.helpWanted) + { + return defaultGetoptPrinter(`assert_writeln_magic +Tries to lower EqualExpression in AssertExpressions of Unittest blocks to commented writeln calls. +`, helpInfo.options); + } + + inputDir = inputDir.asNormalizedPath.array; + + DirEntry[] files; + + if (inputDir.isFile) + { + files = [DirEntry(inputDir)]; + inputDir = "."; + } + else + { + files = dirEntries(inputDir, SpanMode.depth).filter!( + a => a.name.endsWith(".d") && !a.name.canFind(".git")).array; + } + + foreach (file; files) + if (!ignoredFiles.any!(x => file.name.canFind(x))) + file.name.parseFile; +} + +/** +A simple line-based in-memory representation of a file. + - will automatically write all changes when the objct is destructed + - will use a temporary file to do safe, whole file swaps +*/ +struct FileLines +{ + import std.array, std.file, std.path; + + string[] lines; + string destFile, path, tmpDir; + bool hasWrittenChanges; + + this(string path) + { + this(path.dirName, path.baseName); + } + + this(string repoDir, string path) + { + writeln("opening: ", path); + + this.path = path; + destFile = buildPath(repoDir, path); + lines = File(destFile).byLineCopy.array; + + // it's a good practise to use a common tmp folder -> easier to look at or clean + tmpDir = buildPath(tempDir, "file_tester", path.stripExtension.replace("/", "_")); + tmpDir.mkdirRecurse; + } + + // dumps all changes + ~this() + { + auto tmpFile = writeLinesToFile; + tmpFile.copy(destFile); + tmpFile.remove; + tmpDir.rmdirRecurse; + } + + // writes all changes to a random, temporary file + auto writeLinesToFile(string s = null) { + import std.uuid; + + if (!s.length) + s = buildPath(tmpDir, randomUUID.to!string.replace("-", "") ~ ".d"); + + writeln("writing: ", path); + auto outFile = File(s, "w"); + // dump file + foreach (line; lines) + outFile.writeln(line); + // within the docs we automatically inject std.stdio (hence we need to do the same here) + // writeln needs to be @nogc, @safe, pure and nothrow (we just fake it) + if (hasWrittenChanges) + outFile.writeln("void writeln(T)(T l) { }"); + outFile.flush; + + return s; + } + + string opIndex(size_t i) { return lines[i]; } + void opIndexAssign(string line, size_t i) { + hasWrittenChanges = true; + lines[i] = line; + } +} From 33870764cc8a6d705d88ecf88555c669bfe3291f Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 22 Feb 2017 18:27:03 +0100 Subject: [PATCH 31/70] Integrate assert_writeln_magic into Phobos-release build --- .gitignore | 3 +++ posix.mak | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6419010722..aed080c1b2 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ modlist-release.ddoc /d.tag /.generated + +# DUB binaries +assert_writeln_magic diff --git a/posix.mak b/posix.mak index 3934c16f9a..3d71678f18 100644 --- a/posix.mak +++ b/posix.mak @@ -389,7 +389,7 @@ ${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim : $(DMD) ################################################################################ .PHONY: phobos-prerelease -phobos-prerelease : ${PHOBOS_DIR} $(STD_DDOC_PRE) druntime-prerelease +phobos-prerelease : ${PHOBOS_DIR} $(STD_DDOC_PRE) druntime-prerelease assert_writeln_magic ${MAKE} --directory=${PHOBOS_DIR} -f posix.mak \ STDDOC="$(addprefix `pwd`/, $(STD_DDOC_PRE))" \ DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease html -j 4 @@ -507,6 +507,13 @@ chm-nav.json : $(DDOC) std.ddoc spec/spec.ddoc ${GENERATED}/modlist-${LATEST}.dd d.tag : chmgen.d $(STABLE_DMD) $(ALL_FILES) phobos-release druntime-release $(STABLE_RDMD) chmgen.d --root=$(DOC_OUTPUT_DIR) --only-tags +################################################################################ +# Assert -> writeln magic +################################################################################ + +assert_writeln_magic: $(DUB) + $(DUB) run --single ./assert_writeln_magic.d -- -i $(PHOBOS_DIR) + ################################################################################ # Style tests ################################################################################ From f1c041d01c727a34bf36f962d31b5578434b2018 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 22 Feb 2017 18:27:41 +0100 Subject: [PATCH 32/70] Bump DUB to 1.1.0 for single file support --- posix.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posix.mak b/posix.mak index 3d71678f18..423bee2c30 100644 --- a/posix.mak +++ b/posix.mak @@ -30,7 +30,7 @@ REMOTE_DIR=d-programming@digitalmars.com:data GENERATED=.generated # stable dub and dmd versions used to build dpl-docs -DUB_VER=0.9.25 +DUB_VER=1.1.0 STABLE_DMD_VER=2.069.2 STABLE_DMD_ROOT=/tmp/.stable_dmd-$(STABLE_DMD_VER) STABLE_DMD_URL=http://downloads.dlang.org/releases/2.x/$(STABLE_DMD_VER)/dmd.$(STABLE_DMD_VER).$(OS).zip From 9d1dadf36bf2ee3fd05f4010978c8c1e5b2e56c1 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 23 Feb 2017 01:47:21 +0100 Subject: [PATCH 33/70] set libdparse version to v0.7.0-beta.7 --- assert_writeln_magic.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assert_writeln_magic.d b/assert_writeln_magic.d index 6b7433bdd5..9765b8275b 100755 --- a/assert_writeln_magic.d +++ b/assert_writeln_magic.d @@ -1,7 +1,7 @@ #!/usr/bin/env dub /++ dub.sdl: -dependency "libdparse" version="~>0.7.0-beta.6" +dependency "libdparse" version="0.7.0-beta.7" name "assert_writeln_magic" +/ /* From 30e779094105ac0b80baaa9b26b9ad080b0e1bd8 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 23 Feb 2017 02:26:19 +0100 Subject: [PATCH 34/70] set _writeln stub to private --- assert_writeln_magic.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assert_writeln_magic.d b/assert_writeln_magic.d index 9765b8275b..b593d65d6a 100755 --- a/assert_writeln_magic.d +++ b/assert_writeln_magic.d @@ -296,7 +296,7 @@ struct FileLines // within the docs we automatically inject std.stdio (hence we need to do the same here) // writeln needs to be @nogc, @safe, pure and nothrow (we just fake it) if (hasWrittenChanges) - outFile.writeln("void writeln(T)(T l) { }"); + outFile.writeln("private void writeln(T)(T l) { }"); outFile.flush; return s; From 49835edd18038c21e53472539da978bd4d213987 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 23 Feb 2017 02:53:46 +0100 Subject: [PATCH 35/70] Add private comment before writeln to avoid any interference --- assert_writeln_magic.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assert_writeln_magic.d b/assert_writeln_magic.d index b593d65d6a..81573b2b64 100755 --- a/assert_writeln_magic.d +++ b/assert_writeln_magic.d @@ -296,7 +296,7 @@ struct FileLines // within the docs we automatically inject std.stdio (hence we need to do the same here) // writeln needs to be @nogc, @safe, pure and nothrow (we just fake it) if (hasWrittenChanges) - outFile.writeln("private void writeln(T)(T l) { }"); + outFile.writeln("// \nprivate void writeln(T)(T l) { }"); outFile.flush; return s; From 2e1e65516e2f35cfb42288b20079108afbde2c00 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 23 Feb 2017 03:27:08 +0100 Subject: [PATCH 36/70] Use a temporary directory to store the writeln transformed Phobos code --- assert_writeln_magic.d | 5 ++++- posix.mak | 14 ++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/assert_writeln_magic.d b/assert_writeln_magic.d index 81573b2b64..914876e440 100755 --- a/assert_writeln_magic.d +++ b/assert_writeln_magic.d @@ -275,6 +275,9 @@ struct FileLines // dumps all changes ~this() { + if (!hasWrittenChanges) + return; + auto tmpFile = writeLinesToFile; tmpFile.copy(destFile); tmpFile.remove; @@ -297,8 +300,8 @@ struct FileLines // writeln needs to be @nogc, @safe, pure and nothrow (we just fake it) if (hasWrittenChanges) outFile.writeln("// \nprivate void writeln(T)(T l) { }"); - outFile.flush; + outFile.flush; return s; } diff --git a/posix.mak b/posix.mak index 423bee2c30..9ced3d2047 100644 --- a/posix.mak +++ b/posix.mak @@ -28,6 +28,7 @@ DPL_DOCS_PATH=dpl-docs DPL_DOCS=$(DPL_DOCS_PATH)/dpl-docs REMOTE_DIR=d-programming@digitalmars.com:data GENERATED=.generated +PHOBOS_DIR_GENERATED=../phobos.ddoc.tmp # stable dub and dmd versions used to build dpl-docs DUB_VER=1.1.0 @@ -389,8 +390,8 @@ ${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim : $(DMD) ################################################################################ .PHONY: phobos-prerelease -phobos-prerelease : ${PHOBOS_DIR} $(STD_DDOC_PRE) druntime-prerelease assert_writeln_magic - ${MAKE} --directory=${PHOBOS_DIR} -f posix.mak \ +phobos-prerelease : ${PHOBOS_DIR_GENERATED} $(STD_DDOC_PRE) druntime-prerelease + ${MAKE} --directory=${PHOBOS_DIR_GENERATED} -f posix.mak \ STDDOC="$(addprefix `pwd`/, $(STD_DDOC_PRE))" \ DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease html -j 4 @@ -457,10 +458,10 @@ docs.json : ${DMD_REL} ${DRUNTIME_DIR}-${LATEST} \ rm .release-files.txt .release-dummy.html docs-prerelease.json : ${DMD} ${DRUNTIME_DIR} \ - ${PHOBOS_DIR} | dpl-docs + ${PHOBOS_DIR_GENERATED} | dpl-docs find ${DRUNTIME_DIR}/src -name '*.d' | sed -e '/gcstub/d' \ -e /unittest/d > .prerelease-files.txt - find ${PHOBOS_DIR} -name '*.d' | sed -e /unittest.d/d \ + find ${PHOBOS_DIR_GENERATED} -name '*.d' | sed -e /unittest.d/d \ -e /windows/d >> .prerelease-files.txt ${DMD} -c -o- -version=CoreDdoc -version=StdDdoc -Df.prerelease-dummy.html \ -Xfdocs-prerelease.json -I${PHOBOS_DIR} @.prerelease-files.txt @@ -511,8 +512,9 @@ d.tag : chmgen.d $(STABLE_DMD) $(ALL_FILES) phobos-release druntime-release # Assert -> writeln magic ################################################################################ -assert_writeln_magic: $(DUB) - $(DUB) run --single ./assert_writeln_magic.d -- -i $(PHOBOS_DIR) +${PHOBOS_DIR_GENERATED}: $(wildcard ${PHOBOS_DIR}/**/*) $(DUB) + rsync --update $(PHOBOS_DIR) $@ + $(DUB) run --single ./assert_writeln_magic.d -- -i $@ ################################################################################ # Style tests From 07da41464f7bbce1037a171d92d36c773894c0eb Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 23 Feb 2017 03:44:25 +0100 Subject: [PATCH 37/70] Add a soft fallback if no rsync is provided --- posix.mak | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/posix.mak b/posix.mak index 9ced3d2047..b4d21031d1 100644 --- a/posix.mak +++ b/posix.mak @@ -510,10 +510,22 @@ d.tag : chmgen.d $(STABLE_DMD) $(ALL_FILES) phobos-release druntime-release ################################################################################ # Assert -> writeln magic +# ----------------------- +# +# - This transforms assert(a = b) to writeln(a); // b +# - It creates a copy of Phobos to apply the transformations ################################################################################ +# --update allows to copy only the newer files and thus only propagate these +# changes +HAS_RSYNC := $(shell command -v rsync22 2> /dev/null) + ${PHOBOS_DIR_GENERATED}: $(wildcard ${PHOBOS_DIR}/**/*) $(DUB) - rsync --update $(PHOBOS_DIR) $@ +ifdef HAS_RSYNC + rsync -a --exclude='.git/' --exclude='generated/' --update -v $(PHOBOS_DIR)/ $@ +else + cp -r -T -f $(PHOBOS_DIR) $@ +endif $(DUB) run --single ./assert_writeln_magic.d -- -i $@ ################################################################################ From a7c7f343b4bb191827dbd4044d5fd7a89dc34243 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Fri, 24 Feb 2017 04:31:22 +0100 Subject: [PATCH 38/70] Add assert_writeln postprocessing to the stable releases pages In order to have a common style, these variables have been introduced DMD_STABLE_DIR=${DMD_DIR}-${LATEST} DRUNTIME_STABLE_DIR=${DRUNTIME_DIR}-${LATEST} PHOBOS_STABLE_DIR=${PHOBOS_DIR}-${LATEST} PHOBOS_STABLE_DIR_GENERATED=${PHOBOS_STABLE_DIR}.ddoc.tmp --- .gitignore | 2 +- assert_writeln_magic.d | 5 ++-- posix.mak | 53 ++++++++++++++++++++++++++++-------------- 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index aed080c1b2..feb7e88e8e 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,4 @@ modlist-release.ddoc /.generated # DUB binaries -assert_writeln_magic +/assert_writeln_magic diff --git a/assert_writeln_magic.d b/assert_writeln_magic.d index 914876e440..6b2892323b 100755 --- a/assert_writeln_magic.d +++ b/assert_writeln_magic.d @@ -108,7 +108,7 @@ class TestVisitor : ASTVisitor /// A single line override void visit(const DeclarationOrStatement expr) { - processLastAssert(); + processLastAssert(); expr.accept(this); } @@ -118,7 +118,7 @@ class TestVisitor : ASTVisitor import std.format : format; if (fromAssert && !fromStaticAssert && - lastEqualExpression !is null && lastAssert !is null) + lastEqualExpression !is null && lastAssert !is null) { auto e = lastEqualExpression; if (e.left !is null && e.right !is null) @@ -154,7 +154,6 @@ private: void resetTestState() { - fromAssert = false; fromStaticAssert = false; lastEqualExpression = null; diff --git a/posix.mak b/posix.mak index b4d21031d1..c32bdcb8e5 100644 --- a/posix.mak +++ b/posix.mak @@ -27,8 +27,16 @@ GIT_HOME=https://github.com/dlang DPL_DOCS_PATH=dpl-docs DPL_DOCS=$(DPL_DOCS_PATH)/dpl-docs REMOTE_DIR=d-programming@digitalmars.com:data + +# Last released versions +DMD_STABLE_DIR=${DMD_DIR}-${LATEST} +DRUNTIME_STABLE_DIR=${DRUNTIME_DIR}-${LATEST} +PHOBOS_STABLE_DIR=${PHOBOS_DIR}-${LATEST} + +# Automatically generated directories GENERATED=.generated PHOBOS_DIR_GENERATED=../phobos.ddoc.tmp +PHOBOS_STABLE_DIR_GENERATED=${PHOBOS_STABLE_DIR}.ddoc.tmp # stable dub and dmd versions used to build dpl-docs DUB_VER=1.1.0 @@ -253,9 +261,9 @@ ${GENERATED}/${LATEST}.ddoc : mkdir -p $(dir $@) echo "LATEST=${LATEST}" >$@ -${GENERATED}/modlist-${LATEST}.ddoc : modlist.d ${STABLE_DMD} $(DRUNTIME_DIR)-$(LATEST) $(PHOBOS_DIR)-$(LATEST) +${GENERATED}/modlist-${LATEST}.ddoc : modlist.d ${STABLE_DMD} $(DRUNTIME_STABLE_DIR) $(PHOBOS_STABLE_DIR) mkdir -p $(dir $@) - $(STABLE_RDMD) modlist.d $(DRUNTIME_DIR)-$(LATEST) $(PHOBOS_DIR)-$(LATEST) $(MOD_EXCLUDES_RELEASE) >$@ + $(STABLE_RDMD) modlist.d $(DRUNTIME_STABLE_DIR) $(PHOBOS_STABLE_DIR) $(MOD_EXCLUDES_RELEASE) >$@ ${GENERATED}/modlist-prerelease.ddoc : modlist.d ${STABLE_DMD} $(DRUNTIME_DIR) $(PHOBOS_DIR) mkdir -p $(dir $@) @@ -270,9 +278,10 @@ rebase-phobos: ; cd $(PHOBOS_DIR) && $(call REBASE,phobos) clean: rm -rf $(DOC_OUTPUT_DIR) ${GENERATED} dpl-docs/.dub + rm -rf $(PHOBOS_DIR_GENERATED) $(PHOBOS_STABLE_DIR_GENERATED) rm -rf auto dlangspec-consolidated.d $(addprefix dlangspec,.aux .d .dvi .fdb_latexmk .fls .log .out .pdf .tex .txt .verbatim.txt) rm -f docs.json docs-prerelease.json dpl-docs/dpl-docs - @echo You should issue manually: rm -rf ${DMD_DIR}-${LATEST} ${DRUNTIME_DIR}-${LATEST} ${PHOBOS_DIR}-${LATEST} ${STABLE_DMD_ROOT} ${DUB_DIR} + @echo You should issue manually: rm -rf ${DMD_STABLE_DIR} ${DRUNTIME_STABLE_DIR} ${PHOBOS_STABLE_DIR} ${STABLE_DMD_ROOT} ${DUB_DIR} RSYNC_FILTER=-f 'P /Usage' -f 'P /.dpl_rewrite*' -f 'P /install.sh*' @@ -351,8 +360,8 @@ ${DMD_DIR} ${DRUNTIME_DIR} ${PHOBOS_DIR} : $(DMD) : ${DMD_DIR} ${MAKE} --directory=${DMD_DIR}/src -f posix.mak AUTO_BOOTSTRAP=1 -j 4 -$(DMD_REL) : ${DMD_DIR}-${LATEST} - ${MAKE} --directory=${DMD_DIR}-${LATEST}/src -f posix.mak AUTO_BOOTSTRAP=1 -j 4 +$(DMD_REL) : ${DMD_STABLE_DIR} + ${MAKE} --directory=${DMD_STABLE_DIR}/src -f posix.mak AUTO_BOOTSTRAP=1 -j 4 dmd-prerelease : $(STD_DDOC_PRE) $(DMD_DIR) $(DMD) $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak html \ @@ -368,8 +377,8 @@ druntime-prerelease : ${DRUNTIME_DIR} $(DMD) $(STD_DDOC_PRE) DOCDIR=${DOC_OUTPUT_DIR}/phobos-prerelease \ DOCFMT="$(addprefix `pwd`/, $(STD_DDOC_PRE))" -druntime-release : ${DRUNTIME_DIR}-${LATEST} $(DMD_REL) $(STD_DDOC) - ${MAKE} --directory=${DRUNTIME_DIR}-${LATEST} -f posix.mak target doc \ +druntime-release : ${DRUNTIME_STABLE_DIR} $(DMD_REL) $(STD_DDOC) + ${MAKE} --directory=${DRUNTIME_STABLE_DIR} -f posix.mak target doc \ DMD=$(DMD_REL) \ DOCDIR=${DOC_OUTPUT_DIR}/phobos \ DOCFMT="$(addprefix `pwd`/, $(STD_DDOC))" @@ -395,19 +404,19 @@ phobos-prerelease : ${PHOBOS_DIR_GENERATED} $(STD_DDOC_PRE) druntime-prerelease STDDOC="$(addprefix `pwd`/, $(STD_DDOC_PRE))" \ DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease html -j 4 -phobos-release : ${PHOBOS_DIR}-${LATEST} $(DMD_REL) $(STD_DDOC) \ +phobos-release : ${PHOBOS_STABLE_DIR_GENERATED} $(DMD_REL) $(STD_DDOC) \ druntime-release - ${MAKE} --directory=${PHOBOS_DIR}-${LATEST} -f posix.mak -j 4 \ + ${MAKE} --directory=${PHOBOS_STABLE_DIR_GENERATED} -f posix.mak -j 4 \ html \ DMD=$(DMD_REL) \ - DRUNTIME_PATH=${DRUNTIME_DIR}-${LATEST} \ + DRUNTIME_PATH=${DRUNTIME_STABLE_DIR} \ DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos \ STDDOC="$(addprefix `pwd`/, $(STD_DDOC))" -phobos-prerelease-verbatim : ${PHOBOS_DIR} ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim +phobos-prerelease-verbatim : ${PHOBOS_DIR_GENERATED} ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim : verbatim.ddoc \ ${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim - ${MAKE} --directory=${PHOBOS_DIR} -f posix.mak \ + ${MAKE} --directory=${PHOBOS_DIR_GENERATED} -f posix.mak \ STDDOC="`pwd`/verbatim.ddoc" \ DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim html -j 4 $(call CHANGE_SUFFIX,html,verbatim,${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim) @@ -445,14 +454,14 @@ ${DOC_OUTPUT_DIR}/library-prerelease/.htaccess : dpl_prerelease_htaccess @mkdir -p $(dir $@) cp $< $@ -docs.json : ${DMD_REL} ${DRUNTIME_DIR}-${LATEST} \ - ${PHOBOS_DIR}-${LATEST} | dpl-docs - find ${DRUNTIME_DIR}-${LATEST}/src -name '*.d' | \ +docs.json : ${DMD_REL} ${DRUNTIME_STABLE_DIR} \ + ${PHOBOS_STABLE_DIR_GENERATED} | dpl-docs + find ${DRUNTIME_STABLE_DIR}/src -name '*.d' | \ sed -e /unittest.d/d -e /gcstub/d > .release-files.txt - find ${PHOBOS_DIR}-${LATEST} -name '*.d' | \ + find ${PHOBOS_STABLE_DIR_GENERATED} -name '*.d' | \ sed -e /unittest.d/d -e /windows/d | sort >> .release-files.txt ${DMD_REL} -c -o- -version=CoreDdoc -version=StdDdoc -Df.release-dummy.html \ - -Xfdocs.json -I${PHOBOS_DIR}-${LATEST} @.release-files.txt + -Xfdocs.json -I${PHOBOS_STABLE_DIR_GENERATED} @.release-files.txt ${DPL_DOCS} filter docs.json --min-protection=Protected \ --only-documented $(MOD_EXCLUDES_PRERELEASE) rm .release-files.txt .release-dummy.html @@ -464,7 +473,7 @@ docs-prerelease.json : ${DMD} ${DRUNTIME_DIR} \ find ${PHOBOS_DIR_GENERATED} -name '*.d' | sed -e /unittest.d/d \ -e /windows/d >> .prerelease-files.txt ${DMD} -c -o- -version=CoreDdoc -version=StdDdoc -Df.prerelease-dummy.html \ - -Xfdocs-prerelease.json -I${PHOBOS_DIR} @.prerelease-files.txt + -Xfdocs-prerelease.json -I${PHOBOS_DIR_GENERATED} @.prerelease-files.txt ${DPL_DOCS} filter docs-prerelease.json --min-protection=Protected \ --only-documented $(MOD_EXCLUDES_RELEASE) rm .prerelease-files.txt .prerelease-dummy.html @@ -528,6 +537,14 @@ else endif $(DUB) run --single ./assert_writeln_magic.d -- -i $@ +${PHOBOS_STABLE_DIR_GENERATED}: $(wildcard ${PHOBOS_STABLE_DIR_GENERATED}/**/*) $(DUB) +ifdef HAS_RSYNC + rsync -a --exclude='.git/' --exclude='generated/' --update -v $(PHOBOS_STABLE_DIR)/ $@ +else + cp -r -T -f $(PHOBOS_STABLE_DIR) $@ +endif + $(DUB) run --single ./assert_writeln_magic.d -- -i $@ + ################################################################################ # Style tests ################################################################################ From b361d734162fea6f6ac765cc160488e8bd3a4f25 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Fri, 24 Feb 2017 08:15:54 +0100 Subject: [PATCH 39/70] Use .generated for Phobos transformation builds --- posix.mak | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/posix.mak b/posix.mak index c32bdcb8e5..45c35a5399 100644 --- a/posix.mak +++ b/posix.mak @@ -35,8 +35,8 @@ PHOBOS_STABLE_DIR=${PHOBOS_DIR}-${LATEST} # Automatically generated directories GENERATED=.generated -PHOBOS_DIR_GENERATED=../phobos.ddoc.tmp -PHOBOS_STABLE_DIR_GENERATED=${PHOBOS_STABLE_DIR}.ddoc.tmp +PHOBOS_DIR_GENERATED=$(GENERATED)/phobos-prerelease +PHOBOS_STABLE_DIR_GENERATED=$(GENERATED)/phobos-release # stable dub and dmd versions used to build dpl-docs DUB_VER=1.1.0 @@ -278,7 +278,6 @@ rebase-phobos: ; cd $(PHOBOS_DIR) && $(call REBASE,phobos) clean: rm -rf $(DOC_OUTPUT_DIR) ${GENERATED} dpl-docs/.dub - rm -rf $(PHOBOS_DIR_GENERATED) $(PHOBOS_STABLE_DIR_GENERATED) rm -rf auto dlangspec-consolidated.d $(addprefix dlangspec,.aux .d .dvi .fdb_latexmk .fls .log .out .pdf .tex .txt .verbatim.txt) rm -f docs.json docs-prerelease.json dpl-docs/dpl-docs @echo You should issue manually: rm -rf ${DMD_STABLE_DIR} ${DRUNTIME_STABLE_DIR} ${PHOBOS_STABLE_DIR} ${STABLE_DMD_ROOT} ${DUB_DIR} @@ -402,23 +401,37 @@ ${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim : $(DMD) phobos-prerelease : ${PHOBOS_DIR_GENERATED} $(STD_DDOC_PRE) druntime-prerelease ${MAKE} --directory=${PHOBOS_DIR_GENERATED} -f posix.mak \ STDDOC="$(addprefix `pwd`/, $(STD_DDOC_PRE))" \ - DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease html -j 4 + DOC_OUTPUT_DIR="${DOC_OUTPUT_DIR}/phobos-prerelease" \ + DRUNTIME_PATH="$(realpath ${DRUNTIME_DIR})" \ + DMD="$(realpath ${DMD})" \ + DOCSRC="$(realpath .)" \ + VERSION="$(realpath ${DMD_DIR}/VERSION)" \ + html -j4 phobos-release : ${PHOBOS_STABLE_DIR_GENERATED} $(DMD_REL) $(STD_DDOC) \ druntime-release - ${MAKE} --directory=${PHOBOS_STABLE_DIR_GENERATED} -f posix.mak -j 4 \ - html \ + ${MAKE} --directory=${PHOBOS_STABLE_DIR_GENERATED} -f posix.mak \ DMD=$(DMD_REL) \ DRUNTIME_PATH=${DRUNTIME_STABLE_DIR} \ DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos \ - STDDOC="$(addprefix `pwd`/, $(STD_DDOC))" + STDDOC="$(addprefix `pwd`/, $(STD_DDOC))" \ + DRUNTIME_PATH="$(realpath ${DRUNTIME_DIR})" \ + DMD="$(realpath ${DMD})" \ + DOCSRC="$(realpath .)" \ + VERSION="$(realpath ${DMD_DIR}/VERSION)" \ + html -j4 phobos-prerelease-verbatim : ${PHOBOS_DIR_GENERATED} ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim : verbatim.ddoc \ ${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim ${MAKE} --directory=${PHOBOS_DIR_GENERATED} -f posix.mak \ STDDOC="`pwd`/verbatim.ddoc" \ - DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim html -j 4 + DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim \ + DRUNTIME_PATH="$(realpath ${DRUNTIME_DIR})" \ + DMD="$(realpath ${DMD})" \ + DOCSRC="$(realpath .)" \ + VERSION="$(realpath ${DMD_DIR}/VERSION)" \ + html -j4 $(call CHANGE_SUFFIX,html,verbatim,${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim) mv ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim/* $(dir $@) rm -r ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim @@ -525,11 +538,14 @@ d.tag : chmgen.d $(STABLE_DMD) $(ALL_FILES) phobos-release druntime-release # - It creates a copy of Phobos to apply the transformations ################################################################################ +$(GENERATED): + mkdir -p $@ + # --update allows to copy only the newer files and thus only propagate these # changes -HAS_RSYNC := $(shell command -v rsync22 2> /dev/null) +HAS_RSYNC := $(shell command -v rsync 2> /dev/null) -${PHOBOS_DIR_GENERATED}: $(wildcard ${PHOBOS_DIR}/**/*) $(DUB) +${PHOBOS_DIR_GENERATED}: $(wildcard ${PHOBOS_DIR}/**/*) $(DUB) | $(GENERATED) ifdef HAS_RSYNC rsync -a --exclude='.git/' --exclude='generated/' --update -v $(PHOBOS_DIR)/ $@ else @@ -537,7 +553,7 @@ else endif $(DUB) run --single ./assert_writeln_magic.d -- -i $@ -${PHOBOS_STABLE_DIR_GENERATED}: $(wildcard ${PHOBOS_STABLE_DIR_GENERATED}/**/*) $(DUB) +${PHOBOS_STABLE_DIR_GENERATED}: $(wildcard ${PHOBOS_STABLE_DIR_GENERATED}/**/*) $(DUB) | $(GENERATED) ifdef HAS_RSYNC rsync -a --exclude='.git/' --exclude='generated/' --update -v $(PHOBOS_STABLE_DIR)/ $@ else From 2bfe60b0ec2fe7adc5ab4476843e9005b4cfb9ab Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Sat, 7 Jan 2017 15:54:49 +0100 Subject: [PATCH 40/70] Add pending_changelog target --- posix.mak | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/posix.mak b/posix.mak index 3934c16f9a..563fdf086e 100644 --- a/posix.mak +++ b/posix.mak @@ -13,11 +13,14 @@ ifeq (,${LATEST}) LATEST:=$(shell cat VERSION) endif +# Next major DMD release +NEXT_VERSION:=$(shell bash -c 'version=$$(cat VERSION);a=($${version//./ });a[1]="10\#$${a[1]}";((a[1]++)); a[2]=0; echo $${a[0]}.0$${a[1]}.$${a[2]};' ) # Externals DMD_DIR=../dmd PHOBOS_DIR=../phobos DRUNTIME_DIR=../druntime +TOOLS_DIR=../tools DUB_DIR=../dub-${DUB_VER} DMD=$(DMD_DIR)/src/dmd DMD_REL=$(DMD_DIR)-${LATEST}/src/dmd @@ -150,7 +153,8 @@ SPEC_ROOT=$(addprefix spec/, \ abi simd) SPEC_DD=$(addsuffix .dd,$(SPEC_ROOT)) -CHANGELOG_FILES=$(basename $(subst _pre.dd,.dd,$(wildcard changelog/*.dd))) +CHANGELOG_FILES=$(basename $(subst _pre.dd,.dd,$(wildcard changelog/*.dd))) \ + changelog/${NEXT_VERSION} # Website root filenames. They have extension .dd in the source # and .html in the generated HTML. Save for the expansion of @@ -519,7 +523,17 @@ test: # Changelog generation ################################################################################ -pending_changelog: - @echo "This command will be available soon." +changelog/${NEXT_VERSION}.dd: ${STABLE_DMD} ../tools ../installer + $(STABLE_RDMD) $(TOOLS_DIR)/changed.d "v${LATEST}..upstream/stable" -o changelog/${NEXT_VERSION}.dd \ + --version "${NEXT_VERSION}" + +pending_changelog: changelog/${NEXT_VERSION}.dd html + @echo "Please open file:///$(shell pwd)/web/changelog/${NEXT_VERSION}.html in your browser" + +../tools: + git clone https://github.com/dlang/tools ../tools + +../installer: + git clone https://github.com/dlang/installer ../installer .DELETE_ON_ERROR: # GNU Make directive (delete output files on error) From 16c6bc44ffd06b01cafac8bb9735bf6265276ac0 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Mon, 27 Feb 2017 09:59:31 +0100 Subject: [PATCH 41/70] Support --no-exact-source-links in dpl-docs --- dpl-docs/source/app.d | 6 +++++- dpl-docs/views/layout.dt | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dpl-docs/source/app.d b/dpl-docs/source/app.d index 1a9b1b2d36..3956a32f2b 100644 --- a/dpl-docs/source/app.d +++ b/dpl-docs/source/app.d @@ -5,12 +5,16 @@ import std.getopt; import std.process; import vibe.core.log; +bool noExactSourceCodeLinks; + int main(string[] args) { string git_target = "master"; getopt(args, std.getopt.config.passThrough, - "git-target", &git_target); + "git-target", &git_target, + "no-exact-source-links", &noExactSourceCodeLinks); environment["GIT_TARGET"] = git_target; + environment["NO_EXACT_SOURCE_CODE_LINKS"] = noExactSourceCodeLinks ? "1" : "0"; setLogFormat(FileLogger.Format.plain); return ddoxMain(args); } diff --git a/dpl-docs/views/layout.dt b/dpl-docs/views/layout.dt index 08e2aede10..41c82eea72 100644 --- a/dpl-docs/views/layout.dt +++ b/dpl-docs/views/layout.dt @@ -6,6 +6,7 @@ html(lang='en-US') | http://digitalmars.com - import std.process : environment; - string version_id = environment["GIT_TARGET"]; + - bool noExactSourceCodeLinks = environment["NO_EXACT_SOURCE_CODE_LINKS"] == "1"; - bool haveVersion = version_id.startsWith("v"); - string version_name = haveVersion ? version_id[1 .. $] : "Prerelease"; - string root_dir = info.linkTo(null) ~ (req is null ? "../" : ""); @@ -164,7 +165,7 @@ html(lang='en-US') - project = "druntime", path_prefix = "src/"; - else - project = "phobos", path_prefix = ""; - - if (info.docGroups.length >= 1) + - if (info.docGroups.length >= 1 && !noExactSourceCodeLinks) - if (auto decl = cast(Declaration)info.docGroups[0].members[0]) line_suffix = "#L"~to!string(decl.line); - if (info.node.module_.isPackageModule) - filename = replace(modname, ".", "/") ~ "/package.d"; From 5a584d80c97bce036078cf342301f6dedd9df96c Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Mon, 27 Feb 2017 10:00:30 +0100 Subject: [PATCH 42/70] Support a DIFFABLE mode that surpresses all potentially different infos --- posix.mak | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/posix.mak b/posix.mak index 563fdf086e..d1d3f72f50 100644 --- a/posix.mak +++ b/posix.mak @@ -106,6 +106,15 @@ ifeq (,$(MODEL)) endif endif +# Disable all dynamic content that could potentially have an unrelated impact +# on a diff +ifeq (1,$(DIFFABLE)) + NODATETIME := nodatetime.ddoc + DPL_DOCS_PATH_RUN_FLAGS := --no-exact-source-links +else + CHANGELOG_VERSION := "v${LATEST}..upstream/stable" +endif + # Documents DDOC=$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME) @@ -432,13 +441,15 @@ ${DOC_OUTPUT_DIR}/library-prerelease/sitemap.xml : docs-prerelease.json @mkdir -p $(dir $@) ${DPL_DOCS} generate-html --file-name-style=lowerUnderscored --std-macros=html.ddoc --std-macros=dlang.org.ddoc --std-macros=std.ddoc --std-macros=macros.ddoc --std-macros=std-ddox.ddoc \ --override-macros=std-ddox-override.ddoc --package-order=std \ - --git-target=master docs-prerelease.json ${DOC_OUTPUT_DIR}/library-prerelease + --git-target=master $(DPL_DOCS_PATH_RUN_FLAGS) \ + docs-prerelease.json ${DOC_OUTPUT_DIR}/library-prerelease ${DOC_OUTPUT_DIR}/library/sitemap.xml : docs.json @mkdir -p $(dir $@) ${DPL_DOCS} generate-html --file-name-style=lowerUnderscored --std-macros=html.ddoc --std-macros=dlang.org.ddoc --std-macros=std.ddoc --std-macros=macros.ddoc --std-macros=std-ddox.ddoc \ --override-macros=std-ddox-override.ddoc --package-order=std \ - --git-target=v${LATEST} docs.json ${DOC_OUTPUT_DIR}/library + --git-target=v${LATEST} $(DPL_DOCS_PATH_RUN_FLAGS) \ + docs.json ${DOC_OUTPUT_DIR}/library ${DOC_OUTPUT_DIR}/library/.htaccess : dpl_release_htaccess @mkdir -p $(dir $@) @@ -524,8 +535,8 @@ test: ################################################################################ changelog/${NEXT_VERSION}.dd: ${STABLE_DMD} ../tools ../installer - $(STABLE_RDMD) $(TOOLS_DIR)/changed.d "v${LATEST}..upstream/stable" -o changelog/${NEXT_VERSION}.dd \ - --version "${NEXT_VERSION}" + $(STABLE_RDMD) $(TOOLS_DIR)/changed.d $(CHANGELOG_VERSION) -o changelog/${NEXT_VERSION}.dd \ + --version "${NEXT_VERSION}" --prev-version "${LATEST}" pending_changelog: changelog/${NEXT_VERSION}.dd html @echo "Please open file:///$(shell pwd)/web/changelog/${NEXT_VERSION}.html in your browser" From 6649ffab23242e7fcffd2dab39fa0d916276a052 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Mon, 27 Feb 2017 15:45:01 +0000 Subject: [PATCH 43/70] posix.mak: Use TMP environment variable for temporary directory Allows working around issues such as /tmp filesystems mounted noexec, or conflicts due to multiple users building D on the same machine. --- posix.mak | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/posix.mak b/posix.mak index 0fd817d652..91de6e1c8b 100644 --- a/posix.mak +++ b/posix.mak @@ -30,6 +30,7 @@ GIT_HOME=https://github.com/dlang DPL_DOCS_PATH=dpl-docs DPL_DOCS=$(DPL_DOCS_PATH)/dpl-docs REMOTE_DIR=d-programming@digitalmars.com:data +TMP?=/tmp # Last released versions DMD_STABLE_DIR=${DMD_DIR}-${LATEST} @@ -44,7 +45,7 @@ PHOBOS_STABLE_DIR_GENERATED=$(GENERATED)/phobos-release # stable dub and dmd versions used to build dpl-docs DUB_VER=1.1.0 STABLE_DMD_VER=2.069.2 -STABLE_DMD_ROOT=/tmp/.stable_dmd-$(STABLE_DMD_VER) +STABLE_DMD_ROOT=$(TMP)/.stable_dmd-$(STABLE_DMD_VER) STABLE_DMD_URL=http://downloads.dlang.org/releases/2.x/$(STABLE_DMD_VER)/dmd.$(STABLE_DMD_VER).$(OS).zip STABLE_DMD=$(STABLE_DMD_ROOT)/dmd2/$(OS)/$(if $(filter $(OS),osx),bin,bin$(MODEL))/dmd STABLE_DMD_CONF=$(STABLE_DMD).conf From 5e82fb25166c7abefb9da68d1265736c05c51142 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Mon, 27 Feb 2017 07:50:52 +0100 Subject: [PATCH 44/70] Use nightly changelog theme --- changelog/changelog.ddoc | 9 +++++++++ posix.mak | 17 +++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/changelog/changelog.ddoc b/changelog/changelog.ddoc index 9bd4c3eb34..13b0554429 100644 --- a/changelog/changelog.ddoc +++ b/changelog/changelog.ddoc @@ -25,6 +25,15 @@ $(SMALL released $1, $2) $4 ) +NIGHTLY_VERSION= +$(DIVC version, +$(P +$(B $(LARGE $(LINK2 http://nightlies.dlang.org, Download D nightlies)))$(BR) +$(SMALL $1) +) +$4 +) + BUGZILLA = Bugzilla $0 CPPBUGZILLA = Bugzilla $0 DSTRESS = dstress $0 diff --git a/posix.mak b/posix.mak index 0fd817d652..a553929b6c 100644 --- a/posix.mak +++ b/posix.mak @@ -121,7 +121,8 @@ ifeq (1,$(DIFFABLE)) NODATETIME := nodatetime.ddoc DPL_DOCS_PATH_RUN_FLAGS := --no-exact-source-links else - CHANGELOG_VERSION := "v${LATEST}..upstream/stable" + CHANGELOG_VERSION_MASTER := "v${LATEST}..upstream/master" + CHANGELOG_VERSION_STABLE := "v${LATEST}..upstream/stable" endif # Documents @@ -171,8 +172,8 @@ SPEC_ROOT=$(addprefix spec/, \ abi simd) SPEC_DD=$(addsuffix .dd,$(SPEC_ROOT)) -CHANGELOG_FILES=$(basename $(subst _pre.dd,.dd,$(wildcard changelog/*.dd))) \ - changelog/${NEXT_VERSION} +CHANGELOG_FILES=changelog/${NEXT_VERSION}_pre \ + $(basename $(subst _pre.dd,.dd,$(wildcard changelog/*.dd))) \ # Website root filenames. They have extension .dd in the source # and .html in the generated HTML. Save for the expansion of @@ -588,12 +589,16 @@ test: # Changelog generation ################################################################################ +changelog/${NEXT_VERSION}_pre.dd: ${STABLE_DMD} ../tools ../installer + $(STABLE_RDMD) $(TOOLS_DIR)/changed.d $(CHANGELOG_VERSION_MASTER) -o $@ \ + --version "${NEXT_VERSION} (upcoming)" --date "To be released" --nightly + changelog/${NEXT_VERSION}.dd: ${STABLE_DMD} ../tools ../installer - $(STABLE_RDMD) $(TOOLS_DIR)/changed.d $(CHANGELOG_VERSION) -o changelog/${NEXT_VERSION}.dd \ - --version "${NEXT_VERSION}" --prev-version "${LATEST}" + $(STABLE_RDMD) $(TOOLS_DIR)/changed.d $(CHANGELOG_VERSION_STABLE) -o $@ \ + --version "${NEXT_VERSION}" pending_changelog: changelog/${NEXT_VERSION}.dd html - @echo "Please open file:///$(shell pwd)/web/changelog/${NEXT_VERSION}.html in your browser" + @echo "Please open file:///$(shell pwd)/web/changelog/${NEXT_VERSION}_pre.html in your browser" ../tools: git clone https://github.com/dlang/tools ../tools From 89fb4ce5e4036708485e84afb2f66e963e4aa238 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Mon, 27 Feb 2017 17:03:42 +0100 Subject: [PATCH 45/70] Add generated *_pre changelog files to .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index feb7e88e8e..0b30bb3735 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ modlist-release.ddoc # DUB binaries /assert_writeln_magic + +# Generated changelogs +changelog/*_pre.dd From c49f07a2fc43c4d51ecce82481eb8a735ef68125 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 22 Feb 2017 03:53:59 +0100 Subject: [PATCH 46/70] Make modlist.d generic * Accept arbitrary number of directories * Replaced hard-coded tree dumping of Phobos and DRuntime with a --dump flag * Detect the source folder of a directory automatically * Use std.getopt as arg parser --- modlist.d | 45 +++++++++++++++++++++++++++++++++------------ posix.mak | 6 ++++-- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/modlist.d b/modlist.d index 88ab5df6f4..033d66017f 100644 --- a/modlist.d +++ b/modlist.d @@ -4,7 +4,7 @@ * License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0). * Authors: $(HTTP code.dawg.eu, Martin Nowak) */ -import std.algorithm, std.file, std.path, std.stdio, std.string, std.range; +import std.algorithm, std.file, std.getopt, std.path, std.stdio, std.string, std.range; struct Tree { @@ -72,6 +72,7 @@ struct Tree ref Tree opIndex(string part) { auto tail = leaves.find!((tr, pkg) => tr.name == pkg)(part); + assert(!tail.empty, part ~ " can't be found."); return tail.front; } @@ -86,17 +87,24 @@ struct Tree Tree[] leaves; } +alias I(alias X) = X; + int main(string[] args) { - if (args.length < 3) + string[] excludes, packages; + + auto prog = getopt(args, + "ex", &excludes, + "dump", &packages, + ); + + if (prog.helpWanted || args.length <= 1) { - stderr.writeln("usage: ./modlist [--ex=std.internal.] [--ex=core.sys.]"); + defaultGetoptPrinter("./modlist ... ", prog.options); return 1; } - auto druntime = args[1]; - auto phobos = args[2]; - auto excludes = args[3 .. $].map!(ex => ex.chompPrefix("--ex=")).array; + auto dirs = args[1 .. $]; bool included(string mod) { @@ -115,15 +123,28 @@ int main(string[] args) tree.insert(name.splitter(".")); } Tree tree; - add(phobos, tree); - add(buildPath(druntime, "src"), tree); + foreach (dir; dirs) + { + // search for common root folders (fallback to the root directory) + ["source", "src", ""] + .map!(f => buildPath(dir, f)) + .filter!exists + .front // no UFCS for local symbols + .I!(name => add(name, tree)); + } + tree.sort(); writeln("MODULE_MENU="); - writeln("$(MENU object.html, $(TT object))"); - tree["std"].dumpRoot(); - tree["etc"].dumpRoot(); - tree["core"].dumpRoot(); + foreach (part; packages) + { + // check whether it's a package or file + auto subTree = tree[part]; + if (subTree.leaves.length) + subTree.dumpRoot; + else + writefln("$(MENU %s.html, $(TT %1$s))", part); + } writeln("_="); return 0; } diff --git a/posix.mak b/posix.mak index 0fd817d652..48edfbabb5 100644 --- a/posix.mak +++ b/posix.mak @@ -276,11 +276,13 @@ ${GENERATED}/${LATEST}.ddoc : ${GENERATED}/modlist-${LATEST}.ddoc : modlist.d ${STABLE_DMD} $(DRUNTIME_STABLE_DIR) $(PHOBOS_STABLE_DIR) mkdir -p $(dir $@) - $(STABLE_RDMD) modlist.d $(DRUNTIME_STABLE_DIR) $(PHOBOS_STABLE_DIR) $(MOD_EXCLUDES_RELEASE) >$@ + $(STABLE_RDMD) modlist.d $(DRUNTIME_STABLE_DIR) $(PHOBOS_STABLE_DIR) $(MOD_EXCLUDES_RELEASE) \ + $(addprefix --dump , object std etc core) >$@ ${GENERATED}/modlist-prerelease.ddoc : modlist.d ${STABLE_DMD} $(DRUNTIME_DIR) $(PHOBOS_DIR) mkdir -p $(dir $@) - $(STABLE_RDMD) modlist.d $(DRUNTIME_DIR) $(PHOBOS_DIR) $(MOD_EXCLUDES_PRERELEASE) >$@ + $(STABLE_RDMD) modlist.d $(DRUNTIME_DIR) $(PHOBOS_DIR) $(MOD_EXCLUDES_PRERELEASE) \ + $(addprefix --dump , object std etc core) >$@ # Run "make -j rebase" for rebasing all dox in parallel! rebase: rebase-dlang rebase-dmd rebase-druntime rebase-phobos From d4de91e75ab11cb0f8e97bdc68728085dea4075e Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Tue, 28 Feb 2017 17:06:13 +0100 Subject: [PATCH 47/70] Mention the DWiki entry in the README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2410a6ef19..1c506defc4 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,4 @@ documentation, and some articles. * [Wiki](https://wiki.dlang.org/) If you wish to contribute to the website or language documentation, please see -the [CONTRIBUTING.md file] (CONTRIBUTING.md). +the [CONTRIBUTING.md file](CONTRIBUTING.md) and [wiki entry](https://wiki.dlang.org/Contributing_to_dlang.org). From d3dd43e248d1d5d055e5d895bb205446a3ffc87e Mon Sep 17 00:00:00 2001 From: Jack Stouffer Date: Wed, 1 Mar 2017 10:07:00 -0500 Subject: [PATCH 48/70] Added padding to links in Phobos book table --- css/style.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/css/style.css b/css/style.css index ab2fe2e8f6..24d150cfe0 100644 --- a/css/style.css +++ b/css/style.css @@ -997,6 +997,11 @@ table td:not(:last-child), table th:not(:last-child) padding-right: 1em; } +table.book tbody a +{ + padding-right: .6em; +} + hr { margin: 2em 0; From 00aa0bb08212706a5cad71b03b19d04d991ee621 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Mon, 27 Feb 2017 21:00:57 +0100 Subject: [PATCH 49/70] Use pattern rules for the intermediate assert/writeln translation - only regeneration - removes the ugly rsync workaround --- assert_writeln_magic.d | 97 +++++++++++++++++++++++------------------- posix.mak | 44 +++++++++---------- 2 files changed, 75 insertions(+), 66 deletions(-) diff --git a/assert_writeln_magic.d b/assert_writeln_magic.d index 6b2892323b..b770c113ff 100755 --- a/assert_writeln_magic.d +++ b/assert_writeln_magic.d @@ -47,10 +47,10 @@ class TestVisitor : ASTVisitor { import dparse.lexer : tok, Token; - this(string fileName) + this(string fileName, string destFile) { this.fileName = fileName; - fl = FileLines(fileName); + fl = FileLines(fileName, destFile); } alias visit = ASTVisitor.visit; @@ -176,7 +176,7 @@ private: FileLines fl; } -void parseFile(string fileName) +void parseFile(string fileName, string destFile) { import dparse.lexer; import dparse.parser : parseModule; @@ -195,22 +195,31 @@ void parseFile(string fileName) RollbackAllocator rba; auto m = parseModule(tokens, fileName, &rba); - auto visitor = new TestVisitor(fileName); + auto visitor = new TestVisitor(fileName, destFile); visitor.visit(m); delete visitor; } +// Modify a path under oldBase to a new path with the same subpath under newBase. +// E.g.: `/foo/bar`.rebasePath(`/foo`, `/quux`) == `/quux/bar` +string rebasePath(string path, string oldBase, string newBase) +{ + import std.path : absolutePath, buildPath, relativePath; + return buildPath(newBase, path.absolutePath.relativePath(oldBase.absolutePath)); +} + void main(string[] args) { import std.file; import std.getopt; - import std.path : asNormalizedPath; + import std.path; - string inputDir; + string inputDir, outputDir; string[] ignoredFiles; auto helpInfo = getopt(args, config.required, "inputdir|i", "Folder to start the recursive search for unittest blocks (can be a single file)", &inputDir, + "outputdir|o", "Alternative folder to use as output (can be a single file)", &outputDir, "ignore", "List of files to exclude (partial matching is supported)", &ignoredFiles); if (helpInfo.helpWanted) @@ -224,10 +233,14 @@ Tries to lower EqualExpression in AssertExpressions of Unittest blocks to commen DirEntry[] files; + // inputDir as default output directory + if (!outputDir.length) + outputDir = inputDir; + if (inputDir.isFile) { files = [DirEntry(inputDir)]; - inputDir = "."; + inputDir = ""; } else { @@ -236,13 +249,21 @@ Tries to lower EqualExpression in AssertExpressions of Unittest blocks to commen } foreach (file; files) + { if (!ignoredFiles.any!(x => file.name.canFind(x))) - file.name.parseFile; + { + // single files + if (inputDir.length == 0) + parseFile(file.name, outputDir); + else + parseFile(file.name, file.name.rebasePath(inputDir, outputDir)); + } + } } /** A simple line-based in-memory representation of a file. - - will automatically write all changes when the objct is destructed + - will automatically write all changes when the object is destructed - will use a temporary file to do safe, whole file swaps */ struct FileLines @@ -250,58 +271,48 @@ struct FileLines import std.array, std.file, std.path; string[] lines; - string destFile, path, tmpDir; + string destFile; + bool overwriteInputFile; bool hasWrittenChanges; - this(string path) - { - this(path.dirName, path.baseName); - } - - this(string repoDir, string path) + this(string inputFile, string destFile) { - writeln("opening: ", path); - - this.path = path; - destFile = buildPath(repoDir, path); - lines = File(destFile).byLineCopy.array; + stderr.writefln("%s -> %s", inputFile, destFile); + this.overwriteInputFile = inputFile == destFile; + this.destFile = destFile; + lines = File(inputFile).byLineCopy.array; - // it's a good practise to use a common tmp folder -> easier to look at or clean - tmpDir = buildPath(tempDir, "file_tester", path.stripExtension.replace("/", "_")); - tmpDir.mkdirRecurse; + destFile.dirName.mkdirRecurse; } // dumps all changes ~this() { - if (!hasWrittenChanges) - return; - - auto tmpFile = writeLinesToFile; - tmpFile.copy(destFile); - tmpFile.remove; - tmpDir.rmdirRecurse; + if (overwriteInputFile) + { + if (hasWrittenChanges) + { + auto tmpFile = File(destFile ~ ".tmp", "w"); + writeLinesToFile(tmpFile); + tmpFile.close; + tmpFile.name.rename(destFile); + } + } + else + { + writeLinesToFile(File(destFile, "w")); + } } // writes all changes to a random, temporary file - auto writeLinesToFile(string s = null) { - import std.uuid; - - if (!s.length) - s = buildPath(tmpDir, randomUUID.to!string.replace("-", "") ~ ".d"); - - writeln("writing: ", path); - auto outFile = File(s, "w"); + void writeLinesToFile(File outFile) { // dump file foreach (line; lines) outFile.writeln(line); // within the docs we automatically inject std.stdio (hence we need to do the same here) // writeln needs to be @nogc, @safe, pure and nothrow (we just fake it) - if (hasWrittenChanges) - outFile.writeln("// \nprivate void writeln(T)(T l) { }"); - + outFile.writeln("// \nprivate void writeln(T)(T l) { }"); outFile.flush; - return s; } string opIndex(size_t i) { return lines[i]; } diff --git a/posix.mak b/posix.mak index 0fd817d652..26dd893d09 100644 --- a/posix.mak +++ b/posix.mak @@ -40,6 +40,10 @@ PHOBOS_STABLE_DIR=${PHOBOS_DIR}-${LATEST} GENERATED=.generated PHOBOS_DIR_GENERATED=$(GENERATED)/phobos-prerelease PHOBOS_STABLE_DIR_GENERATED=$(GENERATED)/phobos-release +PHOBOS_FILES := $(shell find $(PHOBOS_DIR) -name '*.d' -o -name '*.mak' -o -name '*.ddoc') +PHOBOS_FILES_GENERATED := $(subst $(PHOBOS_DIR), $(PHOBOS_DIR_GENERATED), $(PHOBOS_FILES)) +PHOBOS_STABLE_FILES := $(shell find $(PHOBOS_STABLE_DIR) -name '*.d' -o -name '*.mak' -o -name '*.ddoc') +PHOBOS_STABLE_FILES_GENERATED := $(subst $(PHOBOS_STABLE_DIR), $(PHOBOS_STABLE_DIR_GENERATED), $(PHOBOS_STABLE_FILES)) # stable dub and dmd versions used to build dpl-docs DUB_VER=1.1.0 @@ -411,7 +415,7 @@ ${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim : $(DMD) ################################################################################ .PHONY: phobos-prerelease -phobos-prerelease : ${PHOBOS_DIR_GENERATED} $(STD_DDOC_PRE) druntime-prerelease +phobos-prerelease : ${PHOBOS_FILES_GENERATED} $(STD_DDOC_PRE) druntime-prerelease ${MAKE} --directory=${PHOBOS_DIR_GENERATED} -f posix.mak \ STDDOC="$(addprefix `pwd`/, $(STD_DDOC_PRE))" \ DOC_OUTPUT_DIR="${DOC_OUTPUT_DIR}/phobos-prerelease" \ @@ -421,7 +425,7 @@ phobos-prerelease : ${PHOBOS_DIR_GENERATED} $(STD_DDOC_PRE) druntime-prerelease VERSION="$(realpath ${DMD_DIR}/VERSION)" \ html -j4 -phobos-release : ${PHOBOS_STABLE_DIR_GENERATED} $(DMD_REL) $(STD_DDOC) \ +phobos-release : ${PHOBOS_STABLE_FILES_GENERATED} $(DMD_REL) $(STD_DDOC) \ druntime-release ${MAKE} --directory=${PHOBOS_STABLE_DIR_GENERATED} -f posix.mak \ DMD=$(DMD_REL) \ @@ -434,7 +438,7 @@ phobos-release : ${PHOBOS_STABLE_DIR_GENERATED} $(DMD_REL) $(STD_DDOC) \ VERSION="$(realpath ${DMD_DIR}/VERSION)" \ html -j4 -phobos-prerelease-verbatim : ${PHOBOS_DIR_GENERATED} ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim +phobos-prerelease-verbatim : ${PHOBOS_FILES_GENERATED} ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim : verbatim.ddoc \ ${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim ${MAKE} --directory=${PHOBOS_DIR_GENERATED} -f posix.mak \ @@ -483,7 +487,7 @@ ${DOC_OUTPUT_DIR}/library-prerelease/.htaccess : dpl_prerelease_htaccess cp $< $@ docs.json : ${DMD_REL} ${DRUNTIME_STABLE_DIR} \ - ${PHOBOS_STABLE_DIR_GENERATED} | dpl-docs + ${PHOBOS_STABLE_FILES_GENERATED} | dpl-docs find ${DRUNTIME_STABLE_DIR}/src -name '*.d' | \ sed -e /unittest.d/d -e /gcstub/d > .release-files.txt find ${PHOBOS_STABLE_DIR_GENERATED} -name '*.d' | \ @@ -495,7 +499,7 @@ docs.json : ${DMD_REL} ${DRUNTIME_STABLE_DIR} \ rm .release-files.txt .release-dummy.html docs-prerelease.json : ${DMD} ${DRUNTIME_DIR} \ - ${PHOBOS_DIR_GENERATED} | dpl-docs + ${PHOBOS_FILES_GENERATED} | dpl-docs find ${DRUNTIME_DIR}/src -name '*.d' | sed -e '/gcstub/d' \ -e /unittest/d > .prerelease-files.txt find ${PHOBOS_DIR_GENERATED} -name '*.d' | sed -e /unittest.d/d \ @@ -553,28 +557,22 @@ d.tag : chmgen.d $(STABLE_DMD) $(ALL_FILES) phobos-release druntime-release # - It creates a copy of Phobos to apply the transformations ################################################################################ -$(GENERATED): - mkdir -p $@ - # --update allows to copy only the newer files and thus only propagate these # changes -HAS_RSYNC := $(shell command -v rsync 2> /dev/null) +./assert_writeln_magic: assert_writeln_magic.d $(DUB) + $(DUB) build --single $< -${PHOBOS_DIR_GENERATED}: $(wildcard ${PHOBOS_DIR}/**/*) $(DUB) | $(GENERATED) -ifdef HAS_RSYNC - rsync -a --exclude='.git/' --exclude='generated/' --update -v $(PHOBOS_DIR)/ $@ -else - cp -r -T -f $(PHOBOS_DIR) $@ -endif - $(DUB) run --single ./assert_writeln_magic.d -- -i $@ +$(PHOBOS_FILES_GENERATED): $(PHOBOS_DIR_GENERATED)/%: $(PHOBOS_DIR)/% $(DUB) assert_writeln_magic + @mkdir -p $(dir $@) + @if [ $(subst .,, $(suffix $@)) == "d" ] && [ "$@" != "$(PHOBOS_DIR_GENERATED)/index.d" ] ; then \ + ./assert_writeln_magic -i $< -o $@ ; \ + else cp $< $@ ; fi -${PHOBOS_STABLE_DIR_GENERATED}: $(wildcard ${PHOBOS_STABLE_DIR_GENERATED}/**/*) $(DUB) | $(GENERATED) -ifdef HAS_RSYNC - rsync -a --exclude='.git/' --exclude='generated/' --update -v $(PHOBOS_STABLE_DIR)/ $@ -else - cp -r -T -f $(PHOBOS_STABLE_DIR) $@ -endif - $(DUB) run --single ./assert_writeln_magic.d -- -i $@ +$(PHOBOS_STABLE_FILES_GENERATED): $(PHOBOS_STABLE_DIR_GENERATED)/%: $(PHOBOS_STABLE_DIR)/% $(DUB) assert_writeln_magic + @mkdir -p $(dir $@) + @if [ $(subst .,, $(suffix $@)) == "d" ] && [ "$@" != "$(PHOBOS_STABLE_DIR_GENERATED)/index.d" ] ; then \ + ./assert_writeln_magic -i $< -o $@ ; \ + else cp $< $@ ; fi ################################################################################ # Style tests From e20cfeeb02f949a82bf24367df0f63a8b43528f7 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 1 Mar 2017 17:35:34 +0100 Subject: [PATCH 50/70] Add more comments to posix.mak --- posix.mak | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/posix.mak b/posix.mak index 26dd893d09..b83f0e8d5a 100644 --- a/posix.mak +++ b/posix.mak @@ -16,15 +16,19 @@ endif # Next major DMD release NEXT_VERSION:=$(shell bash -c 'version=$$(cat VERSION);a=($${version//./ });a[1]="10\#$${a[1]}";((a[1]++)); a[2]=0; echo $${a[0]}.0$${a[1]}.$${a[2]};' ) -# Externals +# DLang directories DMD_DIR=../dmd PHOBOS_DIR=../phobos DRUNTIME_DIR=../druntime TOOLS_DIR=../tools +INSTALLER_DIR=../installer DUB_DIR=../dub-${DUB_VER} + +# External binaries DMD=$(DMD_DIR)/src/dmd -DMD_REL=$(DMD_DIR)-${LATEST}/src/dmd DUB=${DUB_DIR}/bin/dub + +# External directories DOC_OUTPUT_DIR:=$(shell pwd)/web GIT_HOME=https://github.com/dlang DPL_DOCS_PATH=dpl-docs @@ -33,17 +37,24 @@ REMOTE_DIR=d-programming@digitalmars.com:data # Last released versions DMD_STABLE_DIR=${DMD_DIR}-${LATEST} +DMD_REL=$(DMD_STABLE_DIR)/src/dmd DRUNTIME_STABLE_DIR=${DRUNTIME_DIR}-${LATEST} PHOBOS_STABLE_DIR=${PHOBOS_DIR}-${LATEST} +################################################################################ # Automatically generated directories GENERATED=.generated PHOBOS_DIR_GENERATED=$(GENERATED)/phobos-prerelease PHOBOS_STABLE_DIR_GENERATED=$(GENERATED)/phobos-release +# The assert_writeln_magic tool transforms all source files from Phobos. Hence +# - a temporary folder with a copy of Phobos needs to be generated +# - a list of all files in Phobos and the temporary copy is needed to setup proper +# Makefile dependencies and rules PHOBOS_FILES := $(shell find $(PHOBOS_DIR) -name '*.d' -o -name '*.mak' -o -name '*.ddoc') PHOBOS_FILES_GENERATED := $(subst $(PHOBOS_DIR), $(PHOBOS_DIR_GENERATED), $(PHOBOS_FILES)) PHOBOS_STABLE_FILES := $(shell find $(PHOBOS_STABLE_DIR) -name '*.d' -o -name '*.mak' -o -name '*.ddoc') PHOBOS_STABLE_FILES_GENERATED := $(subst $(PHOBOS_STABLE_DIR), $(PHOBOS_STABLE_DIR_GENERATED), $(PHOBOS_STABLE_FILES)) +################################################################################ # stable dub and dmd versions used to build dpl-docs DUB_VER=1.1.0 @@ -128,14 +139,12 @@ else CHANGELOG_VERSION := "v${LATEST}..upstream/stable" endif -# Documents +################################################################################ +# Resources +################################################################################ -DDOC=$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME) -STD_DDOC=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-release ${GENERATED}/modlist-${LATEST}) $(NODATETIME) -STD_DDOC_PRE=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-prerelease ${GENERATED}/modlist-prerelease) $(NODATETIME) -SPEC_DDOC=${DDOC} spec/spec.ddoc -CHANGELOG_DDOC=${DDOC} changelog/changelog.ddoc $(NODATETIME) -CHANGELOG_PRE_DDOC=${CHANGELOG_DDOC} changelog/prerelease.ddoc +# Set to 1 in the command line to minify css files +CSS_MINIFY= ORGS_USING_D=$(wildcard images/orgs-using-d/*) IMAGES=favicon.ico $(ORGS_USING_D) $(addprefix images/, \ @@ -159,6 +168,17 @@ JAVASCRIPT=$(addsuffix .js, $(addprefix js/, \ STYLES=$(addsuffix .css, $(addprefix css/, \ style print codemirror ddox)) +################################################################################ +# HTML Files +################################################################################ + +DDOC=$(addsuffix .ddoc, macros html dlang.org doc ${GENERATED}/${LATEST}) $(NODATETIME) +STD_DDOC=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-release ${GENERATED}/modlist-${LATEST}) $(NODATETIME) +STD_DDOC_PRE=$(addsuffix .ddoc, macros html dlang.org ${GENERATED}/${LATEST} std std_navbar-prerelease ${GENERATED}/modlist-prerelease) $(NODATETIME) +SPEC_DDOC=${DDOC} spec/spec.ddoc +CHANGELOG_DDOC=${DDOC} changelog/changelog.ddoc $(NODATETIME) +CHANGELOG_PRE_DDOC=${CHANGELOG_DDOC} changelog/prerelease.ddoc + PREMADE=appendices.html articles.html fetch-issue-cnt.php howtos.html \ language-reference.html robots.txt .htaccess .dpl_rewrite_map.txt \ d-keyring.gpg @@ -201,7 +221,9 @@ $(PREMADE) $(STYLES) $(IMAGES) $(JAVASCRIPT)) ALL_FILES = $(ALL_FILES_BUT_SITEMAP) $(DOC_OUTPUT_DIR)/sitemap.html +################################################################################ # Pattern rulez +################################################################################ # NOTE: Depending on the version of make, order matters here. Therefore, put # sub-directories before their parents. From 83b47d6cdddf38f481457bceb8bf3fdc78138b04 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 1 Mar 2017 17:36:03 +0100 Subject: [PATCH 51/70] Use osmodel.mak for dlang.org --- osmodel.mak | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ posix.mak | 43 ++--------------------------------------- 2 files changed, 57 insertions(+), 41 deletions(-) create mode 100644 osmodel.mak diff --git a/osmodel.mak b/osmodel.mak new file mode 100644 index 0000000000..d0f160ae37 --- /dev/null +++ b/osmodel.mak @@ -0,0 +1,55 @@ +# This Makefile snippet detects the OS and the architecture MODEL +# Keep this file in sync between druntime, phobos, and dmd repositories! + +ifeq (,$(OS)) + uname_S:=$(shell uname -s) + ifeq (Darwin,$(uname_S)) + OS:=osx + endif + ifeq (Linux,$(uname_S)) + OS:=linux + endif + ifeq (FreeBSD,$(uname_S)) + OS:=freebsd + endif + ifeq (NetBSD,$(uname_S)) + OS:=netbsd + endif + ifeq (OpenBSD,$(uname_S)) + OS:=openbsd + endif + ifeq (Solaris,$(uname_S)) + OS:=solaris + endif + ifeq (SunOS,$(uname_S)) + OS:=solaris + endif + ifeq (,$(OS)) + $(error Unrecognized or unsupported OS for uname: $(uname_S)) + endif +endif + +# When running make from XCode it may set environment var OS=MACOS. +# Adjust it here: +ifeq (MACOS,$(OS)) + OS:=osx +endif + +ifeq (,$(MODEL)) + ifeq ($(OS), solaris) + uname_M:=$(shell isainfo -n) + else + uname_M:=$(shell uname -m) + endif + ifneq (,$(findstring $(uname_M),x86_64 amd64)) + MODEL:=64 + endif + ifneq (,$(findstring $(uname_M),i386 i586 i686)) + MODEL:=32 + endif + ifeq (,$(MODEL)) + $(error Cannot figure 32/64 model from uname -m: $(uname_M)) + endif +endif + +MODEL_FLAG:=-m$(MODEL) diff --git a/posix.mak b/posix.mak index b83f0e8d5a..d559c9ef83 100644 --- a/posix.mak +++ b/posix.mak @@ -9,6 +9,8 @@ # make -f posix.mak rsync # +include osmodel.mak + # Latest released version ifeq (,${LATEST}) LATEST:=$(shell cat VERSION) @@ -89,47 +91,6 @@ CHANGE_SUFFIX = \ for f in `find "$3" -iname '*.$1'`; do\ mv $$f `dirname $$f`/`basename $$f .$1`.$2; done -# Set to 1 in the command line to minify css files -CSS_MINIFY= - -# OS and MODEL -OS:= -uname_S:=$(shell uname -s) -ifeq (Darwin,$(uname_S)) - OS:=osx -endif -ifeq (Linux,$(uname_S)) - OS:=linux -endif -ifeq (FreeBSD,$(uname_S)) - OS:=freebsd -endif -ifeq (OpenBSD,$(uname_S)) - OS:=openbsd -endif -ifeq (Solaris,$(uname_S)) - OS:=solaris -endif -ifeq (SunOS,$(uname_S)) - OS:=solaris -endif -ifeq (,$(OS)) - $(error Unrecognized or unsupported OS for uname: $(uname_S)) -endif - -ifeq (,$(MODEL)) - uname_M:=$(shell uname -m) - ifneq (,$(findstring $(uname_M),x86_64 amd64)) - MODEL:=64 - endif - ifneq (,$(findstring $(uname_M),i386 i586 i686)) - MODEL:=32 - endif - ifeq (,$(MODEL)) - $(error Cannot figure 32/64 model from uname -m: $(uname_M)) - endif -endif - # Disable all dynamic content that could potentially have an unrelated impact # on a diff ifeq (1,$(DIFFABLE)) From ca6ba643366b096451b7ea087e30b5a368dfa557 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 1 Mar 2017 17:37:03 +0100 Subject: [PATCH 52/70] Add tools and installer dir to the auto git cloned repos --- posix.mak | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/posix.mak b/posix.mak index d559c9ef83..a8fc08b59f 100644 --- a/posix.mak +++ b/posix.mak @@ -349,7 +349,7 @@ dlangspec.verbatim.txt : $(DMD) verbatim.ddoc dlangspec-consolidated.d ../%-${DUB_VER} : git clone --depth=1 -b v${DUB_VER} ${GIT_HOME}/$* $@ -${DMD_DIR} ${DRUNTIME_DIR} ${PHOBOS_DIR} : +${DMD_DIR} ${DRUNTIME_DIR} ${PHOBOS_DIR} ${TOOLS_DIR} ${INSTALLER_DIR}: git clone --depth=1 ${GIT_HOME}/$(@F) $@ ################################################################################ @@ -576,10 +576,4 @@ changelog/${NEXT_VERSION}.dd: ${STABLE_DMD} ../tools ../installer pending_changelog: changelog/${NEXT_VERSION}.dd html @echo "Please open file:///$(shell pwd)/web/changelog/${NEXT_VERSION}.html in your browser" -../tools: - git clone https://github.com/dlang/tools ../tools - -../installer: - git clone https://github.com/dlang/installer ../installer - .DELETE_ON_ERROR: # GNU Make directive (delete output files on error) From c9cf21ef0c06795908d6ade01a4a41e1bf9a1ab0 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 1 Mar 2017 17:37:46 +0100 Subject: [PATCH 53/70] write the assert_writeln_magic binary to the .generated folder --- posix.mak | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/posix.mak b/posix.mak index a8fc08b59f..05040d16ab 100644 --- a/posix.mak +++ b/posix.mak @@ -538,23 +538,27 @@ d.tag : chmgen.d $(STABLE_DMD) $(ALL_FILES) phobos-release druntime-release # # - This transforms assert(a = b) to writeln(a); // b # - It creates a copy of Phobos to apply the transformations +# - All "d" files are piped through the transformator, +# other needed files (e.g. posix.mak) get copied over ################################################################################ -# --update allows to copy only the newer files and thus only propagate these -# changes -./assert_writeln_magic: assert_writeln_magic.d $(DUB) +ASSERT_WRITELN_BIN = $(GENERATED)/assert_writeln_magic + +$(ASSERT_WRITELN_BIN): assert_writeln_magic.d $(DUB) + @mkdir -p $(dir $@) $(DUB) build --single $< + @mv ./assert_writeln_magic $@ -$(PHOBOS_FILES_GENERATED): $(PHOBOS_DIR_GENERATED)/%: $(PHOBOS_DIR)/% $(DUB) assert_writeln_magic +$(PHOBOS_FILES_GENERATED): $(PHOBOS_DIR_GENERATED)/%: $(PHOBOS_DIR)/% $(DUB) $(ASSERT_WRITELN_BIN) @mkdir -p $(dir $@) @if [ $(subst .,, $(suffix $@)) == "d" ] && [ "$@" != "$(PHOBOS_DIR_GENERATED)/index.d" ] ; then \ - ./assert_writeln_magic -i $< -o $@ ; \ + $(ASSERT_WRITELN_BIN) -i $< -o $@ ; \ else cp $< $@ ; fi -$(PHOBOS_STABLE_FILES_GENERATED): $(PHOBOS_STABLE_DIR_GENERATED)/%: $(PHOBOS_STABLE_DIR)/% $(DUB) assert_writeln_magic +$(PHOBOS_STABLE_FILES_GENERATED): $(PHOBOS_STABLE_DIR_GENERATED)/%: $(PHOBOS_STABLE_DIR)/% $(DUB) $(ASSERT_WRITELN_BIN) @mkdir -p $(dir $@) @if [ $(subst .,, $(suffix $@)) == "d" ] && [ "$@" != "$(PHOBOS_STABLE_DIR_GENERATED)/index.d" ] ; then \ - ./assert_writeln_magic -i $< -o $@ ; \ + $(ASSERT_WRITELN_BIN) -i $< -o $@ ; \ else cp $< $@ ; fi ################################################################################ From f854fb181257d61859b1c6a480d8dbfd3fa7622b Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 22 Feb 2017 07:19:02 +0100 Subject: [PATCH 54/70] Enable Ddoc DMD release + Ddoc build of DMD docs --- posix.mak | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/posix.mak b/posix.mak index a9b8f75bcf..a66a5c351f 100644 --- a/posix.mak +++ b/posix.mak @@ -73,7 +73,8 @@ STABLE_RDMD=$(STABLE_DMD_ROOT)/dmd2/$(OS)/$(if $(filter $(OS),osx),bin,bin$(MODE MOD_EXCLUDES_PRERELEASE=$(addprefix --ex=, gc. rt. core.internal. core.stdc.config core.sys. \ std.algorithm.internal std.c. std.concurrencybase std.internal. std.regex.internal. \ std.windows.iunknown std.windows.registry etc.linux.memoryerror \ - std.experimental.ndslice.internal std.stdiobase) + std.experimental.ndslice.internal std.stdiobase \ + tk. msvc_dmc msvc_lib) MOD_EXCLUDES_RELEASE=$(MOD_EXCLUDES_PRERELEASE) @@ -92,6 +93,8 @@ CHANGE_SUFFIX = \ for f in `find "$3" -iname '*.$1'`; do\ mv $$f `dirname $$f`/`basename $$f .$1`.$2; done +DMD_GEN=$(DMD_DIR)/generated/$(OS)/release/$(MODEL) + # Disable all dynamic content that could potentially have an unrelated impact # on a diff ifeq (1,$(DIFFABLE)) @@ -238,8 +241,8 @@ $(DOC_OUTPUT_DIR)/dmd-%.verbatim : %.ddoc dcompiler.dd verbatim.ddoc $(DMD) all : docs html -docs : dmd-prerelease phobos-prerelease druntime-prerelease druntime-release \ - phobos-release apidocs-release apidocs-prerelease +docs : dmd-release dmd-prerelease phobos-prerelease druntime-prerelease \ + druntime-release phobos-release apidocs-release apidocs-prerelease html : $(ALL_FILES) @@ -270,7 +273,7 @@ ${GENERATED}/modlist-${LATEST}.ddoc : modlist.d ${STABLE_DMD} $(DRUNTIME_STABLE_ ${GENERATED}/modlist-prerelease.ddoc : modlist.d ${STABLE_DMD} $(DRUNTIME_DIR) $(PHOBOS_DIR) mkdir -p $(dir $@) $(STABLE_RDMD) modlist.d $(DRUNTIME_DIR) $(PHOBOS_DIR) $(MOD_EXCLUDES_PRERELEASE) \ - $(addprefix --dump , object std etc core) >$@ + $(addprefix --dump , object std etc core ddmd) >$@ # Run "make -j rebase" for rebasing all dox in parallel! rebase: rebase-dlang rebase-dmd rebase-druntime rebase-phobos @@ -365,6 +368,11 @@ $(DMD) : ${DMD_DIR} $(DMD_REL) : ${DMD_STABLE_DIR} ${MAKE} --directory=${DMD_STABLE_DIR}/src -f posix.mak AUTO_BOOTSTRAP=1 -j 4 +dmd-release : $(STD_DDOC) $(DMD_DIR) $(DMD) + $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak html \ + DOCDIR=${DOC_OUTPUT_DIR}/dmd-release \ + DOCFMT="$(addprefix `pwd`/, $(STD_DDOC))" + dmd-prerelease : $(STD_DDOC_PRE) $(DMD_DIR) $(DMD) $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak html \ DOCDIR=${DOC_OUTPUT_DIR}/dmd-prerelease \ @@ -472,6 +480,13 @@ ${DOC_OUTPUT_DIR}/library-prerelease/.htaccess : dpl_prerelease_htaccess @mkdir -p $(dir $@) cp $< $@ +DMD_EXCLUDE = +ifeq (osx,$(OS)) + DMD_EXCLUDE += -e /scanelf/d -e /libelf/d +else + DMD_EXCLUDE += -e /scanmach/d -e /libmach/d +endif + docs.json : ${DMD_REL} ${DRUNTIME_STABLE_DIR} \ ${PHOBOS_STABLE_FILES_GENERATED} | dpl-docs find ${DRUNTIME_STABLE_DIR}/src -name '*.d' | \ @@ -484,13 +499,18 @@ docs.json : ${DMD_REL} ${DRUNTIME_STABLE_DIR} \ --only-documented $(MOD_EXCLUDES_PRERELEASE) rm .release-files.txt .release-dummy.html -docs-prerelease.json : ${DMD} ${DRUNTIME_DIR} \ +docs-prerelease.json : ${DMD} ${DMD_DIR} ${DRUNTIME_DIR} \ ${PHOBOS_FILES_GENERATED} | dpl-docs + find ${DMD_DIR}/src -name '*.d' | \ + sed -e /objc.d/d -e /mscoff/d -e '/dmd\/src\/id.d/d' \ + -e /objc_glue.d/d ${DMD_EXCLUDE} \ + > .prerelease-files.txt find ${DRUNTIME_DIR}/src -name '*.d' | sed -e '/gcstub/d' \ - -e /unittest/d > .prerelease-files.txt + -e /unittest/d >> .prerelease-files.txt find ${PHOBOS_DIR_GENERATED} -name '*.d' | sed -e /unittest.d/d \ -e /windows/d >> .prerelease-files.txt - ${DMD} -c -o- -version=CoreDdoc -version=StdDdoc -Df.prerelease-dummy.html \ + ${DMD} -J$(DMD_DIR)/res -J$(DMD_GEN) -c -o- -version=MARS -version=CoreDdoc \ + -version=StdDdoc -Df.prerelease-dummy.html \ -Xfdocs-prerelease.json -I${PHOBOS_DIR_GENERATED} @.prerelease-files.txt ${DPL_DOCS} filter docs-prerelease.json --min-protection=Protected \ --only-documented $(MOD_EXCLUDES_RELEASE) From e88d2c7ce86033d50f9f90553ab9aa10a0f18ae8 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Mon, 27 Feb 2017 19:53:39 +0100 Subject: [PATCH 55/70] Add DMD to the verbatim output --- posix.mak | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/posix.mak b/posix.mak index a66a5c351f..6ab1b4ccd9 100644 --- a/posix.mak +++ b/posix.mak @@ -272,7 +272,7 @@ ${GENERATED}/modlist-${LATEST}.ddoc : modlist.d ${STABLE_DMD} $(DRUNTIME_STABLE_ ${GENERATED}/modlist-prerelease.ddoc : modlist.d ${STABLE_DMD} $(DRUNTIME_DIR) $(PHOBOS_DIR) mkdir -p $(dir $@) - $(STABLE_RDMD) modlist.d $(DRUNTIME_DIR) $(PHOBOS_DIR) $(MOD_EXCLUDES_PRERELEASE) \ + $(STABLE_RDMD) modlist.d $(DRUNTIME_DIR) $(PHOBOS_DIR) $(DMD_DIR) $(MOD_EXCLUDES_PRERELEASE) \ $(addprefix --dump , object std etc core ddmd) >$@ # Run "make -j rebase" for rebasing all dox in parallel! @@ -369,15 +369,26 @@ $(DMD_REL) : ${DMD_STABLE_DIR} ${MAKE} --directory=${DMD_STABLE_DIR}/src -f posix.mak AUTO_BOOTSTRAP=1 -j 4 dmd-release : $(STD_DDOC) $(DMD_DIR) $(DMD) - $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak html \ - DOCDIR=${DOC_OUTPUT_DIR}/dmd-release \ + $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak -j4 html \ + DOCDIR=${DOC_OUTPUT_DIR}/phobos \ DOCFMT="$(addprefix `pwd`/, $(STD_DDOC))" dmd-prerelease : $(STD_DDOC_PRE) $(DMD_DIR) $(DMD) - $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak html \ - DOCDIR=${DOC_OUTPUT_DIR}/dmd-prerelease \ + $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak -j4 html \ + DOCDIR=${DOC_OUTPUT_DIR}/phobos-prerelease \ DOCFMT="$(addprefix `pwd`/, $(STD_DDOC_PRE))" +dmd-prerelease-verbatim : $(STD_DDOC_PRE) $(DMD_DIR) \ + ${DOC_OUTPUT_DIR}/phobos-prerelease/mars.verbatim +${DOC_OUTPUT_DIR}/phobos-prerelease/mars.verbatim: verbatim.ddoc + mkdir -p $(dir $@) + $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak -j4 html \ + DOCDIR=${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim \ + DOCFMT="`pwd`/verbatim.ddoc" + $(call CHANGE_SUFFIX,html,verbatim,${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim) + mv ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim/* $(dir $@) + rm -r ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim + ################################################################################ # druntime, latest released build and current build ################################################################################ @@ -434,7 +445,8 @@ phobos-release : ${PHOBOS_STABLE_FILES_GENERATED} $(DMD_REL) $(STD_DDOC) \ phobos-prerelease-verbatim : ${PHOBOS_FILES_GENERATED} ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim ${DOC_OUTPUT_DIR}/phobos-prerelease/index.verbatim : verbatim.ddoc \ - ${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim + ${DOC_OUTPUT_DIR}/phobos-prerelease/object.verbatim \ + ${DOC_OUTPUT_DIR}/phobos-prerelease/mars.verbatim ${MAKE} --directory=${PHOBOS_DIR_GENERATED} -f posix.mak \ STDDOC="`pwd`/verbatim.ddoc" \ DOC_OUTPUT_DIR=${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim \ From dbadbc3f61b6a5b04e6ee999a3fe3245b79964e6 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 1 Mar 2017 09:06:21 +0100 Subject: [PATCH 56/70] Remove id.d exclusion + add comments --- posix.mak | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/posix.mak b/posix.mak index 6ab1b4ccd9..3b8aec7a60 100644 --- a/posix.mak +++ b/posix.mak @@ -511,12 +511,14 @@ docs.json : ${DMD_REL} ${DRUNTIME_STABLE_DIR} \ --only-documented $(MOD_EXCLUDES_PRERELEASE) rm .release-files.txt .release-dummy.html +# DDox tries to generate the docs for all `.d` files. However for dmd this is tricky, +# because the `{mach, elf, mscoff}` are platform dependent. +# Thus the need to exclude these files (and the `objc.d` files). docs-prerelease.json : ${DMD} ${DMD_DIR} ${DRUNTIME_DIR} \ ${PHOBOS_FILES_GENERATED} | dpl-docs find ${DMD_DIR}/src -name '*.d' | \ - sed -e /objc.d/d -e /mscoff/d -e '/dmd\/src\/id.d/d' \ - -e /objc_glue.d/d ${DMD_EXCLUDE} \ - > .prerelease-files.txt + sed -e /objc.d/d -e /mscoff/d -e /objc_glue.d/d ${DMD_EXCLUDE} \ + > .prerelease-files.txt find ${DRUNTIME_DIR}/src -name '*.d' | sed -e '/gcstub/d' \ -e /unittest/d >> .prerelease-files.txt find ${PHOBOS_DIR_GENERATED} -name '*.d' | sed -e /unittest.d/d \ From 6e223051a6a1b7b3e8ddb629d47b991802fb080f Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 1 Mar 2017 09:53:31 +0100 Subject: [PATCH 57/70] Use Phobos variables for DMD docs build --- posix.mak | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/posix.mak b/posix.mak index 3b8aec7a60..b473026a42 100644 --- a/posix.mak +++ b/posix.mak @@ -370,21 +370,24 @@ $(DMD_REL) : ${DMD_STABLE_DIR} dmd-release : $(STD_DDOC) $(DMD_DIR) $(DMD) $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak -j4 html \ - DOCDIR=${DOC_OUTPUT_DIR}/phobos \ - DOCFMT="$(addprefix `pwd`/, $(STD_DDOC))" + STDDOC="$(addprefix `pwd`/, $(STD_DDOC))" \ + DOC_OUTPUT_DIR="${DOC_OUTPUT_DIR}/phobos" \ + DOCSRC="$(realpath .)" dmd-prerelease : $(STD_DDOC_PRE) $(DMD_DIR) $(DMD) $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak -j4 html \ - DOCDIR=${DOC_OUTPUT_DIR}/phobos-prerelease \ - DOCFMT="$(addprefix `pwd`/, $(STD_DDOC_PRE))" + STDDOC="$(addprefix `pwd`/, $(STD_DDOC_PRE))" \ + DOCSRC="$(realpath .)" \ + DOC_OUTPUT_DIR="${DOC_OUTPUT_DIR}/phobos-prerelease" dmd-prerelease-verbatim : $(STD_DDOC_PRE) $(DMD_DIR) \ ${DOC_OUTPUT_DIR}/phobos-prerelease/mars.verbatim ${DOC_OUTPUT_DIR}/phobos-prerelease/mars.verbatim: verbatim.ddoc mkdir -p $(dir $@) $(MAKE) AUTO_BOOTSTRAP=1 --directory=$(DMD_DIR) -f posix.mak -j4 html \ - DOCDIR=${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim \ - DOCFMT="`pwd`/verbatim.ddoc" + DOC_OUTPUT_DIR="${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim" \ + STDDOC="`pwd`/verbatim.ddoc" \ + DOCSRC="$(realpath .)" $(call CHANGE_SUFFIX,html,verbatim,${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim) mv ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim/* $(dir $@) rm -r ${DOC_OUTPUT_DIR}/phobos-prerelease-verbatim From 209e36b5ffae9717e5c123ea791bb81b1f58be96 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 2 Mar 2017 00:01:04 +0100 Subject: [PATCH 58/70] DUB compile: use STABLE_DMD + bump to 2.072.2 --- posix.mak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/posix.mak b/posix.mak index a9b8f75bcf..09defd0acf 100644 --- a/posix.mak +++ b/posix.mak @@ -61,7 +61,7 @@ PHOBOS_STABLE_FILES_GENERATED := $(subst $(PHOBOS_STABLE_DIR), $(PHOBOS_STABLE_D # stable dub and dmd versions used to build dpl-docs DUB_VER=1.1.0 -STABLE_DMD_VER=2.069.2 +STABLE_DMD_VER=2.072.2 STABLE_DMD_ROOT=$(TMP)/.stable_dmd-$(STABLE_DMD_VER) STABLE_DMD_URL=http://downloads.dlang.org/releases/2.x/$(STABLE_DMD_VER)/dmd.$(STABLE_DMD_VER).$(OS).zip STABLE_DMD=$(STABLE_DMD_ROOT)/dmd2/$(OS)/$(if $(filter $(OS),osx),bin,bin$(MODEL))/dmd @@ -549,7 +549,7 @@ ASSERT_WRITELN_BIN = $(GENERATED)/assert_writeln_magic $(ASSERT_WRITELN_BIN): assert_writeln_magic.d $(DUB) @mkdir -p $(dir $@) - $(DUB) build --single $< + $(DUB) build --single --compiler=$(STABLE_DMD) $< @mv ./assert_writeln_magic $@ $(PHOBOS_FILES_GENERATED): $(PHOBOS_DIR_GENERATED)/%: $(PHOBOS_DIR)/% $(DUB) $(ASSERT_WRITELN_BIN) From f68d5df06a4ecc43927e0997f00a410927b04ece Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 2 Mar 2017 03:53:18 +0100 Subject: [PATCH 59/70] osmodel.mak: Mention tools + dlang.org repos in the update reminder --- osmodel.mak | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osmodel.mak b/osmodel.mak index d0f160ae37..04e58669ff 100644 --- a/osmodel.mak +++ b/osmodel.mak @@ -1,5 +1,6 @@ # This Makefile snippet detects the OS and the architecture MODEL -# Keep this file in sync between druntime, phobos, and dmd repositories! +# Keep this file in sync between dmd, druntime, phobos, dlang.org and tools +# repositories! ifeq (,$(OS)) uname_S:=$(shell uname -s) @@ -12,9 +13,6 @@ ifeq (,$(OS)) ifeq (FreeBSD,$(uname_S)) OS:=freebsd endif - ifeq (NetBSD,$(uname_S)) - OS:=netbsd - endif ifeq (OpenBSD,$(uname_S)) OS:=openbsd endif From 18972819175fa38071be6c9a6a48c3e6822cdb12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Schl=C3=BCter?= Date: Thu, 2 Mar 2017 12:47:17 +0100 Subject: [PATCH 60/70] Fixed issues in C code examples and added modern C standard idioms (C99 & C11). (#1563) * Fixed issues in C code examples and added modern standard idioms (C99 & C11). The C examples used in that file are not purely C and contain several C++ ism. Furthermore, they do not use C99 idioms that are now very common. Some of the examples also contain errors. - typecasts of allocation functions are typical of C++ code but are errors in pure C. - names with leading underscore are reserved for the implementation and shall not be used. - One example freed an unitialized pointer -> crash guaranteed. - Where appropriate, modified or extended the C examples with constructs from C99 and C11. Mainly designated initializers. --- ctod.dd | 109 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 39 deletions(-) diff --git a/ctod.dd b/ctod.dd index 6112b67316..634d25ef2d 100644 --- a/ctod.dd +++ b/ctod.dd @@ -208,14 +208,14 @@ $(H3 Dealing with NANs in floating point compares) $(H4 The C Way) C doesn't define what happens if an operand to a compare - is NAN, and few C compilers check for it (the Digital Mars - C compiler is an exception, DM's compilers do check for NAN operands). + is `NAN`, and few C compilers check for it (the Digital Mars + C compiler is an exception, DM's compilers do check for `NAN` operands). $(CCODE #include <math.h> if (isnan(x) || isnan(y)) - result = FALSE; + result = false; else result = (x < y); ) @@ -233,9 +233,10 @@ result = (x < y); // false if x or y is nan $(H3 Asserts are a necessary part of any good defensive coding strategy) $(H4 The C Way) -$(P C doesn't directly support assert, but does support __FILE__ -and __LINE__ from which an assert macro can be built. In fact, -there appears to be practically no other use for __FILE__ and __LINE__.) +$(P C doesn't directly support assert in the language, but does define a macro +in the standard library header assert.h. That macro writes a diagnostic message +on stderr when the condition given as parameter is not true. The message will +use __FILE__, __LINE__ and __func__ (C99) to localize the failing assertion.) $(CCODE #include <assert.h> @@ -275,8 +276,8 @@ $(H3 Looping through an array) $(H4 The C Way) $(P - The array length is defined separately, or a clumsy - sizeof() expression is used to get the length.) + The array length is defined separately, or a clumsy and error prone + `sizeof()` expression is used to get the length.) $(CCODE #define ARRAY_LENGTH 17 @@ -343,8 +344,7 @@ int array_length; int *array; int *newarray; -newarray = (int *) - realloc(array, (array_length + 1) * sizeof(int)); +newarray = realloc(array, (array_length + 1) * sizeof(int)); if (!newarray) error("out of memory"); array = newarray; @@ -380,9 +380,8 @@ char *s2; char *s; // Concatenate s1 and s2, and put result in s -free(s); -s = (char *)malloc((s1 ? strlen(s1) : 0) + - (s2 ? strlen(s2) : 0) + 1); +s = malloc((s1 ? strlen(s1) : 0) + + (s2 ? strlen(s2) : 0) + 1); if (!s) error("out of memory"); if (s1) @@ -394,10 +393,8 @@ if (s2) // Append "hello" to s char hello[] = "hello"; -char *news; size_t lens = s ? strlen(s) : 0; -news = (char *) - realloc(s, (lens + sizeof(hello) + 1) * sizeof(char)); +char *news = realloc(s, lens + sizeof(hello) + 1); if (!news) error("out of memory"); s = news; @@ -612,7 +609,9 @@ $(CCODE void dostring(char *s) { enum Strings { Hello, Goodbye, Maybe, Max }; - static char *table[] = { "hello", "goodbye", "maybe" }; + static char *table[] = { [Hello] ="hello", + [Goodbye]="goodbye", + [Maybe] ="maybe" }; int i; for (i = 0; i < Max; i++) @@ -634,7 +633,9 @@ void dostring(char *s) structures, the enum, the table, and the switch cases. If there are a lot of values, the connection between the 3 may not be so obvious when doing maintenance, and so the situation is ripe for - bugs. + bugs. Designated initializers as were introduced with C99 allow + to link correctly 2 of the 3 data structures, but at the cost of + a lot of typing. Additionally, if the number of values becomes large, a binary or hash lookup will yield a considerable performance increase over @@ -718,23 +719,23 @@ Sometimes, it's nice to control the layout of a struct with nested structs and u $(H4 The C Way) - C doesn't allow anonymous structs or unions, which means that dummy tag names - and dummy members are necessary: + Before C11 C didn't allow for anonymous structs or unions, which meant that + dummy member names were necessary: $(CCODE struct Foo { int i; - union Bar + union { - struct Abc { int x; long y; } _abc; + struct { int x; long y; } abc; char *p; - } _bar; + } bar; }; -#define x _bar._abc.x -#define y _bar._abc.y -#define p _bar.p +#define x bar.abc.x +#define y bar.abc.y +#define p bar.p struct Foo f; @@ -839,10 +840,12 @@ $(H4 The C Way) $(CCODE union U { int a; long b; }; union U x = { 5 }; // initialize member 'a' to 5 +union U y = { .b = 42l }; // initialize member 'b' to 42 (C99) + ) Adding union members or rearranging them can have disastrous consequences - for any initializers. + for any initializers. Designated initializers in C99 fix that issue. $(H4 The D Way) @@ -865,13 +868,15 @@ $(H4 The C Way) $(CCODE struct S { int a; int b; }; struct S x = { 5, 3 }; +struct S y = { .b=3, .a=5 }; /* C99 */ ) This isn't much of a problem with small structs, but when there are numerous members, it becomes tedious to get the initializers carefully lined up with the field declarations. Then, if members are added or rearranged, all the initializations have to be found and - modified appropriately. This is a minefield for bugs. + modified appropriately. This is a minefield for bugs. Designated + initializers in C99 fix that issue. $(H4 The D Way) @@ -889,9 +894,11 @@ $(H3 Array Initializations) $(H4 The C Way) - C initializes array by positional dependence: + C initializes array by positional dependence. C99 fixes the issue: $(CCODE -int a[3] = { 3,2,2 }; +int a[3] = { 3,2,1 }; +int a[3] = { [2]=1, [0]=3, [1]=2 }; /* C99 designated initializer */ +int a[3] = { [2]=1, [0]=3, 2 }; /* C99 designated initializer */ ) Nested arrays may or may not have the { }: $(CCODE @@ -901,6 +908,7 @@ int b[3][2] = { 2,3, {6,5}, 3,4 }; $(H4 The D Way) D does it by positional dependence too, but an index can be used as well. + The D syntax is lighter than C99 designated initializers. The following all produce the same result: ---------------------------- @@ -981,9 +989,18 @@ $(CCODE #include <tchar.h> tchar string[] = TEXT("hello"); ) + Furthermore, in praxis `wchar_t` is not usable in portable code as its size + is implementation dependent. On POSIX conforming machines it generally + represents an UTF-32 codeunit, on Windows an UTF-16 codeunit. C11 introduced + C++11 types char16_t and char32_t to overcome this issue. + $(H4 The D Way) -The type of a string is determined by semantic analysis, so there is no need to wrap strings in a macro call. Alternatively if type inference is used the string can have a $(B c), $(B w) or $(B d) suffix, representing UTF-8, UTF-16 and UTF-32 encoding, respectively. If no suffix is used the type is inferred to be a UTF-8 string: + The type of a string is determined by semantic analysis, so there is no need + to wrap strings in a macro call. Alternatively if type inference is used the + string can have a `c`, `w` or `d` suffix, representing UTF-8, + UTF-16 and UTF-32 encoding, respectively. If no suffix is used the type is + inferred to be a UTF-8 string: ----------------------------- string utf8 = "hello"; // UTF-8 string wstring utf16 = "hello"; // UTF-16 string @@ -1004,8 +1021,12 @@ $(H4 The C Way) $(CCODE enum COLORS { red, blue, green, max }; char *cstring[max] = {"red", "blue", "green" }; +char *cstring[max] = {[red]="red", [blue]="blue", [green]="green" }; /* C99 */ ) - This is fairly easy to get right because the number of entries is small. But suppose it gets to be fairly large. Then it can get difficult to maintain correctly when new entries are added. + This is fairly easy to get right because the number of entries is small. + But suppose it gets to be fairly large. Then it can get difficult to + maintain correctly when new entries are added. C99 added designated + initializers to solve that problem. $(H4 The D Way) ----------------------------- @@ -1071,7 +1092,7 @@ if (h != HANDLE_INIT) $(CCODE struct Handle__ HANDLE_INIT; -void init_handle() // call this function upon startup +void init_handle(void) // call this function upon startup { HANDLE_INIT.value = (void *)-1; } @@ -1087,9 +1108,9 @@ if (memcmp(&h,&HANDLE_INIT,sizeof(Handle)) != 0) $(H4 The D Way) - D has powerful metaprogramming abilties which allow it to implement - $(D typedef) as a library feature. Simply import $(B std.typecons) and - use the $(B Typedef) template: + D has powerful metaprogramming abilities which allow it to implement + $(D typedef) as a library feature. Simply import `std.typecons` and + use the `Typedef` template: ----------------------------- import std.typecons; @@ -1103,7 +1124,7 @@ foo(h); // syntax error bar(h); // ok ----------------------------- - To handle a default value, pass the initializer to the $(B Typedef) + To handle a default value, pass the initializer to the `Typedef` template as the second argument and refer to it with the $(D .init) property: @@ -1230,12 +1251,14 @@ qsort(array, sizeof(array)/sizeof(array[0]), ) A compare() must be written for each type, and much careful - typo-prone code needs to be written to make it work. + typo-prone code needs to be written to make it work. The indirect function + call required for each comparison limits the achievable performance of the + `qsort()` routine. $(H4 The D Way) - D has a powerful $(B std.algorithm) module with optimized + D has a powerful `std.algorithm` module with optimized sorting routines, which work for any built-in or user-defined type which can be compared: @@ -1258,6 +1281,14 @@ $(CCODE "This text spans\n\ multiple\n\ lines\n" +) + + C's string literal concatenation doesn't really solve the problem: + +$(CCODE +"This text spans\n" +"multiple\n" +"lines\n" ) If there is a lot of text, this can wind up being tedious. From 83430bb40d76c22df396996599ba8617cf3a0e96 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 2 Mar 2017 20:25:30 +0100 Subject: [PATCH 61/70] Footer: show always the current year and the D Language Foundation (#1595) --- dlang.org.ddoc | 10 +++++----- dpl-docs/views/layout.dt | 13 +++++++------ ebook.ddoc | 6 +++--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/dlang.org.ddoc b/dlang.org.ddoc index ee19198ab6..5667b38727 100644 --- a/dlang.org.ddoc +++ b/dlang.org.ddoc @@ -40,7 +40,7 @@ COMMON_SCRIPTS_DLANG = _= CONSOLE=$(TC pre, console notranslate, $0) -COPYRIGHT=Copyright © 1999-$(YEAR) by the $(LINK2 $(ROOT)/foundation.html, D Language Foundation) +COPYRIGHT_FOUNDATION=Copyright © 1999-$(YEAR) by the $(LINK2 $(ROOT_DIR)foundation.html, D Language Foundation) CPPCODE=$(TC pre, cppcode notranslate, $0) CPPLISTING=$(CPPCODE $0) CROSS=✘ @@ -54,9 +54,9 @@ DDOC= @@ -152,7 +152,7 @@ EXTRA_FOOTERS= _= FAVICON=$(STATIC favicon.ico) -FOOTER = $(DIVCID smallprint, copyright, $(COPYRIGHT) | Page generated by +FOOTER = $(DIVCID smallprint, copyright, $(COPYRIGHT_FOUNDATION) | Page generated by $(LINK2 $(ROOT_DIR)spec/ddoc.html, Ddoc) on $(GEN_DATETIME)) FOOTNOTE=$(SPANC footnote, $0) FULL_TITLE=$(TITLE) - D Programming Language diff --git a/dpl-docs/views/layout.dt b/dpl-docs/views/layout.dt index 41c82eea72..3be1eaf5d5 100644 --- a/dpl-docs/views/layout.dt +++ b/dpl-docs/views/layout.dt @@ -1,9 +1,11 @@ !!! 5 html(lang='en-US') + - import std.datetime : Clock; + - auto year = Clock.currTime.year; // - | Copyright (c) 1999-2016 by Digital Mars - | All Rights Reserved Written by Walter Bright - | http://digitalmars.com + | Copyright (c) 1999-$#{year} by the D Language Foundation + | All Rights Reserved. + | https://dlang.org/foundation.html - import std.process : environment; - string version_id = environment["GIT_TARGET"]; - bool noExactSourceCodeLinks = environment["NO_EXACT_SOURCE_CODE_LINKS"] == "1"; @@ -212,9 +214,8 @@ html(lang='en-US') | #quickindex.quickindex - #copyright - block copyright - | | Page generated by ddox. + #copyright.smallprint + | Copyright © 1999-#{year} by the D Language Foundation | Page generated by ddox. script(type='text/javascript', src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js') | diff --git a/ebook.ddoc b/ebook.ddoc index 5d13dfd68d..5505dae711 100644 --- a/ebook.ddoc +++ b/ebook.ddoc @@ -3,9 +3,9 @@ DDOC= From 04df1ca62b189e6ba763145a4ed76fea92ba685d Mon Sep 17 00:00:00 2001 From: RazvanN7 Date: Fri, 3 Mar 2017 09:50:21 +0200 Subject: [PATCH 62/70] Updated makefile to use dmd/generated/os/release/model/dmd --- posix.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posix.mak b/posix.mak index 7c29a51069..04cc9345a7 100644 --- a/posix.mak +++ b/posix.mak @@ -27,7 +27,7 @@ INSTALLER_DIR=../installer DUB_DIR=../dub-${DUB_VER} # External binaries -DMD=$(DMD_DIR)/src/dmd +DMD=$(DMD_DIR)/generated/$(OS)/release/$(MODEL)/dmd DUB=${DUB_DIR}/bin/dub # External directories From 42bfe1aa628f956d7085c64df82fcae8414b7ab7 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Fri, 3 Mar 2017 22:25:12 +0100 Subject: [PATCH 63/70] Remove "Call for submissions" from news (#1597) Remove "Call for submissions" from news merged-on-behalf-of: Sebastian Wilzbach --- index.dd | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/index.dd b/index.dd index 1ee8261b5c..fcbdac302c 100644 --- a/index.dd +++ b/index.dd @@ -84,12 +84,10 @@ $(DIVID news, $(DIVC boxes, $(DIVC row, $(TOUR newspaper-o, News, - $(P $(LINK2 http://dconf.org/2017/index.html, DConf 2017): - Call for Submissions is open. $(BR) - The $(LINK2 $(ROOT_DIR)foundation.html, D Language Foundation) - has been accepted as a 501(c) non-profit public charity - and thus can handle - $(LINK2 $(ROOT_DIR)donate.html, donations). + $(P $(LINK2 http://dconf.org/2017/index.html, DConf 2017) + is coming up: May 4-7 in Berlin, Germany. $(BR) + $(LINK2 http://dconf.org/2017/registration.html, Secure your seat) + before it's sold out! ) $(P Stay updated with $(LINK2 http://arsdnet.net/this-week-in-d, From 03903b8770f40e76949525156770004654e96bd9 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sat, 4 Mar 2017 23:07:28 -0500 Subject: [PATCH 64/70] Make link padding only apply to more specific cases The old rule was too general and cause silly looking spaces as Andrei described here: http://forum.dlang.org/post/ohjurtkzhvufqsahmimj@forum.dlang.org This makes it only happen where I believe it was intended to happen: on the hand-written index replacement, such as here: https://dlang.org/phobos-prerelease/std_algorithm.html where we have a long list of links all right next to each other under the quickindex div. --- css/style.css | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index 24d150cfe0..bf1760b13c 100644 --- a/css/style.css +++ b/css/style.css @@ -997,7 +997,28 @@ table td:not(:last-child), table th:not(:last-child) padding-right: 1em; } -table.book tbody a +/* + These next two rules are for pages like: + http://dlang.org/phobos-prerelease/std_regex.html + + The idea is if we have a list of links, we want space + to the right of each one. But detecting a list of links + vs just a single link requires some thought: the css + adjacent sibling rule does well detecting all but the first + one in a list, so we'll add space to the right of them (that's + the second rule here), but that leaves an inconsistent space + after the first item. + + That's where the following rule comes in: on the item directly + following the first link, add some left padding to simulate the + first one having the same space as the others. +*/ +table.book tbody a:first-child + a +{ + padding-left: .6em; +} + +table.book tbody a + a { padding-right: .6em; } From 731eae55304e2ddfcd44e9ff2c7f040105a115fc Mon Sep 17 00:00:00 2001 From: RazvanN7 Date: Mon, 6 Mar 2017 13:35:27 +0200 Subject: [PATCH 65/70] Removed redundant DMD_GEN variable and replaced it's occurences with DMD --- posix.mak | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/posix.mak b/posix.mak index 3982bee52a..f330e983c0 100644 --- a/posix.mak +++ b/posix.mak @@ -93,8 +93,6 @@ CHANGE_SUFFIX = \ for f in `find "$3" -iname '*.$1'`; do\ mv $$f `dirname $$f`/`basename $$f .$1`.$2; done -DMD_GEN=$(DMD_DIR)/generated/$(OS)/release/$(MODEL) - # Disable all dynamic content that could potentially have an unrelated impact # on a diff ifeq (1,$(DIFFABLE)) @@ -527,7 +525,7 @@ docs-prerelease.json : ${DMD} ${DMD_DIR} ${DRUNTIME_DIR} \ -e /unittest/d >> .prerelease-files.txt find ${PHOBOS_DIR_GENERATED} -name '*.d' | sed -e /unittest.d/d \ -e /windows/d >> .prerelease-files.txt - ${DMD} -J$(DMD_DIR)/res -J$(DMD_GEN) -c -o- -version=MARS -version=CoreDdoc \ + ${DMD} -J$(DMD_DIR)/res -J$(DMD) -c -o- -version=MARS -version=CoreDdoc \ -version=StdDdoc -Df.prerelease-dummy.html \ -Xfdocs-prerelease.json -I${PHOBOS_DIR_GENERATED} @.prerelease-files.txt ${DPL_DOCS} filter docs-prerelease.json --min-protection=Protected \ From 44dd86f9a22bffbc057e76a2cf861037f8f34760 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Mon, 6 Mar 2017 12:25:23 +0000 Subject: [PATCH 66/70] Make links in 404 pages absolute Fixes display of 404 pages for any non-root URL (e.g. http://dlang.org/phobos/nonexisting.html). --- errorpage.ddoc | 2 ++ posix.mak | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 errorpage.ddoc diff --git a/errorpage.ddoc b/errorpage.ddoc new file mode 100644 index 0000000000..528e27e824 --- /dev/null +++ b/errorpage.ddoc @@ -0,0 +1,2 @@ +ROOT_DIR=/ +ROOT= diff --git a/posix.mak b/posix.mak index 3934c16f9a..42f808164a 100644 --- a/posix.mak +++ b/posix.mak @@ -189,6 +189,9 @@ $(DOC_OUTPUT_DIR)/changelog/%.html : changelog/%_pre.dd $(CHANGELOG_PRE_DDOC) $( $(DOC_OUTPUT_DIR)/spec/%.html : spec/%.dd $(SPEC_DDOC) $(DMD) $(DMD) -c -o- -Df$@ $(SPEC_DDOC) $< +$(DOC_OUTPUT_DIR)/404.html : 404.dd $(DDOC) $(DMD) + $(DMD) -conf= -c -o- -Df$@ $(DDOC) errorpage.ddoc $< + $(DOC_OUTPUT_DIR)/%.html : %.dd $(DDOC) $(DMD) $(DMD) -conf= -c -o- -Df$@ $(DDOC) $< From 0e83ed300081d264cd1dbca6ada9c80871992639 Mon Sep 17 00:00:00 2001 From: RazvanN7 Date: Mon, 6 Mar 2017 15:04:34 +0200 Subject: [PATCH 67/70] Removed redundant DMD_GEN variable and replaced it's occurences with DMD --- posix.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posix.mak b/posix.mak index f330e983c0..2a83370e99 100644 --- a/posix.mak +++ b/posix.mak @@ -525,7 +525,7 @@ docs-prerelease.json : ${DMD} ${DMD_DIR} ${DRUNTIME_DIR} \ -e /unittest/d >> .prerelease-files.txt find ${PHOBOS_DIR_GENERATED} -name '*.d' | sed -e /unittest.d/d \ -e /windows/d >> .prerelease-files.txt - ${DMD} -J$(DMD_DIR)/res -J$(DMD) -c -o- -version=MARS -version=CoreDdoc \ + ${DMD} -J$(DMD_DIR)/res -J$(dir $(DMD)) -c -o- -version=MARS -version=CoreDdoc \ -version=StdDdoc -Df.prerelease-dummy.html \ -Xfdocs-prerelease.json -I${PHOBOS_DIR_GENERATED} @.prerelease-files.txt ${DPL_DOCS} filter docs-prerelease.json --min-protection=Protected \ From 093284673e138435221d14ee3fe3f5159f6f5d4b Mon Sep 17 00:00:00 2001 From: Jack Stouffer Date: Wed, 8 Mar 2017 14:32:07 -0500 Subject: [PATCH 68/70] Add style rule for Phobos about field declarations --- dstyle.dd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dstyle.dd b/dstyle.dd index 1ada5f0acb..f7039d2dc3 100644 --- a/dstyle.dd +++ b/dstyle.dd @@ -359,6 +359,23 @@ void foo(R)(R r) if (R == 1) ------------------------------- ) +$(LISTSECTION Class/Struct Field Declarations, + $(LI In structs and classes, there should only be one space between the type of + the field and its name. This avoids problems with future changes generating a + larger git diff than necessary.) +------------------------------- +class MyClass +{ + // bad + int a; + double b; + + // good + int x; + double y; +} +------------------------------- +) $(BR) $(P From f2f41aacba9b9aa37b4b01f24540cc446d0b4290 Mon Sep 17 00:00:00 2001 From: insideoutclub Date: Thu, 9 Mar 2017 07:45:02 -0800 Subject: [PATCH 69/70] Update safed.dd Fixing Typos. --- safed.dd | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/safed.dd b/safed.dd index 174a030a35..dcc3a73102 100644 --- a/safed.dd +++ b/safed.dd @@ -13,7 +13,7 @@ $(D_S SafeD—The Safe Subset of D, ) $(P - The universal reason I've heard from the turncoats was $(DOUBLEQUOTE productivity.) The consensus seems to be that programmers are more productive using Java, C#, Ruby, or Python then they are using C++. + The universal reason I've heard from the turncoats was $(DOUBLEQUOTE productivity.) The consensus seems to be that programmers are more productive using Java, C#, Ruby, or Python than they are using C++. ) $(P @@ -128,7 +128,7 @@ printf (format); ) $(P - Let's talk about pointers some more. Every memory allocation returns a valid pointer (unless the program runs out of memory). You might think that dereferencing such a pointer would be safe. That is correct as long as your program doesn't free the allocated memory thus ending the lifetime of the object. After that, you are dealing with a dangling pointer and all bets are off. Again, C Standard is pretty upfront about it. + Let's talk about pointers some more. Every memory allocation returns a valid pointer (unless the program runs out of memory). You might think that dereferencing such a pointer would be safe. That is correct as long as your program doesn't free the allocated memory thus ending the lifetime of the object. After that, you are dealing with a dangling pointer and all bets are off. Again, the C Standard is pretty upfront about it. )
@@ -160,7 +160,7 @@ std:cout << "Hello World!" << std::endl; ) ) $(P - Whereas pointers were important in C, C++ embraced them as the main vehicle for the Standard Library. STL algorithms use iterators, objects that are either pointers themselves or imitate the behavior (and the pitfalls) of pointers. Just like with pointers, a programmer's error in using iterators leads to undefined behavior (see the $(CODE swap_range) example). + Whereas pointers were important in C, C++ embraced them as the main vehicle for the Standard Library. STL algorithms use iterators, objects that are either pointers themselves or imitate the behavior (and the pitfalls) of pointers. Just like with pointers, a programmer's error in using iterators leads to undefined behavior (see the $(CODE swap_ranges) example). ) $(P @@ -189,14 +189,14 @@ writeln("Hello Safe World!"); --- $(P - The function $(CODE writeln) is the equivalent of the C $(CODE printf) (more precisely, it's the representative of a family of output functions including $(CODE write) and its formatting versions, $(CODE writef) and $(CODE writefln)). Just like $(CODE printf), $(CODE writeln) accepts a variable number of arguments of arbitrary types. But here the similarity ends. As long as you pass SafeD-arguments to $(CODE writeln), you are guaranteed not to encounter any undefined behavior. Here, $(CODE writeln) is called with a single argument of the type $(CODE string). In contrast to C, D $(CODE string) is not a pointer. It is an array of $(CODE immutable char), and arrays are a built into the safe subset of D. + The function $(CODE writeln) is the equivalent of the C $(CODE printf) (more precisely, it's the representative of a family of output functions including $(CODE write) and its formatting versions, $(CODE writef) and $(CODE writefln)). Just like $(CODE printf), $(CODE writeln) accepts a variable number of arguments of arbitrary types. But here the similarity ends. As long as you pass SafeD-arguments to $(CODE writeln), you are guaranteed not to encounter any undefined behavior. Here, $(CODE writeln) is called with a single argument of the type $(CODE string). In contrast to C, a D $(CODE string) is not a pointer. It is an array of $(CODE immutable char), and arrays are built into the safe subset of D. ) $(P You might be interested to know how the safety of $(CODE writeln) is accomplished in D. One possible approach would have been to make $(CODE writeln) a compiler intrinsic, so that correct code would be generated on a case-by-case basis. The beauty of D is that it gives a sophisticated programmer tools that allow such case-by-case code generation of code. The advanced features used in the implementation of writeln are: $(UL $(LI Compile-time code generation using templates, and) - $(LI A safe mechanism for dealing with variable number of arguments using tuples.) + $(LI A safe mechanism for dealing with a variable number of arguments using tuples.) ) ) @@ -208,11 +208,11 @@ $(SECTION2 SafeD Libraries, ) $(P - A lot of advanced features of D are compatible with SafeD, as long as they don't force the user to use unsafe types. For instance, a library may provide the implementation of a generic list. The list can be instantiated with any type, in particular with a pointer type. A list of pointers, by definition, cannot be safe, because pointer arithmetic is unsound. However, a list of ints or class objects can and should be safe. That's why such ageneric lists can be used in SafeD, even though their usage outside of SafeD may be unsafe. + A lot of advanced features of D are compatible with SafeD, as long as they don't force the user to use unsafe types. For instance, a library may provide the implementation of a generic list. The list can be instantiated with any type, in particular with a pointer type. A list of pointers, by definition, cannot be safe, because pointer arithmetic is unsound. However, a list of ints or class objects can and should be safe. That's why such generic lists can be used in SafeD, even though their usage outside of SafeD may be unsafe. ) $(P - Moreover, it might be more efficient to base the internal implementation of a list on pointers. As long as these pointers are not exposed to the client, such an implementation might be certified to be SafeD compatible1 . You can have a cake (advanced features of D) and eat it too (take advantage of them in SafeD). + Moreover, it might be more efficient to base the internal implementation of a list on pointers. As long as these pointers are not exposed to the client, such an implementation might be certified to be SafeD compatible1. You can have a cake (advanced features of D) and eat it too (take advantage of them in SafeD). ) ) From 049ede3512cbd43a4fa5e74e225e8b27a769e570 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Fri, 10 Mar 2017 17:04:11 +0000 Subject: [PATCH 70/70] changelog/2.073.2: Fix VER Fixes "LATEST" appearing instead of a version number in the 2.073.2 changelog. --- changelog/2.073.2.dd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/2.073.2.dd b/changelog/2.073.2.dd index 587d04a368..cdd135cf54 100644 --- a/changelog/2.073.2.dd +++ b/changelog/2.073.2.dd @@ -29,5 +29,5 @@ $(LI $(BUGZILLA 17198): rdmd does not recompile when --extra-file is added) ) $(CHANGELOG_NAV_LAST 2.073.1) Macros: - VER=LATEST + VER=2.073.2 TITLE=Change Log: $(VER)