Skip to content

fix: ignore optional fail - #2557

Merged
elrrrrrrr merged 5 commits into
nextfrom
ignore-optional-fail
Feb 2, 2026
Merged

fix: ignore optional fail#2557
elrrrrrrr merged 5 commits into
nextfrom
ignore-optional-fail

Conversation

@elrrrrrrr

Copy link
Copy Markdown
Contributor

fix #2555

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @elrrrrrrr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the package installation process by implementing more resilient error handling for optional dependencies. Previously, any failure related to an optional package would cause the entire installation to fail. The changes introduce a mechanism to identify optional dependencies and, upon encountering an error during their installation or script execution, log a warning and continue the process, preventing unnecessary interruptions to the overall installation flow.

Highlights

  • Optional Dependency Failure Handling: The system now gracefully handles failures during the download, copy, or script execution phases of optional and dev-optional dependencies. Instead of halting the entire installation, these failures are now logged as warnings, allowing the installation to proceed for required dependencies.
  • Propagation of Optional Flag: A new is_optional boolean flag has been introduced and propagated through the package collection and execution queue mechanisms. This flag indicates whether a package is an optional dependency, enabling conditional error handling.
  • Enhanced Test Coverage: New unit tests have been added to verify the correct identification of optional dependencies and to confirm that script execution failures for optional packages are indeed ignored, ensuring the robustness of the new error handling logic.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly implements ignoring failures for optional dependencies during installation, both for package downloads/cloning and for script execution. The changes are propagated consistently through the package service layer, and new tests are added to cover the new logic. I've added a couple of suggestions to improve code maintainability by centralizing the logic for identifying optional packages into a new method and simplifying the related tests.

Comment thread crates/pm/src/service/install.rs
Comment thread crates/pm/src/service/install.rs
@elrrrrrrr
elrrrrrrr marked this pull request as draft February 2, 2026 07:24
@elrrrrrrr
elrrrrrrr marked this pull request as ready for review February 2, 2026 08:37
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown

📊 Performance Benchmark Report (with-antd)

🚀 Utoopack Performance Report: Async Task Scheduling Overhead Analysis

Report ID: utoopack_performance_report_20260202_110313
Generated: 2026-02-02 11:03:13
Trace File: trace_antd.json (1.5GB, 7.99M events)
Test Project: examples/with-antd


📊 Executive Summary

This report analyzes the performance of Utoopack/Turbopack, covering the full spectrum of the Performance Analysis Protocol (P0-P4).

Key Findings

Metric Value Assessment
Total Wall Time 10,538.6 ms Baseline
Total Thread Work 91,517.2 ms ~8.7x parallelism
Thread Utilization 62.0% 🆗 Average
turbo_tasks::function Invocations 3,877,520 Total count
Meaningful Tasks (≥ 10µs) 1,573,338 (40.6% of total)
Tracing Noise (< 10µs) 2,304,182 (59.4% of total)

Workload Distribution by Tier

Category Tasks Total Time (ms) % of Work
P0: Runtime/Resolution 1,082,677 55,682.8 60.8%
P1: I/O & Heavy Tasks 38,029 3,795.5 4.1%
P3: Asset Pipeline 28,079 4,443.5 4.9%
P4: Bridge/Interop 0 0.0 0.0%
Other 424,553 20,501.2 22.4%

⚡ Parallelization Analysis (P0-P2)

Thread Utilization

Metric Value
Number of Threads 14
Total Thread Work 91,517.2 ms
Avg Work per Thread 6,536.9 ms
Theoretical Parallelism 8.68x
Thread Utilization 62.0%

Assessment: With 14 threads available, achieving 8.7x parallelism indicates significant loss of potential parallelism.


📈 Top 20 Tasks (Global)

These are the most significant tasks by total duration:

