Skip to content

Conversation

@CPunisher
Copy link
Member

@CPunisher CPunisher commented Nov 20, 2025

Description:
#11267 introduced this mistake.

  • SHARED_RUNTIME.block_on(fut) is enabled with#[cfg(feature = "plugin")]
  • SHARED_RUNTIME is enabled with #[cfg(all(feature = "plugin", not(feature = "manual-tokio-runtime")))]
  • If both features are enabled, the compiler goes failed.

The problem is that cfg! doesn't remove the code actually. #[cfg] is needed here

@CPunisher CPunisher requested a review from a team as a code owner November 20, 2025 08:27
Copilot AI review requested due to automatic review settings November 20, 2025 08:27
@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

🦋 Changeset detected

Latest commit: 15789f7

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a compilation error caused by incorrect use of cfg!() macro instead of #[cfg] attributes for conditional compilation. The issue occurs when both plugin and manual-tokio-runtime features are enabled together, causing the code to reference SHARED_RUNTIME which is only defined when manual-tokio-runtime is not enabled.

  • Replaced runtime cfg!() macro check with compile-time #[cfg] attributes
  • Reorganized imports and variable declarations to be scoped within the appropriate feature flag blocks
  • Maintained error handling context for the non-manual runtime path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 20, 2025

CodSpeed Performance Report

Merging #11316 will not alter performance

Comparing CPunisher:11-20-fix/plugin-manual-tokio-runtime (15789f7) with main (387ee0f)1

Summary

✅ 138 untouched

Footnotes

  1. No successful run was found on main (f98ca27) during the generation of this report, so 387ee0f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copilot AI review requested due to automatic review settings November 20, 2025 08:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kdy1 kdy1 added this to the Planned milestone Nov 20, 2025
@kdy1 kdy1 requested a review from a team as a code owner November 20, 2025 08:34
@kdy1 kdy1 merged commit f615cdb into swc-project:main Nov 20, 2025
5 of 6 checks passed
@CPunisher CPunisher deleted the 11-20-fix/plugin-manual-tokio-runtime branch November 20, 2025 08:36
@github-actions
Copy link
Contributor

Binary Sizes

File Size
swc.linux-x64-gnu.node 31M (31947080 bytes)

Commit: af8b34c

@kdy1 kdy1 modified the milestones: Planned, 1.15.3 Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants