Bug 7714 – Building d-programming-language.org fails to build phobos when built with multiple jobs.
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2012-03-15T05:30:00Z
Last change time
2017-07-11T18:43:43Z
Assigned to
nobody
Creator
schveiguy
Comments
Comment #0 by schveiguy — 2012-03-15T05:30:08Z
Phobos's posix.mak has a rule:
$(DRUNTIME) :
$(MAKE) -C $(DRUNTIME_PATH) -f posix.mak MODEL=$(MODEL)
which builds druntime if it's not already built. However, this *also* builds .di files for druntime's src/import.
But none of the rules in phobos make any ddoc output depend on druntime. So if I go to a clean phobos (with a clean dependent druntime), and do make -f posix.mak html, it fails with the following error:
../d-programming-language.org/std.ddoc -Df../d-programming-language.org/web/phobos/std_algorithm.html std/algorithm.d
std/c/string.d(12): Error: module string is in file 'core/stdc/string.d' which cannot be read
But if I make -f posix.mak release html, it works, because then druntime is first built.
Now, this is not necessarily a problem, because d-programming-language.org builds phobos using release html. However, it builds with multiple jobs (-j 4). It also cleans out druntime before building. So what ends up happening is, druntime is a requirement for the release target, so running make for druntime consumes one job. But it's not a requirement for the ddoc tasks, so it starts building those tasks. If it gets to a ddoc file (such as std_algorithm.html) which requires druntime imports *before* druntime has finished building, the whole build fails.
This *might not* fail on other systems, depending on how fast druntime builds (it's a race condition). But I think all ddoc files should depend on $(DRUNTIME).
Comment #1 by schveiguy — 2012-03-15T05:34:29Z
(In reply to comment #0)
> I go to a clean phobos (with a clean dependent druntime), and do make -f
> posix.mak html, it fails with the following error:
>
> ../d-programming-language.org/std.ddoc
> -Df../d-programming-language.org/web/phobos/std_algorithm.html std/algorithm.d
> std/c/string.d(12): Error: module string is in file 'core/stdc/string.d' which
> cannot be read
Somehow, I cut off the full compile line. This should be:
../dmd.2.058/src/dmd -m32 -d -c -o- -version=StdDdoc -I../druntime.2.058/import ../d-programming-language.org/std.ddoc -Df../d-programming-language.org/web/phobos/std_algorithm.html std/algorithm.d
std/c/string.d(12): Error: module string is in file 'core/stdc/string.d' which cannot be read
Comment #2 by greensunny12 — 2017-07-11T18:43:43Z
This works fine for me and as its five years later I assume this has been fixed done the road. Please reopen if the issue still exists.