diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-06-09 13:00:18 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-09 13:00:18 -0700 |
| commit | 992a2db1fc64987c0c68c66e74bff81468b6f7b8 (patch) | |
| tree | 4a471792974d319a74a731a4f4f4d2dbaa1bec5a | |
| parent | e55f64f99726a44283211d91a702081fe4a1855b (diff) | |
| download | rust-992a2db1fc64987c0c68c66e74bff81468b6f7b8.tar.gz rust-992a2db1fc64987c0c68c66e74bff81468b6f7b8.zip | |
mk: Ensure docs have relative links to each other
When generating documentation, rustdoc has the ability to generate relative links within the current distribution of crates to one another. To do this, it must recognize when a crate's documentation is in the same output directory. The current threshold for "local documentation for crate X being available" is whether the directory "doc/X" exists. This change modifies the build system to have new dependencies for each directory of upstream crates for a rustdoc invocation. This will ensure that when building documentation that all the crates in the standard distribution are guaranteed to have relative links to one another. This change is prompted by guaranteeing that offline docs always work with one another. Before this change, races could mean that some docs were built before others, and hence may have http links when relative links would suffice. Closes #14747
| -rw-r--r-- | mk/docs.mk | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mk/docs.mk b/mk/docs.mk index dab40cb1654..575ecec9d92 100644 --- a/mk/docs.mk +++ b/mk/docs.mk @@ -273,14 +273,18 @@ LIB_DOC_DEP_$(1) = \ $$(RSINPUTS_$(1)) \ $$(RUSTDOC_EXE) \ $$(foreach dep,$$(RUST_DEPS_$(1)), \ - $$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep)) + $$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep) \ + doc/$$(dep)/) else LIB_DOC_DEP_$(1) = $$(CRATEFILE_$(1)) $$(RSINPUTS_$(1)) endif +doc/$(1)/: + $$(Q)mkdir -p $$@ + $(2) += doc/$(1)/index.html doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET) -doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) +doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/ @$$(call E, rustdoc $$@) $$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$< endef |
