-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): copy native files to tmp file location instead of .nx/cache (
#23375) ## Current Behavior Currently, the `.node` files required to load native code are saved in `.nx/cache`. This can cause different issues: - users on windows sometimes experience errors during `nx reset` because it's trying to delete the entire folder and some process is still locking the file - `@angular-eslint` users are seeing the `.nx/cache` folder in their workspace since it uses `@nx/devkit` ## Expected Behavior We want no errors and for noone to be bothered by the `.node` file. This is why we move the `.node` file to a tmp location outside the workspace instead of `.nx/cache`. We still make sure to delete it during `nx reset` but throw no errors if that fails. It will simply be deleted by the next invocation of `nx reset`. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #23224
- Loading branch information
Showing
3 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { tmpdir } from 'os'; | ||
import { join } from 'path'; | ||
import { createHash } from 'crypto'; | ||
import { workspaceRoot } from '../utils/workspace-root'; | ||
|
||
export const nativeFileCacheLocation = join( | ||
tmpdir(), | ||
'nx-native-file-cache', | ||
createHash('sha256').update(workspaceRoot).digest('hex') | ||
); |