Skip to content

Commit 94a806c

Browse files
committed
explicitly close the tmp file before renaming
run CI tests on installer crate too
1 parent 636682e commit 94a806c

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

.github/workflows/run-dev-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
branches: [main]
66
paths:
77
- cpp-linter/**
8+
- clang-installer/**
89
- Cargo.toml
910
- Cargo.lock
1011
- .github/workflows/run-dev-tests.yml
1112
pull_request:
1213
branches: [main]
1314
paths:
1415
- cpp-linter/**
16+
- clang-installer/**
1517
- Cargo.toml
1618
- Cargo.lock
1719
- .github/workflows/run-dev-tests.yml

clang-installer/src/downloader/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ async fn download(url: &Url, cache_path: &Path, timeout: u64) -> Result<(), Down
8888
progress_bar.finish()?;
8989
tmp_file.flush()?;
9090
tmp_file.set_modified(SystemTime::now())?;
91+
drop(tmp_file); // ensure the file is closed before renaming
9192
fs::rename(tmp_file_path, cache_path)
9293
.map_err(|e| DownloadError::TempFile("renaming temporary file after download", e))?;
9394
Ok(())

0 commit comments

Comments
 (0)