Skip to content

Commit bb2a6a3

Browse files
committed
rename checkout to install_dir
1 parent d8d96b6 commit bb2a6a3

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

crates/cargo-gpu/src/install.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ package = "rustc_codegen_spirv"
200200
self.spirv_builder_version.as_deref(),
201201
)?;
202202
let source_is_path = matches!(source, SpirvSource::Path { .. });
203-
let checkout = source.install_dir()?;
203+
let install_dir = source.install_dir()?;
204204

205205
let dylib_filename = format!(
206206
"{}rustc_codegen_spirv{}",
@@ -210,16 +210,16 @@ package = "rustc_codegen_spirv"
210210

211211
let dest_dylib_path;
212212
if source_is_path {
213-
dest_dylib_path = checkout
213+
dest_dylib_path = install_dir
214214
.join("target")
215215
.join("release")
216216
.join(&dylib_filename);
217217
} else {
218-
dest_dylib_path = checkout.join(&dylib_filename);
218+
dest_dylib_path = install_dir.join(&dylib_filename);
219219
if dest_dylib_path.is_file() {
220220
log::info!(
221221
"cargo-gpu artifacts are already installed in '{}'",
222-
checkout.display()
222+
install_dir.display()
223223
);
224224
}
225225
}
@@ -228,12 +228,12 @@ package = "rustc_codegen_spirv"
228228
if skip_rebuild {
229229
log::info!("...and so we are aborting the install step.");
230230
} else {
231-
Self::write_source_files(&source, &checkout).context("writing source files")?;
231+
Self::write_source_files(&source, &install_dir).context("writing source files")?;
232232
}
233233

234234
// TODO cache toolchain channel in a file?
235235
log::debug!("resolving toolchain version to use");
236-
let rustc_codegen_spirv = get_package_from_crate(&checkout, "rustc_codegen_spirv")
236+
let rustc_codegen_spirv = get_package_from_crate(&install_dir, "rustc_codegen_spirv")
237237
.context("get `rustc_codegen_spirv` metadata")?;
238238
let toolchain_channel =
239239
get_channel_from_rustc_codegen_spirv_build_script(&rustc_codegen_spirv)
@@ -251,13 +251,14 @@ package = "rustc_codegen_spirv"
251251
// to prevent unsupported version errors when using older toolchains
252252
if !source_is_path {
253253
log::debug!("remove Cargo.lock");
254-
std::fs::remove_file(checkout.join("Cargo.lock")).context("remove Cargo.lock")?;
254+
std::fs::remove_file(install_dir.join("Cargo.lock"))
255+
.context("remove Cargo.lock")?;
255256
}
256257

257258
crate::user_output!("Compiling `rustc_codegen_spirv` from source {}\n", source,);
258259
let mut build_command = std::process::Command::new("cargo");
259260
build_command
260-
.current_dir(&checkout)
261+
.current_dir(&install_dir)
261262
.arg(format!("+{toolchain_channel}"))
262263
.args(["build", "--release"])
263264
.env_remove("RUSTC");
@@ -281,7 +282,7 @@ package = "rustc_codegen_spirv"
281282
})
282283
.context("running build command")?;
283284

284-
let target = checkout.join("target");
285+
let target = install_dir.join("target");
285286
let dylib_path = target.join("release").join(&dylib_filename);
286287
if dylib_path.is_file() {
287288
log::info!("successfully built {}", dylib_path.display());

0 commit comments

Comments
 (0)