Total (ms) Count Avg (µs) % Work Task Name
46,311.6 896,772 51.6 50.6% turbo_tasks::function
8,945.0 128,255 69.7 9.8% task execution completed
6,609.9 86,550 76.4 7.2% turbo_tasks::resolve_call
3,097.7 33,074 93.7 3.4% analyze ecmascript module
2,253.6 67,606 33.3 2.5% precompute code generation
2,075.8 68,404 30.3 2.3% resolving
1,840.2 36,640 50.2 2.0% module
1,787.8 21,021 85.0 2.0% effects processing
1,583.2 11,617 136.3 1.7% process parse result
1,119.6 6,622 169.1 1.2% parse ecmascript
1,084.0 36,505 29.7 1.2% internal resolving
1,077.7 33,600 32.1 1.2% process module
908.7 29,312 31.0 1.0% resolve_relative_request
663.8 1,921 345.6 0.7% analyze variable values
508.7 22,068 23.1 0.6% handle_after_resolve_plugins
474.5 16,082 29.5 0.5% resolve_module_request
446.3 17,794 25.1 0.5% resolved
438.2 1,944 225.4 0.5% swc_parse
425.0 4,248 100.0 0.5% read file
413.3 11,072 37.3 0.5% code generation

🔍 Deep Dive by Tier

🔴 Tier 1: Runtime & Resolution (P0)

Focus: Task scheduling and dependency resolution.

Metric Value Status
Total Scheduling Time 55,682.8 ms ⚠️ High
Resolution Hotspots 9 tasks 🔍 Check Top Tasks

Potential P0 Issues:

  • Low thread utilization (62.0%) suggests critical path serialization or lock contention.
  • 2,304,182 tasks < 10µs (59.4%) contribute to scheduler pressure.

🟠 Tier 2: Physical & Resource Barriers (P1)

Focus: Hardware utilization, I/O, and heavy monoliths.

Metric Value Status
I/O Work (Estimated) 3,795.5 ms ✅ Healthy
Large Tasks (> 100ms) 19 🚨 Critical

Potential P1 Issues:

  • 19 tasks exceed 100ms. These "Heavy Monoliths" are prime candidates for splitting.

🟡 Tier 3: Architecture & Asset Pipeline (P2-P3)

Focus: Global state and transformation pipeline.

Metric Value Status
Asset Processing (P3) 4,443.5 ms 4.9% of work
Bridge Overhead (P4) 0.0 ms ✅ Low

💡 Recommendations (Prioritized P0-P2)

🚨 Critical: (P0) Improvement

Problem: 62.0% thread utilization.
Action:

  1. Profile lock contention if utilization < 60%.
  2. Convert sequential await chains to try_join.

⚠️ High Priority: (P1) Optimization

Problem: 19 heavy tasks detected.
Action:

  1. Identify module-level bottlenecks (e.g., barrel files).
  2. Optimize I/O batching for metadata.

⚠️ Medium Priority: (P3) Pipeline Efficiency

Action:

  1. Review transformation logic for frequently changed assets.
  2. Minimize cross-language serialization (P4) if overhead exceeds 10%.

📐 Diagnostic Signal Summary

Signal Status Finding
Tracing Noise (P0) ✅ Acceptable 59.4% of tasks < 10µs
Thread Utilization (P0) ✅ Good 62.0% utilization
Heavy Monoliths (P1) ⚠️ Detected 19 tasks > 100ms
Asset Pipeline (P3) 🔍 Review 4,443.5 ms total
Bridge/Interop (P4) ✅ Low 0.0 ms total

🎯 Action Items (Comprehensive P0-P4)

  1. [P0] Profile lock contention to address 37% lost parallelism
  2. [P1] Breakdown heavy monolith tasks (>100ms) to improve granularity
  3. [P1] Review I/O patterns for potential batching opportunities
  4. [P3] Optimize asset transformation pipeline hot-spots
  5. [P4] Reduce "chatty" bridge operations if interop overhead is significant

Report generated by Utoopack Performance Analysis Agent on 2026-02-02
Following: Utoopack Performance Analysis Agent Protocol

@elrrrrrrr
elrrrrrrr merged commit 2928077 into next Feb 2, 2026
23 checks passed
@elrrrrrrr
elrrrrrrr deleted the ignore-optional-fail branch February 2, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 <BUG> Installation failure of optional dependencies should not be fatal

2 participants