D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7714 - Building d-programming-language.org fails to build phobos when built with multiple jobs.
Summary: Building d-programming-language.org fails to build phobos when built with mul...
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-15 05:30 UTC by Steven Schveighoffer
Modified: 2017-07-11 18:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Steven Schveighoffer 2012-03-15 05:30:08 UTC
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 Steven Schveighoffer 2012-03-15 05:34:29 UTC
(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 Seb 2017-07-11 18:43:43 UTC
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.