Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
d64a0674
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
d64a0674
编写于
9月 18, 2017
作者:
O
Oliver Schneider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add clippy to `toolstate.toml`
上级
06bb0e01
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
60 addition
and
22 deletion
+60
-22
CONTRIBUTING.md
CONTRIBUTING.md
+2
-14
src/bootstrap/builder.rs
src/bootstrap/builder.rs
+1
-1
src/bootstrap/check.rs
src/bootstrap/check.rs
+44
-0
src/bootstrap/tool.rs
src/bootstrap/tool.rs
+2
-2
src/bootstrap/toolstate.rs
src/bootstrap/toolstate.rs
+1
-0
src/tools/toolstate.toml
src/tools/toolstate.toml
+10
-5
未找到文件。
CONTRIBUTING.md
浏览文件 @
d64a0674
...
...
@@ -330,23 +330,11 @@ it can be found
Currently building Rust will also build the following external projects:
*
[
clippy
](
https://github.com/rust-lang-nursery/rust-clippy
)
*
[
miri
](
https://github.com/solson/miri
)
If your changes break one of these projects, you need to fix them by opening
a pull request against the broken project. When you have opened a pull request,
you can point the submodule at your pull request by calling
```
git fetch origin pull/$id_of_your_pr/head:my_pr
git checkout my_pr
```
within the submodule's directory. Don't forget to also add your changes with
```
git add path/to/submodule
```
outside the submodule.
you can disable the tool via
`src/tools/toolstate.toml`
.
It can also be more convenient during development to set
`submodules = false`
in the
`config.toml`
to prevent
`x.py`
from resetting to the original branch.
...
...
src/bootstrap/builder.rs
浏览文件 @
d64a0674
...
...
@@ -254,7 +254,7 @@ fn get_step_descriptions(kind: Kind) -> Vec<StepDescription> {
Kind
::
Test
=>
describe!
(
check
::
Tidy
,
check
::
Bootstrap
,
check
::
DefaultCompiletest
,
check
::
HostCompiletest
,
check
::
Crate
,
check
::
CrateLibrustc
,
check
::
Rustdoc
,
check
::
Linkcheck
,
check
::
Cargotest
,
check
::
Cargo
,
check
::
Rls
,
check
::
Docs
,
check
::
ErrorIndex
,
check
::
Distcheck
,
check
::
Rustfmt
,
check
::
Miri
),
check
::
ErrorIndex
,
check
::
Distcheck
,
check
::
Rustfmt
,
check
::
Miri
,
check
::
Clippy
),
Kind
::
Bench
=>
describe!
(
check
::
Crate
,
check
::
CrateLibrustc
),
Kind
::
Doc
=>
describe!
(
doc
::
UnstableBook
,
doc
::
UnstableBookGen
,
doc
::
TheBook
,
doc
::
Standalone
,
doc
::
Std
,
doc
::
Test
,
doc
::
Rustc
,
doc
::
ErrorIndex
,
doc
::
Nomicon
,
...
...
src/bootstrap/check.rs
浏览文件 @
d64a0674
...
...
@@ -348,6 +348,50 @@ fn run(self, builder: &Builder) {
}
}
#[derive(Debug,
Copy,
Clone,
PartialEq,
Eq,
Hash)]
pub
struct
Clippy
{
host
:
Interned
<
String
>
,
}
impl
Step
for
Clippy
{
type
Output
=
();
const
ONLY_HOSTS
:
bool
=
true
;
const
DEFAULT
:
bool
=
false
;
fn
should_run
(
run
:
ShouldRun
)
->
ShouldRun
{
run
.path
(
"src/tools/clippy"
)
}
fn
make_run
(
run
:
RunConfig
)
{
run
.builder
.ensure
(
Clippy
{
host
:
run
.target
,
});
}
/// Runs `cargo test` for clippy.
fn
run
(
self
,
builder
:
&
Builder
)
{
let
build
=
builder
.build
;
let
host
=
self
.host
;
let
compiler
=
builder
.compiler
(
1
,
host
);
let
_
clippy
=
builder
.ensure
(
tool
::
Clippy
{
compiler
,
target
:
self
.host
});
let
mut
cargo
=
builder
.cargo
(
compiler
,
Mode
::
Tool
,
host
,
"test"
);
cargo
.arg
(
"--manifest-path"
)
.arg
(
build
.src
.join
(
"src/tools/clippy/Cargo.toml"
));
// Don't build tests dynamically, just a pain to work with
cargo
.env
(
"RUSTC_NO_PREFER_DYNAMIC"
,
"1"
);
// clippy tests need to know about the stage sysroot
cargo
.env
(
"SYSROOT"
,
builder
.sysroot
(
compiler
));
builder
.add_rustc_lib_path
(
compiler
,
&
mut
cargo
);
try_run_expecting
(
build
,
&
mut
cargo
,
builder
.build.config.toolstate.clippy
.passes
(
ToolState
::
Testing
),
);
}
}
fn
path_for_cargo
(
builder
:
&
Builder
,
compiler
:
Compiler
)
->
OsString
{
// Configure PATH to find the right rustc. NB. we have to use PATH
...
...
src/bootstrap/tool.rs
浏览文件 @
d64a0674
...
...
@@ -378,7 +378,7 @@ pub struct Clippy {
impl
Step
for
Clippy
{
type
Output
=
PathBuf
;
const
DEFAULT
:
bool
=
fals
e
;
const
DEFAULT
:
bool
=
tru
e
;
const
ONLY_HOSTS
:
bool
=
true
;
fn
should_run
(
run
:
ShouldRun
)
->
ShouldRun
{
...
...
@@ -405,7 +405,7 @@ fn run(self, builder: &Builder) -> PathBuf {
tool
:
"clippy"
,
mode
:
Mode
::
Librustc
,
path
:
"src/tools/clippy"
,
expectation
:
BuildExpectation
::
None
,
expectation
:
builder
.build.config.toolstate.clippy
.passes
(
ToolState
::
Compiling
)
,
})
}
}
...
...
src/bootstrap/toolstate.rs
浏览文件 @
d64a0674
...
...
@@ -45,4 +45,5 @@ fn default() -> Self {
/// This is created from `toolstate.toml`.
pub
struct
ToolStates
{
pub
miri
:
ToolState
,
pub
clippy
:
ToolState
,
}
src/tools/toolstate.toml
浏览文件 @
d64a0674
...
...
@@ -10,15 +10,20 @@
# configures whether the tool is included in the Rust distribution.
#
# If a tool was working before your PR but is broken now, consider
# updating the tool within your PR. How to do that is described in
# opening a PR against the tool so that it works with your changes.
# If the tool stops compiling, change its state to `Broken`. If it
# still builds, change it to `Compiling`.
# How to do that is described in
# "CONTRIBUTING.md#External Dependencies". If the effort required is not
# warranted (e.g. due to the tool abusing some API that you changed, and
# fixing the tool would mean a significant refactoring), you can disable
# the tool here, by changing its state to `Broken`. Remember to ping
# the tool authors if you do not fix their tool, so they can proactively
# fix it, instead of being surprised by the breakage.
# fixing the tool would mean a significant refactoring) remember to ping
# the tool authors, so they can fix it, instead of being surprised by the
# breakage.
#
# Each tool has a list of people to ping
# ping @oli-obk @RalfJung @eddyb
miri
=
"Testing"
# ping @Manishearth @llogiq @mcarton @oli-obk
clippy
=
"Broken"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录