Remove the assert->writeln pipeline in favor of the DDoc wrapper#2069
Remove the assert->writeln pipeline in favor of the DDoc wrapper#2069dlang-bot merged 13 commits intodlang:masterfrom
Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
|
Cool, thanks! |
|
BTW any idea how I can deal with the conflicts without creating any files? > cd ~/dlang/phobos
> cat std/algorithm/package.d | dmd -c -o- -D -
std/algorithm/comparison.d(59): Error: package name 'std.algorithm' conflicts with usage as a module name in file __stdin.d
std/algorithm/iteration.d(67): Error: package name 'std.algorithm' conflicts with usage as a module name in file __stdin.d
std/algorithm/mutation.d(78): Error: package name 'std.algorithm' conflicts with usage as a module name in file __stdin.d
std/algorithm/searching.d(106): Error: package name 'std.algorithm' conflicts with usage as a module name in file __stdin.d
std/algorithm/setops.d(48): Error: package name 'std.algorithm' conflicts with usage as a module name in file __stdin.d
std/algorithm/sorting.d(76): Error: package name 'std.algorithm' conflicts with usage as a module name in file __stdin.d |
|
Oh man... looks like the hack I used to make stdin work with dmd has backfired. :-( Will have to look into this deeper at some point. |
|
Started to move ahead with this transition and moved the second commit to #2072 |
178cd57 to
74fb6ab
Compare
74fb6ab to
4ca26aa
Compare
5078a84 to
3c031c1
Compare
|
@CyberShadow I think this is finally ready :) Note: it has the downsides
However, the assert/writeln rewrite is imho just a nice to have - it's not a huge deal if it's not there for a few modules and on the upside:
Especially the last bit would be nice to finally have - it would make #2162 a bit easier. Once this is in, we can always figure out how to close the remaining problems, but I think we need to have a start and common base somewhere. |
3c031c1 to
8aaf8a8
Compare
|
A bit sad that the DDox examples will regress to standard asserts, but I guess that could be fixable in DDox itself, right? |
CyberShadow
left a comment
There was a problem hiding this comment.
You still have a reference to $(ASSERT_WRITELN_BIN), that's causing the test target to fail:
test: $(ASSERT_WRITELN_BIN)_test test_dspec test/next_version.sh all
| # before actually running Ddoc. | ||
| # Currently this is used for: | ||
| # - TOC | ||
| # - assert -> writeln magic |
There was a problem hiding this comment.
Seems like the two lists of the program's tasks/capabilities are redundant (and one is more complete than the other).
👍 on more docs though.
posix.mak
Outdated
| # - 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 |
ddoc/dub.sdl
Outdated
| @@ -0,0 +1,4 @@ | |||
| name "ddoc_preprocessor" | |||
| description "Preprocessos source code before running Ddoc over it" | |||
ddoc/dub.sdl
Outdated
| name "ddoc_preprocessor" | ||
| description "Preprocessos source code before running Ddoc over it" | ||
| dependency "libdparse" version="0.7.2-alpha.4" | ||
| targetType "executable" |
There was a problem hiding this comment.
Do we have do use Dub here?
Unless you plan to add dependencies from code.dlang.org, rdmd should suffice.
I don't object to using Dub, just thinking back to all the times it gave us trouble, and don't want to add to that pile.
There was a problem hiding this comment.
Fair point, but it doesn't change the status quo. The assert_writeln_magic script used dub too.
Unless you plan to add dependencies from code.dlang.org
Yeah, we need libdparse. I'm no huge fan of dub either, either because it seems like we/I are the ones who do all the dog-fooding of it to make it and the registry mature.
Unfortunately, that's also a reason to keep using dub here (instead of doing git clones).
795b293 to
93133cf
Compare
Okay, now I did it in this PR ;-) |
|
Failing with @wilzbach Not really related to this PR, but it looks like DAutoTest is redoing a lot of work for the |
93133cf to
b8aa500
Compare
|
Rebased again - it's getting a bit tedious to maintain/rebase this. What's blocking for this? |
|
I've been a little hesitant because forking DDox seems to be a liability in the long-term. Would be good to see some initial effort of upstreaming the changes before this is merged. |
edc0f5b to
4fee57e
Compare
|
https://issues.dlang.org/show_bug.cgi?id=18442 (linking to unittests) would be easy to implement with the changes of this PR. |
4fee57e to
f3f3d6a
Compare
c73a7dd to
1125004
Compare
Okay, I reduced the copy of Good enough? |
CyberShadow
left a comment
There was a problem hiding this comment.
Thank you! Hopefully this will go a long way.
The first process was started by `pipeProcess` but never interacted with, not even calling `wait` before starting the next instance - with exact same arguments! Seems like this line wasn't deleted in dlang#2069 which introduced `execute` and removed the other code interacting with the piped process.
The first process was started by `pipeProcess` but never interacted with, not even calling `wait` before starting the next instance - with exact same arguments! Seems like this line wasn't deleted in #2069 which introduced `execute` and removed the other code interacting with the piped process.
Idea: use a custom Ddoc wrapper to pre-process the source files and avoid the
need for creating a temporary directory with the processed sources.