Skip to content

Commit 346c279

Browse files
committed
test
1 parent cafbc12 commit 346c279

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/cargo/core/compiler/fingerprint/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ struct DepFingerprint {
543543
/// recompiled. Inputs to the fingerprint include source code modifications,
544544
/// compiler flags, compiler version, etc. This structure is not simply a
545545
/// `String` due to the fact that some fingerprints cannot be calculated lazily.
546-
///
546+
/// 如果指纹发生变化,则需要重新编译包本身;指纹的输入包括:代码修改、编译器标志、编译器版本;
547+
///
547548
/// Path sources, for example, use the mtime of the corresponding dep-info file
548549
/// as a fingerprint (all source files must be modified *before* this mtime).
549550
/// This dep-info file is not generated, however, until after the crate is
@@ -557,6 +558,8 @@ struct DepFingerprint {
557558
/// `DependencyQueue`, but it also needs to be retained here because Cargo can
558559
/// be interrupted while executing, losing the state of the `DependencyQueue`
559560
/// graph.
561+
/// 上游包重新编译的时候,所有下游依赖项也会重新编译。
562+
/// 通过DependencyQueue进行跟踪,但也需要保留在这里,因为 Cargo 在执行时可能会被中断,从而丢失“DependencyQueue”图的状态。
560563
#[derive(Serialize, Deserialize)]
561564
pub struct Fingerprint {
562565
/// Hash of the version of `rustc` used.

src/cargo/core/compiler/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,13 @@ impl Executor for DefaultExecutor {
154154
/// Starting from the `unit`, this function recursively calls itself to build
155155
/// all jobs for dependencies of the `unit`. Each of these jobs represents
156156
/// compiling a particular package.
157+
/// 从“unit”开始, 该函数递归调用自身来构建“unit”依赖项的所有作业。
158+
/// 这些作业中的每一个都代表编译一个特定的包。
157159
///
158160
/// Note that **no actual work is executed as part of this**, that's all done
159161
/// next as part of [`JobQueue::execute`] function which will run everything
160162
/// in order with proper parallelism.
163+
/// 在这个过程中,没有执行任何实际工作,属于[`JobQueue::execute`]的一部分,之后再以并行的方式进行;
161164
fn compile<'gctx>(
162165
build_runner: &mut BuildRunner<'_, 'gctx>,
163166
jobs: &mut JobQueue<'gctx>,

0 commit comments

Comments
 (0)