rspack
                                
                                 rspack copied to clipboard
                                
                                    rspack copied to clipboard
                            
                            
                            
                        [Bug]: Trace does not work in parallel builds
System Info
  System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 187.50 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    npm: 6.14.13 - ~/.nvm/versions/node/v20.12.2/bin/npm
  npmPackages:
    @rspack/cli: ^0.6.3-canary-9bd4169-20240506141944 => 0.6.3 
    @rspack/core: ^0.6.3-canary-9bd4169-20240506141944 => 0.6.3 
Details
When trying to use the following trace RSPACK_PROFILE="TRACE=layer=logger" on two builds that are run in parallel there is an error that the trace is already created.
Command
module.exports = (env = {}) => {
  return [build1(env), build2(env)].filter(Boolean);
};
Output
zchapple@macos myApp % RSPACK_PROFILE="TRACE=layer=logger" npm run build:prod:rspack >> log.txt
[Error: EEXIST: file already exists, mkdir '/Volumes/CaseSensitive/myApp/.rspack-profile-1715008478861'] {
  errno: -17,
  code: 'EEXIST',
  syscall: 'mkdir',
  path: '/Volumes/CaseSensitive/myApp/.rspack-profile-1715008478861'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 131
npm ERR! mailchimp@ build:prod:rspack: `NODE_ENV=production node packageJsonScripts/rsmain.js build ./web-config/rspack.config.js`
npm ERR! Exit status 131
npm ERR! 
npm ERR! Failed at the myApp@ build:prod:rspack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zchapple/.npm-node-v14.17.2/_logs/2024-05-06T15_14_38_875Z-debug.log
Reproduce link
No response
Reproduce Steps
- have two builds being run at once in parallel.
- try to use rspack trace.