From ed276caeec64033f38a18dbe796dc78ce3c57c6a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 7 Apr 2015 15:11:16 -0700 Subject: [PATCH] mk: Stop documenating non-facade crates This commit ceases documentation-by-default of crates such as `term`, `serialize`, and `alloc`. Crates like `term` and `rand` have duplicates on `crates.io` and the search index entries generated in the local tree end up only leading to confusion. Crates like the entire compiler infrastructure, `flate`, or `rbml` don't need to be documented in such a prominent location. This change also means that doc tests will no longer be run for crates beyond the facade (e.g. `serialize` or `term`), but there were very few doc tests in there to begin with. Closes #22168 --- mk/crates.mk | 35 +++-------------------------------- mk/docs.mk | 8 +++++--- mk/tests.mk | 6 ++++-- 3 files changed, 12 insertions(+), 37 deletions(-) diff --git a/mk/crates.mk b/mk/crates.mk index f594a6a19f1..666d95b6d65 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -118,42 +118,13 @@ ONLY_RLIB_collections := 1 ONLY_RLIB_unicode := 1 ONLY_RLIB_rustc_bitflags := 1 +# Documented-by-default crates +DOC_CRATES := std alloc collections core libc unicode + ################################################################################ # You should not need to edit below this line ################################################################################ -# On channels where the only usable crate is std, only build documentation for -# std. This keeps distributions small and doesn't clutter up the API docs with -# confusing internal details from the crates behind the facade. -# -# (Disabled while cmr figures out how to change rustdoc to make reexports work -# slightly nicer. Otherwise, all cross-crate links to Vec will go to -# libcollections, breaking them, and [src] links for anything reexported will -# not work.) - -#ifeq ($(CFG_RELEASE_CHANNEL),stable) -#DOC_CRATES := std -#else -#ifeq ($(CFG_RELEASE_CHANNEL),beta) -#DOC_CRATES := std -#else -DOC_CRATES := $(filter-out rustc, \ - $(filter-out rustc_trans, \ - $(filter-out rustc_typeck, \ - $(filter-out rustc_borrowck, \ - $(filter-out rustc_resolve, \ - $(filter-out rustc_driver, \ - $(filter-out rustc_privacy, \ - $(filter-out rustc_lint, \ - $(filter-out log, \ - $(filter-out getopts, \ - $(filter-out syntax, $(CRATES)))))))))))) -#endif -#endif -COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \ - rustc_typeck rustc_driver syntax rustc_privacy \ - rustc_lint - # This macro creates some simple definitions for each crate being built, just # some munging of all of the parameters above. # diff --git a/mk/docs.mk b/mk/docs.mk index fae1ddd9bff..d179d337faa 100644 --- a/mk/docs.mk +++ b/mk/docs.mk @@ -250,7 +250,6 @@ 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)/ @$$(call E, rustdoc: $$@) @@ -258,10 +257,13 @@ doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/ $$(RUSTDOC) --cfg dox --cfg stage2 $$(RUSTFLAGS_$(1)) $$< endef -$(foreach crate,$(DOC_CRATES),$(eval $(call DEF_LIB_DOC,$(crate),DOC_TARGETS))) +$(foreach crate,$(CRATES),$(eval $(call DEF_LIB_DOC,$(crate)))) +COMPILER_DOC_TARGETS := $(CRATES:%=doc/%/index.html) ifdef CFG_COMPILER_DOCS - $(foreach crate,$(COMPILER_DOC_CRATES),$(eval $(call DEF_LIB_DOC,$(crate),COMPILER_DOC_TARGETS))) + DOC_TARGETS += $(COMPILER_DOC_TARGETS) +else + DOC_TARGETS += $(DOC_CRATES:%=doc/%/index.html) endif ifdef CFG_DISABLE_DOCS diff --git a/mk/tests.mk b/mk/tests.mk index bf30b7e50cd..a540d2bace4 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -22,9 +22,11 @@ $(eval $(call RUST_CRATE,coretest)) DEPS_collectionstest := $(eval $(call RUST_CRATE,collectionstest)) -TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) collectionstest coretest +TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) \ + collectionstest coretest TEST_DOC_CRATES = $(DOC_CRATES) -TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve rustc_trans rustc_lint,\ +TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \ + rustc_trans rustc_lint,\ $(HOST_CRATES)) TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)