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

Prevents libuv/E2BIG errors when a large NOTICE file exists (fixes #7783) #8093

Closed
wants to merge 3 commits into from

Conversation

dbjorge
Copy link

@dbjorge dbjorge commented May 2, 2020

Summary

This PR fixes #7783 by following the example from #7419 that was used to fix #5420.

TLDR: it prevents yarn from erroring out anytime you have a >40kb NOTICE file at the root of your repo and try to invoke any run-script that involves exec()ing a new node process.

This change has some backcompat risk (it no longer sets the npm_package_noticeText env var that was previously available to run scripts); I don't see any references to that variable name in an all-github code search, so I think the risk is lower than the benefit.

Test plan

Similarly to #7419, this doesn't add any new test code because the existing tests already cover verifying each value in the IGNORE_MANIFEST_KEYS list.

I manually verified that it addresses #7783 by testing it against a small test yarn project with a 40kb notice.txt file:

C:\repos\testyarnbug | 4 | 18:49:56 05/01
> ls


    Directory: C:\repos\testyarnbug

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----            5/1/2020  6:05 PM                node_modules
-a---            5/1/2020  6:08 PM          40002 notice.txt
-a---            5/1/2020  6:06 PM            180 package.json
-a---            5/1/2020  6:05 PM           2105 yarn.lock


C:\repos\testyarnbug | 5 | 18:55:43 05/01
> type package.json
{
  "name": "test",
  "version": "1.0.0",
  "license": "MIT",
  "scripts": {
    "echo": "cross-env echo hi"
  },
  "devDependencies": {
    "cross-env": "^7.0.2"
  }
}

C:\repos\testyarnbug | 6 | 18:55:50 05/01
> yarn echo
yarn run v1.22.4
$ cross-env echo hi
Assertion failed: len < MAX_ENV_VAR_LENGTH, file c:\ws\deps\uv\src\win\util.c, line 1478
error Command failed with exit code 3221226505.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exit code -1073740791. Command took 2.161414 seconds.

C:\repos\testyarnbug | 7 | 18:55:58 05/01
> node C:\repos\yarn\bin\yarn.js echo
yarn run v1.23.0-0
$ cross-env echo hi
"hi"
Done in 1.06s.

C:\repos\testyarnbug | 8 | 18:56:04 05/01
>

@dbjorge
Copy link
Author

dbjorge commented May 2, 2020

The "Yarn Acceptance Tests" failures are unrelated to this PR; the errors they're seeing are all:

##[warning]An image label with the label macOS 10.13 does not exist.

This is happening because Azure DevOps dropped support for hosted macOS-10.13 agents on March 23rd 2020 (see https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops)

@dbjorge
Copy link
Author

dbjorge commented May 2, 2020

The ci/circleci failures on linux-node12 and linux-node13 also appear to be timeouts unrelated to this PR; the same timeout has occurred in the same 2 jobs in both of the other two most-recently-updated PRs (#7495 12/13, #8066 12/13)

@wwahammy
Copy link

Is there someone we can talk to about getting this merged and a new release for yarn? This is killing me.

@dbjorge
Copy link
Author

dbjorge commented Jul 30, 2020

@arcanis , it looks like you've merged the most-recently-merged PRs in this repo; are you the right person to ask to take a look at this?

@dbjorge
Copy link
Author

dbjorge commented Jun 22, 2022

Closing this for inactivity; it seems clear that it isn't going to be merged into yarn 1

@dbjorge dbjorge closed this Jun 22, 2022
dfederschmidt added a commit to splunk/vscode-extension-splunk-soar that referenced this pull request Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants