mirror of
https://github.com/rust-lang/rust
synced 2024-09-18 16:02:39 +00:00
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
This commit is contained in:
parent
2b9076ee19
commit
ed276caeec
35
mk/crates.mk
35
mk/crates.mk
|
@ -118,42 +118,13 @@ ONLY_RLIB_collections := 1
|
||||||
ONLY_RLIB_unicode := 1
|
ONLY_RLIB_unicode := 1
|
||||||
ONLY_RLIB_rustc_bitflags := 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
|
# 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
|
# This macro creates some simple definitions for each crate being built, just
|
||||||
# some munging of all of the parameters above.
|
# some munging of all of the parameters above.
|
||||||
#
|
#
|
||||||
|
|
|
@ -250,7 +250,6 @@ endif
|
||||||
doc/$(1)/:
|
doc/$(1)/:
|
||||||
$$(Q)mkdir -p $$@
|
$$(Q)mkdir -p $$@
|
||||||
|
|
||||||
$(2) += doc/$(1)/index.html
|
|
||||||
doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
|
doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
|
||||||
doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
|
doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
|
||||||
@$$(call E, rustdoc: $$@)
|
@$$(call E, rustdoc: $$@)
|
||||||
|
@ -258,10 +257,13 @@ doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
|
||||||
$$(RUSTDOC) --cfg dox --cfg stage2 $$(RUSTFLAGS_$(1)) $$<
|
$$(RUSTDOC) --cfg dox --cfg stage2 $$(RUSTFLAGS_$(1)) $$<
|
||||||
endef
|
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
|
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
|
endif
|
||||||
|
|
||||||
ifdef CFG_DISABLE_DOCS
|
ifdef CFG_DISABLE_DOCS
|
||||||
|
|
|
@ -22,9 +22,11 @@ $(eval $(call RUST_CRATE,coretest))
|
||||||
DEPS_collectionstest :=
|
DEPS_collectionstest :=
|
||||||
$(eval $(call RUST_CRATE,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_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))
|
$(HOST_CRATES))
|
||||||
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
|
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue