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

fix: exclude use-openssl-ca from threads worker args #9373

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

viceice
Copy link

@viceice viceice commented Nov 10, 2023

↪️ Pull Request

use-openssl-ca should not send to Worker because it's not supported.

💻 Examples

We use a node wrapper wich calls node --use-openssl-ca ... and that fails with default threads worker

🚨 Test instructions

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@mischnic
Copy link
Member

We already have handling of various Node flags here:

async fork(forkModule: FilePath) {
let filteredArgs = [];
if (process.execArgv) {
filteredArgs = process.execArgv.filter(
v => !/^--(debug|inspect|no-opt|max-old-space-size=)/.test(v),
);
for (let i = 0; i < filteredArgs.length; i++) {
let arg = filteredArgs[i];
let isArgWithParam =
((arg === '-r' || arg === '--require') &&
filteredArgs[i + 1] === '@parcel/register') ||
arg === '--title';
if (isArgWithParam) {
filteredArgs.splice(i, 2);
i--;

So we should put this flag there as well

@viceice
Copy link
Author

viceice commented Nov 10, 2023

That only filters cli args but doesn't filter the NODE_OPTIONS env, that's why i added it to the threads worker. It should be passed to the process worker, which can otherwise fail is the use-openssl-ca flag is missing

mischnic
mischnic previously approved these changes Nov 11, 2023
@mischnic mischnic self-requested a review November 11, 2023 15:33
@mischnic
Copy link
Member

However I still get

Error: Initiated Worker with invalid NODE_OPTIONS env variable: --use-openssl-ca is not allowed in NODE_OPTIONS

with your change because that flag is being passed along here

@viceice
Copy link
Author

viceice commented Nov 11, 2023

I can try to fix it on Monday

@viceice
Copy link
Author

viceice commented Nov 30, 2023

sorry, but very busy with other open source projects 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't run Parcel with NODE_OPTIONS set to --use-openssl-ca
2 participants