Skip to content

fix(rspack): gate virtual folder behind process pid#538

Merged
ahabhgk merged 1 commit intounjs:mainfrom
elbywan:fix/parallel-rspack-virtual
Aug 21, 2025
Merged

fix(rspack): gate virtual folder behind process pid#538
ahabhgk merged 1 commit intounjs:mainfrom
elbywan:fix/parallel-rspack-virtual

Conversation

@elbywan
Copy link
Contributor

@elbywan elbywan commented Aug 20, 2025

Should resolve #537

  • adds a process.pid suffix to the node_modules/.virtual folder to stop sharing the folder between parallel rspack runs in separate processes
  • adds handlers on process exit and interrupt/kill signals to clean up the virtual subfolder when the process stops
  • the static counter property is currently shared between all virtual paths/contexts. This PR turns it into a Map of counters indexed by path to ensure that every pending virtual folder (and not only the last one) will get deleted when the final running compiler shuts down.

ensures that the node_modules/.virtual folder deletion supports parallel
runs
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 20, 2025

Open in StackBlitz

npm i https://pkg.pr.new/unjs/unplugin@538

commit: e817664

@antfu antfu requested a review from sxzz August 20, 2025 23:29
@sxzz sxzz requested review from ahabhgk and removed request for sxzz August 21, 2025 01:44
@ahabhgk ahabhgk merged commit 417a6bf into unjs:main Aug 21, 2025
15 checks passed
@sxzz
Copy link
Member

sxzz commented Aug 27, 2025

This PR appears to have broken other apps TanStack/router#5023

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.

rspack: virtual folder deletion is not resilient when multiple compilers are run in parallel

3 participants