Skip to content

Commit 3db193e

Browse files
committed
Only force rebuild of top-level units, not of unit dependencies
1 parent b98ba8e commit 3db193e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
157157
// part of this, that's all done next as part of the `execute`
158158
// function which will run everything in order with proper
159159
// parallelism.
160-
super::compile(&mut self, &mut queue, &mut plan, unit, exec)?;
160+
let force_rebuild = self.bcx.build_config.force_rebuild;
161+
super::compile(&mut self, &mut queue, &mut plan, unit, exec, force_rebuild)?;
161162
}
162163

163164
// Now that we've figured out everything that we're going to do, do it!

src/cargo/core/compiler/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ fn compile<'a, 'cfg: 'a>(
129129
plan: &mut BuildPlan,
130130
unit: &Unit<'a>,
131131
exec: &Arc<Executor>,
132+
force_rebuild: bool,
132133
) -> CargoResult<()> {
133134
let bcx = cx.bcx;
134135
let build_plan = bcx.build_config.build_plan;
135-
let force_rebuild = bcx.build_config.force_rebuild;
136136
if !cx.compiled.insert(*unit) {
137137
return Ok(());
138138
}
@@ -176,7 +176,7 @@ fn compile<'a, 'cfg: 'a>(
176176

177177
// Be sure to compile all dependencies of this target as well.
178178
for unit in cx.dep_targets(unit).iter() {
179-
compile(cx, jobs, plan, unit, exec)?;
179+
compile(cx, jobs, plan, unit, exec, false)?;
180180
}
181181
if build_plan {
182182
plan.add(cx, unit)?;

0 commit comments

Comments
 (0)