Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/install/PackageManager/PopulateManifestCache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ impl RunTasksCallbacks for ManifestsOnlyCallbacks {
/// Populate the manifest cache for packages included from `root_pkg_ids`. Only manifests of
/// direct dependencies of the `root_pkg_ids` are populated. If `root_pkg_ids` has length 0
/// all packages in the lockfile will have their manifests fetched if necessary.
/// A dependency that is queued before or during the call resolves inside it.
pub fn populate_manifest_cache(
manager: &mut PackageManager,
packages: Packages<'_>,
Expand Down Expand Up @@ -337,6 +338,11 @@ pub fn populate_manifest_cache(
}
}

// `run_tasks` names the bar when a manifest download completes, and `start_manifest_task` starts none when every name is cached or already requested by a queued row.
if log_level.show_progress() {
manager.start_progress_bar_if_none();
}
Comment thread
robobun marked this conversation as resolved.
Resolved

// Derive the raw provenance root first so both `sleep_until` and the
// closure body's `&mut *run_closure.manager` share the same SRW tag.
let mgr: *mut PackageManager = manager;
Expand Down
65 changes: 28 additions & 37 deletions src/install/PackageManager/runTasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,25 +659,21 @@ fn run_tasks_erased(
);
}

if cb.manifests_only {
continue;
// A task that `populate_manifest_cache` started has no entry.
if let Some(dependency_list_entry) =
manager.task_queue.get_mut(&task.task_id)
{
let dependency_list = core::mem::take(dependency_list_entry);

process_dependency_list_for_ctx(
cb,
manager,
dependency_list,
extract_ctx,
install_peer,
)?;
}

let dependency_list_entry = manager
.task_queue
.get_mut(&task.task_id)
.expect("infallible: task queued");

let dependency_list = core::mem::take(dependency_list_entry);

process_dependency_list_for_ctx(
cb,
manager,
dependency_list,
extract_ctx,
install_peer,
)?;

continue;
}
}
Expand Down Expand Up @@ -1060,30 +1056,25 @@ fn run_tasks_erased(
m
};
let name_hash = manifest.pkg.name.hash;
let progress_name: Option<Vec<u8>> = (!cb.manifests_only
&& log_level.show_progress()
&& !has_updated_this_run.get())
.then(|| manifest.name().to_vec());
let progress_name: Option<Vec<u8>> = (log_level.show_progress()
&& !has_updated_this_run.get()
&& !cb.manifests_only)
.then(|| manifest.name().to_vec());

manager.manifests.insert(name_hash, manifest)?;

if cb.manifests_only {
continue;
}

let dependency_list_entry = manager
.task_queue
.get_mut(&task.id)
.expect("infallible: task queued");
let dependency_list = core::mem::take(dependency_list_entry);
// A task that `populate_manifest_cache` started has no entry.
if let Some(dependency_list_entry) = manager.task_queue.get_mut(&task.id) {
let dependency_list = core::mem::take(dependency_list_entry);

process_dependency_list_for_ctx(
cb,
manager,
dependency_list,
extract_ctx,
install_peer,
)?;
process_dependency_list_for_ctx(
cb,
manager,
dependency_list,
extract_ctx,
install_peer,
)?;
}

if let Some(name) = progress_name {
manager.set_node_name::<true>(
Expand Down
8 changes: 6 additions & 2 deletions src/install/update_transitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,17 @@ pub(crate) fn enqueue_peer_rows(
register_moved(manager, &from)
}

/// Pending log lines go to stderr; `--silent` drops everything but errors.
/// Pending log lines go to stderr; `--silent` drops everything but errors. An error among them fails the install here, because the reset below hides it from `install_with_manager`.
fn print_log(manager: &PackageManager) -> crate::Result<()> {
let log = manager.log_mut();
if manager.options.log_level != LogLevel::Silent || log.has_errors() {
let failed = log.has_errors();
if manager.options.log_level != LogLevel::Silent || failed {
log.print(core::ptr::from_mut(Output::error_writer()))?;
}
log.reset();
if failed {
return Err(crate::Error::InstallFailed);
Comment thread
robobun marked this conversation as resolved.
Resolved
}
Ok(())
}

Expand Down
Loading
Loading