Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
86915ddf
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,发现更多精彩内容 >>
提交
86915ddf
编写于
3月 31, 2018
作者:
M
Mark Simulacrum
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove filetime dep from build_helper
上级
517f2402
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
19 deletion
+8
-19
src/Cargo.lock
src/Cargo.lock
+0
-3
src/bootstrap/compile.rs
src/bootstrap/compile.rs
+1
-1
src/build_helper/Cargo.toml
src/build_helper/Cargo.toml
+0
-3
src/build_helper/lib.rs
src/build_helper/lib.rs
+7
-12
未找到文件。
src/Cargo.lock
浏览文件 @
86915ddf
...
...
@@ -152,9 +152,6 @@ dependencies = [
[[package]]
name = "build_helper"
version = "0.1.0"
dependencies = [
"filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "byteorder"
...
...
src/bootstrap/compile.rs
浏览文件 @
86915ddf
...
...
@@ -1120,7 +1120,7 @@ pub fn run_cargo(build: &Build, cargo: &mut Command, stamp: &Path, is_check: boo
let
max
=
max
.unwrap
();
let
max_path
=
max_path
.unwrap
();
if
stamp_contents
==
new_contents
&&
max
<=
stamp_mtime
{
build
.verbose
(
&
format!
(
"not updating {:?}; contents equal and {
} <= {
}"
,
build
.verbose
(
&
format!
(
"not updating {:?}; contents equal and {
:?} <= {:?
}"
,
stamp
,
max
,
stamp_mtime
));
return
deps
}
...
...
src/build_helper/Cargo.toml
浏览文件 @
86915ddf
...
...
@@ -6,6 +6,3 @@ authors = ["The Rust Project Developers"]
[lib]
name
=
"build_helper"
path
=
"lib.rs"
[dependencies]
filetime
=
"0.1"
src/build_helper/lib.rs
浏览文件 @
86915ddf
...
...
@@ -10,14 +10,11 @@
#![deny(warnings)]
extern
crate
filetime
;
use
std
::
fs
::
File
;
use
std
::
path
::{
Path
,
PathBuf
};
use
std
::
process
::{
Command
,
Stdio
};
use
std
::{
fs
,
env
};
use
filetime
::
FileTime
;
use
std
::
time
::{
SystemTime
,
UNIX_EPOCH
};
/// A helper macro to `unwrap` a result except also print out details like:
///
...
...
@@ -137,10 +134,8 @@ pub fn rerun_if_changed_anything_in_dir(dir: &Path) {
}
/// Returns the last-modified time for `path`, or zero if it doesn't exist.
pub
fn
mtime
(
path
:
&
Path
)
->
FileTime
{
fs
::
metadata
(
path
)
.map
(|
f
|
{
FileTime
::
from_last_modification_time
(
&
f
)
})
.unwrap_or
(
FileTime
::
zero
())
pub
fn
mtime
(
path
:
&
Path
)
->
SystemTime
{
fs
::
metadata
(
path
)
.and_then
(|
f
|
f
.modified
())
.unwrap_or
(
UNIX_EPOCH
)
}
/// Returns whether `dst` is up to date given that the file or files in `src`
...
...
@@ -157,9 +152,9 @@ pub fn up_to_date(src: &Path, dst: &Path) -> bool {
Err
(
e
)
=>
panic!
(
"source {:?} failed to get metadata: {}"
,
src
,
e
),
};
if
meta
.is_dir
()
{
dir_up_to_date
(
src
,
&
threshold
)
dir_up_to_date
(
src
,
threshold
)
}
else
{
FileTime
::
from_last_modification_time
(
&
meta
)
<=
threshold
meta
.modified
()
.unwrap_or
(
UNIX_EPOCH
)
<=
threshold
}
}
...
...
@@ -226,13 +221,13 @@ pub fn sanitizer_lib_boilerplate(sanitizer_name: &str) -> Result<NativeLibBoiler
search_path
)
}
fn
dir_up_to_date
(
src
:
&
Path
,
threshold
:
&
File
Time
)
->
bool
{
fn
dir_up_to_date
(
src
:
&
Path
,
threshold
:
System
Time
)
->
bool
{
t!
(
fs
::
read_dir
(
src
))
.map
(|
e
|
t!
(
e
))
.all
(|
e
|
{
let
meta
=
t!
(
e
.metadata
());
if
meta
.is_dir
()
{
dir_up_to_date
(
&
e
.path
(),
threshold
)
}
else
{
FileTime
::
from_last_modification_time
(
&
meta
)
<
*
threshold
meta
.modified
()
.unwrap_or
(
UNIX_EPOCH
)
<
threshold
}
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录