Skip to content

fix: call compiler.close when having errors#10154

Merged
LingyuCoder merged 1 commit intomainfrom
fix/exit-when-close
Apr 24, 2025
Merged

fix: call compiler.close when having errors#10154
LingyuCoder merged 1 commit intomainfrom
fix/exit-when-close

Conversation

@LingyuCoder
Copy link
Contributor

Summary

fix #9699

Persistent cache of rspack is implemented in Rust and should always call compiler.close after building.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: bug fix release: bug related release(mr only) labels Apr 24, 2025
@netlify
Copy link

netlify bot commented Apr 24, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit bcbadac
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6809d51214f4d40008e41969
😎 Deploy Preview https://deploy-preview-10154--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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 an issue where persistent caches may become invalid by ensuring that compiler.close is always called, even when errors occur during compilation.

  • Always call compiler.close irrespective of compilation errors.
  • Remove conditional logic that bypassed compiler.close when errors were present.
Comments suppressed due to low confidence (1)

packages/rspack-cli/src/commands/build.ts:125

  • When closeErr is present, the errorHandler is still called with the original error and stats. Consider propagating or handling closeErr explicitly to avoid ambiguity between close errors and compilation errors.
compiler.close(closeErr => {

@LingyuCoder LingyuCoder enabled auto-merge (squash) April 24, 2025 06:20
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 24, 2025

CodSpeed Performance Report

Merging #10154 will not alter performance

Comparing fix/exit-when-close (bcbadac) with main (dbdfeb1)

Summary

✅ 11 untouched benchmarks

@LingyuCoder LingyuCoder changed the title fix: should call compiler.close when having errors fix: call compiler.close when having errors Apr 24, 2025
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@LingyuCoder LingyuCoder merged commit 8e906b1 into main Apr 24, 2025
36 checks passed
@LingyuCoder LingyuCoder deleted the fix/exit-when-close branch April 24, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Build hangs on error when setting api: "modern-compiler" in sass-loader

3 participants