Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): execute plugins in isolated processes #21760

Merged
merged 4 commits into from
Feb 23, 2024

Conversation

AgentEnder
Copy link
Member

@AgentEnder AgentEnder commented Feb 9, 2024

Current Behavior

Project graph plugins are all loaded in the main nx process (or daemon if enabled), which can cause issues when they do things that mutate the global process (E.g. registering a typescript transpiler)

Expected Behavior

Plugins operate in a sandbox

Related Issue(s)

See: https://www.loom.com/share/87febc4db210444aa7f4163a76d7f758

@AgentEnder AgentEnder requested review from meeroslav, a team and leosvelperez as code owners February 9, 2024 22:27
@AgentEnder AgentEnder requested a review from Cammisuli February 9, 2024 22:27
Copy link

vercel bot commented Feb 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 9:57pm

@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 34c2ad6 to 90b8753 Compare February 9, 2024 22:56
@AgentEnder AgentEnder requested review from a team as code owners February 9, 2024 22:56
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 90b8753 to 349e63e Compare February 9, 2024 23:15
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 349e63e to 2e3ffb0 Compare February 16, 2024 03:32
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 2e3ffb0 to 4342107 Compare February 16, 2024 04:17
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 4342107 to 3c25fce Compare February 16, 2024 20:32
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 3c25fce to d1a640b Compare February 16, 2024 22:20
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from d1a640b to 98d71a2 Compare February 16, 2024 23:05
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 98d71a2 to 57cc74c Compare February 20, 2024 15:05
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 57cc74c to 4217c99 Compare February 20, 2024 21:41
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 4217c99 to 1eb98d0 Compare February 21, 2024 16:41
@@ -1,3 +1,5 @@
import { shutdownPluginWorkers } from './project-graph/plugins/plugin-pool';
Copy link
Member

Choose a reason for hiding this comment

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

remove this import

const pidMap = new Map<number, string>();

export function loadRemoteNxPlugin(plugin: PluginConfiguration, root: string) {
const isTest = path.extname(__filename) === '.ts';
Copy link
Member

Choose a reason for hiding this comment

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

I understand why we need to do this, but maybe we can change this to be more descriptive.

Comment on lines 210 to 216
if (process.env.NX_VERBOSE_LOGGING) {
console.log(
'Unable to find local plugin',
possiblePaths,
projectRootMappings
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Use the new logger.verbose function

@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 1eb98d0 to e6e872b Compare February 21, 2024 21:37
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from e6e872b to 81acbc5 Compare February 22, 2024 18:40
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch 2 times, most recently from 358efad to 44284fa Compare February 22, 2024 21:37
@AgentEnder AgentEnder force-pushed the feat/isolated-plugins branch from 44284fa to c3698bf Compare February 22, 2024 21:56
@AgentEnder AgentEnder merged commit c2581dc into nrwl:master Feb 23, 2024
4 of 6 checks passed
@AgentEnder AgentEnder deleted the feat/isolated-plugins branch February 23, 2024 18:20
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants