Skip to content

Commit 80f811d

Browse files
committed
fix PR
1 parent 521111c commit 80f811d

File tree

4 files changed

+101
-117
lines changed

4 files changed

+101
-117
lines changed

crates/rattler/src/install/driver.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::clobber_registry::ClobberRegistry;
2-
use super::unlink::recursively_remove_empty_directories;
2+
use super::unlink::{recursively_remove_empty_directories, UnlinkError};
33
use super::{InstallError, Transaction};
44
use futures::stream::FuturesUnordered;
55
use futures::{FutureExt, StreamExt};
@@ -166,7 +166,10 @@ impl InstallDriver {
166166
let required_packages =
167167
PackageRecord::sort_topologically(prefix_records.iter().collect::<Vec<_>>());
168168

169-
self.remove_empty_directories(transaction, &prefix_records, target_prefix)?;
169+
self.remove_empty_directories(transaction, &prefix_records, target_prefix)
170+
.unwrap_or_else(|e| {
171+
tracing::warn!("Failed to remove empty directories: {} (ignored)", e);
172+
});
170173

171174
self.clobber_registry()
172175
.unclobber(&required_packages, target_prefix)
@@ -181,7 +184,7 @@ impl InstallDriver {
181184
transaction: &Transaction<PrefixRecord, RepoDataRecord>,
182185
new_prefix_records: &[PrefixRecord],
183186
target_prefix: &Path,
184-
) -> Result<(), InstallError> {
187+
) -> Result<(), UnlinkError> {
185188
let mut keep_directories = HashSet::new();
186189

187190
// find all forced directories in the prefix records
@@ -218,8 +221,7 @@ impl InstallDriver {
218221
target_prefix,
219222
is_python_noarch,
220223
&keep_directories,
221-
)
222-
.unwrap();
224+
)?;
223225

224226
// The directory is not empty which means our parent directory is also not empty,
225227
// recursively remove the parent directory from the set as well.

crates/rattler/src/install/unlink.rs

-4
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ mod tests {
185185
let prefix_record =
186186
PrefixRecord::from_repodata_record(repodata_record, None, None, paths, None, None);
187187

188-
// install_driver
189-
// .post_process(transaction, target_prefix)
190-
// .unwrap();
191-
192188
return prefix_record;
193189
}
194190

0 commit comments

Comments
 (0)