|
1 | 1 | use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
|
2 | 2 | use std::path::{Path, PathBuf};
|
3 | 3 | use std::sync::Arc;
|
4 |
| -use std::task::Poll; |
5 | 4 | use std::{env, fs};
|
6 | 5 |
|
7 | 6 | use crate::core::compiler::{CompileKind, DefaultExecutor, Executor, Freshness, UnitOutput};
|
@@ -531,44 +530,12 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> {
|
531 | 530 | // duplicate "Updating", but since `source` is taken by value, then it
|
532 | 531 | // wouldn't be available for `compile_ws`.
|
533 | 532 | let (pkg_set, resolve) = ops::resolve_ws(&self.ws)?;
|
534 |
| - |
535 |
| - // Checking the yanked status involves taking a look at the registry and |
536 |
| - // maybe updating files, so be sure to lock it here. |
537 |
| - let _lock = self.ws.config().acquire_package_cache_lock()?; |
538 |
| - |
539 |
| - let mut sources = pkg_set.sources_mut(); |
540 |
| - let mut pending: Vec<PackageId> = resolve.iter().collect(); |
541 |
| - let mut results = Vec::new(); |
542 |
| - for (_id, source) in sources.sources_mut() { |
543 |
| - source.invalidate_cache(); |
544 |
| - } |
545 |
| - while !pending.is_empty() { |
546 |
| - pending.retain(|pkg_id| { |
547 |
| - if let Some(source) = sources.get_mut(pkg_id.source_id()) { |
548 |
| - match source.is_yanked(*pkg_id) { |
549 |
| - Poll::Ready(result) => results.push((*pkg_id, result)), |
550 |
| - Poll::Pending => return true, |
551 |
| - } |
552 |
| - } |
553 |
| - false |
554 |
| - }); |
555 |
| - for (_id, source) in sources.sources_mut() { |
556 |
| - source.block_until_ready()?; |
557 |
| - } |
558 |
| - } |
559 |
| - |
560 |
| - for (pkg_id, is_yanked) in results { |
561 |
| - if is_yanked? { |
562 |
| - self.ws.config().shell().warn(format!( |
563 |
| - "package `{}` in Cargo.lock is yanked in registry `{}`, \ |
564 |
| - consider running without --locked", |
565 |
| - pkg_id, |
566 |
| - pkg_id.source_id().display_registry_name() |
567 |
| - ))?; |
568 |
| - } |
569 |
| - } |
570 |
| - |
571 |
| - Ok(()) |
| 533 | + ops::check_yanked( |
| 534 | + self.ws.config(), |
| 535 | + &pkg_set, |
| 536 | + &resolve, |
| 537 | + "consider running without --locked", |
| 538 | + ) |
572 | 539 | }
|
573 | 540 | }
|
574 | 541 |
|
|
0 commit comments