Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
85c87f6c
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
85c87f6c
编写于
5月 29, 2022
作者:
J
Joshua Nelson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add bootstrap to tidy check
上级
9cde0f78
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
106 addition
and
4 deletion
+106
-4
src/bootstrap/lib.rs
src/bootstrap/lib.rs
+1
-1
src/tools/tidy/src/deps.rs
src/tools/tidy/src/deps.rs
+105
-3
未找到文件。
src/bootstrap/lib.rs
浏览文件 @
85c87f6c
...
...
@@ -549,7 +549,7 @@ pub fn new(config: Config) -> Build {
];
for
s
in
rust_submodules
{
build
.update_submodule
(
Path
::
new
(
s
));
}
}
build
.verbose
(
"learning about cargo"
);
metadata
::
build
(
&
mut
build
);
...
...
src/tools/tidy/src/deps.rs
浏览文件 @
85c87f6c
...
...
@@ -63,6 +63,10 @@
(
"target-lexicon"
,
"Apache-2.0 WITH LLVM-exception"
),
];
const
EXCEPTIONS_BOOTSTRAP
:
&
[(
&
str
,
&
str
)]
=
&
[
(
"ryu"
,
"Apache-2.0 OR BSL-1.0"
),
// through serde
];
/// These are the root crates that are part of the runtime. The licenses for
/// these and all their dependencies *must not* be in the exception list.
const
RUNTIME_CRATES
:
&
[
&
str
]
=
&
[
"std"
,
"core"
,
"alloc"
,
"test"
,
"panic_abort"
,
"panic_unwind"
];
...
...
@@ -96,7 +100,6 @@
"chalk-ir"
,
"chalk-solve"
,
"chrono"
,
"cmake"
,
"compiler_builtins"
,
"cpufeatures"
,
"crc32fast"
,
...
...
@@ -290,6 +293,82 @@
"winapi-x86_64-pc-windows-gnu"
,
];
const
PERMITTED_BOOTSTRAP_DEPENDENCIES
:
&
[
&
str
]
=
&
[
"aho-corasick"
,
"autocfg"
,
"ansi_term"
,
"block-buffer"
,
"bitflags"
,
"bstr"
,
"core-foundation-sys"
,
"cc"
,
"cfg-if"
,
"crossbeam-utils"
,
"cmake"
,
"cpufeatures"
,
"crossbeam-channel"
,
"crossbeam-deque"
,
"crossbeam-epoch"
,
"crypto-common"
,
"ctor"
,
"diff"
,
"digest"
,
"either"
,
"filetime"
,
"fnv"
,
"getopts"
,
"generic-array"
,
"globset"
,
"hermit-abi"
,
"hex"
,
"ignore"
,
"itoa"
,
"lazy_static"
,
"libc"
,
"log"
,
"lzma-sys"
,
"memchr"
,
"memoffset"
,
"ntapi"
,
"num_cpus"
,
"once_cell"
,
"opener"
,
"output_vt100"
,
"pkg-config"
,
"pretty_assertions"
,
"proc-macro2"
,
"quote"
,
"rayon"
,
"rayon-core"
,
"redox_syscall"
,
"regex"
,
"regex-automata"
,
"regex-syntax"
,
"ryu"
,
"same-file"
,
"scopeguard"
,
"serde"
,
"serde_derive"
,
"serde_json"
,
"sha2"
,
"syn"
,
"sysinfo"
,
"tar"
,
"thread_local"
,
"toml"
,
"typenum"
,
"unicode-ident"
,
"unicode-width"
,
"version_check"
,
"walkdir"
,
"winapi"
,
"winapi-i686-pc-windows-gnu"
,
"winapi-util"
,
"winapi-x86_64-pc-windows-gnu"
,
"xattr"
,
"xz2"
,
];
const
FORBIDDEN_TO_HAVE_DUPLICATES
:
&
[
&
str
]
=
&
[
// These two crates take quite a long time to build, so don't allow two versions of them
// to accidentally sneak into our dependency graph, in order to ensure we keep our CI times
...
...
@@ -309,7 +388,13 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
let
metadata
=
t!
(
cmd
.exec
());
let
runtime_ids
=
compute_runtime_crates
(
&
metadata
);
check_exceptions
(
&
metadata
,
EXCEPTIONS
,
runtime_ids
,
bad
);
check_dependencies
(
&
metadata
,
PERMITTED_DEPENDENCIES
,
RESTRICTED_DEPENDENCY_CRATES
,
bad
);
check_dependencies
(
&
metadata
,
"main workspace"
,
PERMITTED_DEPENDENCIES
,
RESTRICTED_DEPENDENCY_CRATES
,
bad
,
);
check_crate_duplicate
(
&
metadata
,
FORBIDDEN_TO_HAVE_DUPLICATES
,
bad
);
check_rustfix
(
&
metadata
,
bad
);
...
...
@@ -323,11 +408,27 @@ pub fn check(root: &Path, cargo: &Path, bad: &mut bool) {
check_exceptions
(
&
metadata
,
EXCEPTIONS_CRANELIFT
,
runtime_ids
,
bad
);
check_dependencies
(
&
metadata
,
"cranelift"
,
PERMITTED_CRANELIFT_DEPENDENCIES
,
&
[
"rustc_codegen_cranelift"
],
bad
,
);
check_crate_duplicate
(
&
metadata
,
&
[],
bad
);
let
mut
cmd
=
cargo_metadata
::
MetadataCommand
::
new
();
cmd
.cargo_path
(
cargo
)
.manifest_path
(
root
.join
(
"src/bootstrap/Cargo.toml"
))
.features
(
cargo_metadata
::
CargoOpt
::
AllFeatures
);
let
metadata
=
t!
(
cmd
.exec
());
let
runtime_ids
=
HashSet
::
new
();
check_exceptions
(
&
metadata
,
EXCEPTIONS_BOOTSTRAP
,
runtime_ids
,
bad
);
check_dependencies
(
&
metadata
,
"bootstrap"
,
PERMITTED_BOOTSTRAP_DEPENDENCIES
,
&
[
"bootstrap"
],
bad
,
);
}
/// Check that all licenses are in the valid list in `LICENSES`.
...
...
@@ -409,6 +510,7 @@ fn check_exceptions(
/// Specifically, this checks that the dependencies are on the `PERMITTED_DEPENDENCIES`.
fn
check_dependencies
(
metadata
:
&
Metadata
,
descr
:
&
str
,
permitted_dependencies
:
&
[
&
'static
str
],
restricted_dependency_crates
:
&
[
&
'static
str
],
bad
:
&
mut
bool
,
...
...
@@ -438,7 +540,7 @@ fn check_dependencies(
}
if
!
unapproved
.is_empty
()
{
tidy_error!
(
bad
,
"Dependencies
not explicitly permitted:"
);
tidy_error!
(
bad
,
"Dependencies
for {} not explicitly permitted:"
,
descr
);
for
dep
in
unapproved
{
println!
(
"* {dep}"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录