Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
c768ce13
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,发现更多精彩内容 >>
未验证
提交
c768ce13
编写于
11月 26, 2020
作者:
P
Pietro Albini
2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bootstrap: convert rust-docs to use Tarball
上级
7be85701
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
41 deletion
+23
-41
src/bootstrap/dist.rs
src/bootstrap/dist.rs
+11
-34
src/bootstrap/tarball.rs
src/bootstrap/tarball.rs
+12
-7
未找到文件。
src/bootstrap/dist.rs
浏览文件 @
c768ce13
...
...
@@ -55,7 +55,7 @@ pub struct Docs {
}
impl
Step
for
Docs
{
type
Output
=
PathBuf
;
type
Output
=
Option
<
PathBuf
>
;
const
DEFAULT
:
bool
=
true
;
fn
should_run
(
run
:
ShouldRun
<
'_
>
)
->
ShouldRun
<
'_
>
{
...
...
@@ -67,13 +67,10 @@ fn make_run(run: RunConfig<'_>) {
}
/// Builds the `rust-docs` installer component.
fn
run
(
self
,
builder
:
&
Builder
<
'_
>
)
->
PathBuf
{
fn
run
(
self
,
builder
:
&
Builder
<
'_
>
)
->
Option
<
PathBuf
>
{
let
host
=
self
.host
;
let
name
=
pkgname
(
builder
,
"rust-docs"
);
if
!
builder
.config.docs
{
return
distdir
(
builder
)
.join
(
format!
(
"{}-{}.tar.gz"
,
name
,
host
.triple
))
;
return
None
;
}
builder
.default_doc
(
None
);
...
...
@@ -81,34 +78,14 @@ fn run(self, builder: &Builder<'_>) -> PathBuf {
builder
.info
(
&
format!
(
"Dist docs ({})"
,
host
));
let
_
time
=
timeit
(
builder
);
let
image
=
tmpdir
(
builder
)
.join
(
format!
(
"{}-{}-image"
,
name
,
host
.triple
));
let
_
=
fs
::
remove_dir_all
(
&
image
);
let
dest
=
"share/doc/rust/html"
;
let
dst
=
image
.join
(
"share/doc/rust/html"
);
t!
(
fs
::
create_dir_all
(
&
dst
));
let
src
=
builder
.doc_out
(
host
);
builder
.cp_r
(
&
src
,
&
dst
);
builder
.install
(
&
builder
.src
.join
(
"src/doc/robots.txt"
),
&
dst
,
0o644
);
let
mut
cmd
=
rust_installer
(
builder
);
cmd
.arg
(
"generate"
)
.arg
(
"--product-name=Rust-Documentation"
)
.arg
(
"--rel-manifest-dir=rustlib"
)
.arg
(
"--success-message=Rust-documentation-is-installed."
)
.arg
(
"--image-dir"
)
.arg
(
&
image
)
.arg
(
"--work-dir"
)
.arg
(
&
tmpdir
(
builder
))
.arg
(
"--output-dir"
)
.arg
(
&
distdir
(
builder
))
.arg
(
format!
(
"--package-name={}-{}"
,
name
,
host
.triple
))
.arg
(
"--component-name=rust-docs"
)
.arg
(
"--legacy-manifest-dirs=rustlib,cargo"
)
.arg
(
"--bulk-dirs=share/doc/rust/html"
);
builder
.run
(
&
mut
cmd
);
builder
.remove_dir
(
&
image
);
let
mut
tarball
=
Tarball
::
new
(
builder
,
"rust-docs"
,
&
host
.triple
);
tarball
.set_product_name
(
"Rust Documentation"
);
tarball
.add_dir
(
&
builder
.doc_out
(
host
),
dest
);
tarball
.add_file
(
&
builder
.src
.join
(
"src/doc/robots.txt"
),
dest
,
0o644
);
distdir
(
builder
)
.join
(
format!
(
"{}-{}.tar.gz"
,
name
,
host
.triple
))
Some
(
tarball
.generate
(
))
}
}
...
...
@@ -1826,7 +1803,7 @@ fn run(self, builder: &Builder<'_>) {
tarballs
.extend
(
llvm_tools_installer
);
tarballs
.push
(
analysis_installer
);
tarballs
.push
(
std_installer
);
if
builder
.config.docs
{
if
let
Some
(
docs_installer
)
=
docs_installer
{
tarballs
.push
(
docs_installer
);
}
if
target
.contains
(
"pc-windows-gnu"
)
{
...
...
@@ -2509,7 +2486,7 @@ fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {
// Copy the include directory as well; needed mostly to build
// librustc_llvm properly (e.g., llvm-config.h is in here). But also
// just broadly useful to be able to link against the bundled LLVM.
tarball
.add_dir
(
&
builder
.llvm_out
(
target
)
.join
(
"include"
),
"
.
"
);
tarball
.add_dir
(
&
builder
.llvm_out
(
target
)
.join
(
"include"
),
"
include
"
);
// Copy libLLVM.so to the target lib dir as well, so the RPATH like
// `$ORIGIN/../lib` can find it. It may also be used as a dependency
...
...
src/bootstrap/tarball.rs
浏览文件 @
c768ce13
...
...
@@ -27,6 +27,7 @@ pub(crate) struct Tarball<'a> {
pkgname
:
String
,
component
:
String
,
target
:
String
,
product_name
:
String
,
overlay
:
OverlayKind
,
temp_dir
:
PathBuf
,
...
...
@@ -54,6 +55,7 @@ pub(crate) fn new(builder: &'a Builder<'a>, component: &str, target: &str) -> Se
pkgname
,
component
:
component
.into
(),
target
:
target
.into
(),
product_name
:
"Rust"
.into
(),
overlay
:
OverlayKind
::
Rust
,
temp_dir
,
...
...
@@ -69,6 +71,10 @@ pub(crate) fn set_overlay(&mut self, overlay: OverlayKind) {
self
.overlay
=
overlay
;
}
pub
(
crate
)
fn
set_product_name
(
&
mut
self
,
name
:
&
str
)
{
self
.product_name
=
name
.into
();
}
pub
(
crate
)
fn
is_preview
(
&
mut
self
,
is
:
bool
)
{
self
.is_preview
=
is
;
}
...
...
@@ -91,12 +97,11 @@ pub(crate) fn add_file(&self, src: impl AsRef<Path>, destdir: impl AsRef<Path>,
self
.builder
.install
(
src
.as_ref
(),
&
destdir
,
perms
);
}
pub
(
crate
)
fn
add_dir
(
&
self
,
src
:
impl
AsRef
<
Path
>
,
destdir
:
impl
AsRef
<
Path
>
)
{
t!
(
std
::
fs
::
create_dir_all
(
destdir
.as_ref
()));
self
.builder
.cp_r
(
src
.as_ref
(),
&
self
.image_dir
.join
(
destdir
.as_ref
())
.join
(
src
.as_ref
()
.file_name
()
.unwrap
()),
);
pub
(
crate
)
fn
add_dir
(
&
self
,
src
:
impl
AsRef
<
Path
>
,
dest
:
impl
AsRef
<
Path
>
)
{
let
dest
=
self
.image_dir
.join
(
dest
.as_ref
());
t!
(
std
::
fs
::
create_dir_all
(
&
dest
));
self
.builder
.cp_r
(
src
.as_ref
(),
&
dest
);
}
pub
(
crate
)
fn
generate
(
self
)
->
PathBuf
{
...
...
@@ -114,7 +119,7 @@ pub(crate) fn generate(self) -> PathBuf {
let
distdir
=
crate
::
dist
::
distdir
(
self
.builder
);
let
mut
cmd
=
self
.builder
.tool_cmd
(
crate
::
tool
::
Tool
::
RustInstaller
);
cmd
.arg
(
"generate"
)
.arg
(
"--product-name=Rust"
)
.arg
(
format!
(
"--product-name={}"
,
self
.product_name
)
)
.arg
(
"--rel-manifest-dir=rustlib"
)
.arg
(
format!
(
"--success-message={} installed."
,
self
.component
))
.arg
(
"--image-dir"
)
...
...
yitter
@yitter
mentioned in commit
6dfd700c
·
4月 23, 2021
mentioned in commit
6dfd700c
mentioned in commit 6dfd700c595a8853fd58349c38c4768b922a2e85
开关提交列表
yitter
@yitter
mentioned in commit
88b99dec
·
4月 23, 2021
mentioned in commit
88b99dec
mentioned in commit 88b99dec2a4d103b8153ca9300bf0fbebdf65bda
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录