Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
62f73dc8
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
62f73dc8
编写于
7月 26, 2018
作者:
T
Tatsuyuki Ishi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor is_external_tool into source_type
上级
a89f8e13
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
22 deletion
+32
-22
src/bootstrap/check.rs
src/bootstrap/check.rs
+2
-2
src/bootstrap/doc.rs
src/bootstrap/doc.rs
+2
-2
src/bootstrap/test.rs
src/bootstrap/test.rs
+7
-7
src/bootstrap/tool.rs
src/bootstrap/tool.rs
+21
-11
未找到文件。
src/bootstrap/check.rs
浏览文件 @
62f73dc8
...
...
@@ -12,7 +12,7 @@
use
compile
::{
run_cargo
,
std_cargo
,
test_cargo
,
rustc_cargo
,
rustc_cargo_env
,
add_to_sysroot
};
use
builder
::{
RunConfig
,
Builder
,
ShouldRun
,
Step
};
use
tool
::{
self
,
prepare_tool_cargo
};
use
tool
::{
self
,
prepare_tool_cargo
,
SourceType
};
use
{
Compiler
,
Mode
};
use
cache
::{
INTERNER
,
Interned
};
use
std
::
path
::
PathBuf
;
...
...
@@ -223,7 +223,7 @@ fn run(self, builder: &Builder) {
target
,
"check"
,
"src/tools/rustdoc"
,
fals
e
);
SourceType
::
InTre
e
);
let
_
folder
=
builder
.fold_output
(||
format!
(
"stage{}-rustdoc"
,
compiler
.stage
));
println!
(
"Checking rustdoc artifacts ({} -> {})"
,
&
compiler
.host
,
target
);
...
...
src/bootstrap/doc.rs
浏览文件 @
62f73dc8
...
...
@@ -28,7 +28,7 @@
use
util
::
symlink_dir
;
use
builder
::{
Builder
,
Compiler
,
RunConfig
,
ShouldRun
,
Step
};
use
tool
::{
self
,
prepare_tool_cargo
,
Tool
};
use
tool
::{
self
,
prepare_tool_cargo
,
Tool
,
SourceType
};
use
compile
;
use
cache
::{
INTERNER
,
Interned
};
use
config
::
Config
;
...
...
@@ -814,7 +814,7 @@ fn run(self, builder: &Builder) {
target
,
"doc"
,
"src/tools/rustdoc"
,
false
SourceType
::
InTree
,
);
cargo
.env
(
"RUSTDOCFLAGS"
,
"--document-private-items"
);
...
...
src/bootstrap/test.rs
浏览文件 @
62f73dc8
...
...
@@ -30,7 +30,7 @@
use
dist
;
use
flags
::
Subcommand
;
use
native
;
use
tool
::{
self
,
Tool
};
use
tool
::{
self
,
Tool
,
SourceType
};
use
toolstate
::
ToolState
;
use
util
::{
self
,
dylib_path
,
dylib_path_var
};
use
Crate
as
CargoCrate
;
...
...
@@ -228,7 +228,7 @@ fn run(self, builder: &Builder) {
self
.host
,
"test"
,
"src/tools/cargo"
,
tru
e
);
SourceType
::
Submodul
e
);
if
!
builder
.fail_fast
{
cargo
.arg
(
"--no-fail-fast"
);
...
...
@@ -288,7 +288,7 @@ fn run(self, builder: &Builder) {
host
,
"test"
,
"src/tools/rls"
,
tru
e
);
SourceType
::
Submodul
e
);
builder
.add_rustc_lib_path
(
compiler
,
&
mut
cargo
);
...
...
@@ -341,7 +341,7 @@ fn run(self, builder: &Builder) {
host
,
"test"
,
"src/tools/rustfmt"
,
tru
e
);
SourceType
::
Submodul
e
);
let
dir
=
testdir
(
builder
,
compiler
.host
);
t!
(
fs
::
create_dir_all
(
&
dir
));
...
...
@@ -396,7 +396,7 @@ fn run(self, builder: &Builder) {
host
,
"test"
,
"src/tools/miri"
,
tru
e
);
SourceType
::
Submodul
e
);
// miri tests need to know about the stage sysroot
cargo
.env
(
"MIRI_SYSROOT"
,
builder
.sysroot
(
compiler
));
...
...
@@ -455,7 +455,7 @@ fn run(self, builder: &Builder) {
host
,
"test"
,
"src/tools/clippy"
,
tru
e
);
SourceType
::
Submodul
e
);
// clippy tests need to know about the stage sysroot
cargo
.env
(
"SYSROOT"
,
builder
.sysroot
(
compiler
));
...
...
@@ -1740,7 +1740,7 @@ fn run(self, builder: &Builder) {
target
,
test_kind
.subcommand
(),
"src/tools/rustdoc"
,
fals
e
);
SourceType
::
InTre
e
);
if
test_kind
.subcommand
()
==
"test"
&&
!
builder
.fail_fast
{
cargo
.arg
(
"--no-fail-fast"
);
}
...
...
src/bootstrap/tool.rs
浏览文件 @
62f73dc8
...
...
@@ -75,6 +75,12 @@ fn run(self, builder: &Builder) {
}
}
#[derive(Debug,
Clone,
Hash,
PartialEq,
Eq)]
pub
enum
SourceType
{
InTree
,
Submodule
,
}
#[derive(Debug,
Clone,
Hash,
PartialEq,
Eq)]
struct
ToolBuild
{
compiler
:
Compiler
,
...
...
@@ -83,7 +89,7 @@ struct ToolBuild {
path
:
&
'static
str
,
mode
:
Mode
,
is_optional_tool
:
bool
,
is_external_tool
:
bool
,
source_type
:
SourceType
,
extra_features
:
Vec
<
String
>
,
}
...
...
@@ -123,7 +129,7 @@ fn run(self, builder: &Builder) -> Option<PathBuf> {
target
,
"build"
,
path
,
self
.
is_external_tool
,
self
.
source_type
,
);
cargo
.arg
(
"--features"
)
.arg
(
self
.extra_features
.join
(
" "
));
...
...
@@ -247,7 +253,7 @@ pub fn prepare_tool_cargo(
target
:
Interned
<
String
>
,
command
:
&
'static
str
,
path
:
&
'static
str
,
is_external_tool
:
bool
,
source_type
:
SourceType
,
)
->
Command
{
let
mut
cargo
=
builder
.cargo
(
compiler
,
mode
,
target
,
command
);
let
dir
=
builder
.src
.join
(
path
);
...
...
@@ -257,7 +263,7 @@ pub fn prepare_tool_cargo(
// stages and such and it's just easier if they're not dynamically linked.
cargo
.env
(
"RUSTC_NO_PREFER_DYNAMIC"
,
"1"
);
if
is_external_tool
{
if
source_type
==
SourceType
::
Submodule
{
cargo
.env
(
"RUSTC_EXTERNAL_TOOL"
,
"1"
);
}
...
...
@@ -289,7 +295,7 @@ pub fn prepare_tool_cargo(
macro_rules!
tool
{
(
$
(
$name:ident
,
$path:expr
,
$tool_name:expr
,
$mode:expr
$
(,
llvm_tools
=
$llvm:expr
)
*
$
(,
external_tool
=
$external:expr
)
*
;)
+
)
=>
{
$
(,
llvm_tools
=
$llvm:expr
)
*
$
(,
is_
external_tool
=
$external:expr
)
*
;)
+
)
=>
{
#[derive(Copy,
PartialEq,
Eq,
Clone)]
pub
enum
Tool
{
$
(
...
...
@@ -367,7 +373,11 @@ fn run(self, builder: &Builder) -> PathBuf {
mode
:
$mode
,
path
:
$path
,
is_optional_tool
:
false
,
is_external_tool
:
false
$
(||
$external
)
*
,
source_type
:
if
false
$
(||
$external
)
*
{
SourceType
::
Submodule
}
else
{
SourceType
::
InTree
},
extra_features
:
Vec
::
new
(),
})
.expect
(
"expected to build -- essential tool"
)
}
...
...
@@ -387,7 +397,7 @@ fn run(self, builder: &Builder) -> PathBuf {
BuildManifest
,
"src/tools/build-manifest"
,
"build-manifest"
,
Mode
::
ToolBootstrap
;
RemoteTestClient
,
"src/tools/remote-test-client"
,
"remote-test-client"
,
Mode
::
ToolBootstrap
;
RustInstaller
,
"src/tools/rust-installer"
,
"fabricate"
,
Mode
::
ToolBootstrap
,
external_tool
=
true
;
is_
external_tool
=
true
;
RustdocTheme
,
"src/tools/rustdoc-themes"
,
"rustdoc-themes"
,
Mode
::
ToolBootstrap
;
);
...
...
@@ -419,7 +429,7 @@ fn run(self, builder: &Builder) -> PathBuf {
mode
:
Mode
::
ToolStd
,
path
:
"src/tools/remote-test-server"
,
is_optional_tool
:
false
,
is_external_tool
:
fals
e
,
source_type
:
SourceType
::
InTre
e
,
extra_features
:
Vec
::
new
(),
})
.expect
(
"expected to build -- essential tool"
)
}
...
...
@@ -474,7 +484,7 @@ fn run(self, builder: &Builder) -> PathBuf {
target
,
"build"
,
"src/tools/rustdoc"
,
fals
e
,
SourceType
::
InTre
e
,
);
// Most tools don't get debuginfo, but rustdoc should.
...
...
@@ -547,7 +557,7 @@ fn run(self, builder: &Builder) -> PathBuf {
mode
:
Mode
::
ToolRustc
,
path
:
"src/tools/cargo"
,
is_optional_tool
:
false
,
is_external_tool
:
tru
e
,
source_type
:
SourceType
::
Submodul
e
,
extra_features
:
Vec
::
new
(),
})
.expect
(
"expected to build -- essential tool"
)
}
...
...
@@ -597,7 +607,7 @@ fn run(mut $sel, $builder: &Builder) -> Option<PathBuf> {
path
:
$path
,
extra_features
:
$sel
.extra_features
,
is_optional_tool
:
true
,
is_external_tool
:
tru
e
,
source_type
:
SourceType
::
Submodul
e
,
})
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录