2017-02-15 08:53:18 -08:00
|
|
|
-include ../tools.mk
|
|
|
|
|
2017-04-25 18:34:21 +08:00
|
|
|
# This is a whitelist of files which are stable crates or simply are not crates,
|
|
|
|
# we don't check for the instability of these crates as they're all stable!
|
2017-02-15 08:53:18 -08:00
|
|
|
STABLE_CRATES := \
|
|
|
|
std \
|
|
|
|
core \
|
|
|
|
proc_macro \
|
|
|
|
rsbegin.o \
|
|
|
|
rsend.o \
|
|
|
|
dllcrt2.o \
|
2017-04-25 18:34:21 +08:00
|
|
|
crt2.o \
|
|
|
|
clang_rt.%_dynamic.dylib
|
2017-02-15 08:53:18 -08:00
|
|
|
|
|
|
|
# Generate a list of all crates in the sysroot. To do this we list all files in
|
|
|
|
# rustc's sysroot, look at the filename, strip everything after the `-`, and
|
|
|
|
# strip the leading `lib` (if present)
|
|
|
|
SYSROOT := $(shell $(RUSTC) --print sysroot)
|
|
|
|
LIBS := $(wildcard $(SYSROOT)/lib/rustlib/$(TARGET)/lib/*)
|
|
|
|
LIBS := $(foreach lib,$(LIBS),$(notdir $(lib)))
|
|
|
|
LIBS := $(foreach lib,$(LIBS),$(word 1,$(subst -, ,$(lib))))
|
|
|
|
LIBS := $(foreach lib,$(LIBS),$(patsubst lib%,%,$(lib)))
|
|
|
|
LIBS := $(filter-out $(STABLE_CRATES),$(LIBS))
|
|
|
|
|
|
|
|
all: $(foreach lib,$(LIBS),check-crate-$(lib)-is-unstable)
|
|
|
|
|
|
|
|
check-crate-%-is-unstable:
|
|
|
|
@echo verifying $* is an unstable crate
|
|
|
|
@echo 'extern crate $*;' | \
|
|
|
|
$(RUSTC) - --crate-type rlib 2>&1 | cat > $(TMPDIR)/$*; \
|
|
|
|
true
|
|
|
|
@grep -q 'use of unstable library feature' $(TMPDIR)/$* || \
|
|
|
|
(echo crate $* is not unstable && \
|
|
|
|
cat $(TMPDIR)/$* && \
|
|
|
|
false)
|