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

The size of the npm_package_noticeText env variable is too large for node.js #7783

Closed
bobbrow opened this issue Dec 27, 2019 · 4 comments
Closed

Comments

@bobbrow
Copy link

bobbrow commented Dec 27, 2019

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
Starting with Node 12.11, they use libuv to lookup environment variables. Yarn creates a variable called npm_package_noticeText which contains the full contents of a package's NOTICE.txt file and can exceed the max size allowable by libuv. This causes yarn commands to fail when packaging the CMake Tools extension for VS Code.

If the current behavior is a bug, please provide the steps to reproduce.
Repro steps:

  • Prerequisites:
    • Install node.js version 12.11 or newer (download)
    • Install yarn (download)
    • Run npm install -g vsce
  • Create a folder where you can clone the extension repository (e.g. c:\git)
  • In that directory run: git clone https://github.com/microsoft/vscode-cmake-tools.git
  • Run: cd vscode-cmake-tools
  • Run: vsce package --yarn

What is the expected behavior?

  • vsce should create a cmake-tools-[version].vsix file in the vscode-cmake-tools folder

Actual Behavior:

  • node crashes and the following output is displayed:
Executing prepublish script 'yarn run vscode:prepublish'...
ERROR  Command failed: yarn run vscode:prepublish
Assertion failed: len < MAX_ENV_VAR_LENGTH, file c:\ws\deps\uv\src\win\util.c, line 1476
error Command failed with exit code 3221226505.

Please mention your node.js, yarn and operating system version.
node.js >= 12.11
yarn = 1.21.1
OS = Windows 10 18362

@dbjorge
Copy link

dbjorge commented May 2, 2020

We just got hit by this as well. The description matches what I see with:

  • node.js = v12.16.2
  • yarn = v1.22.4
  • OS = Windows 10 18362.778

However, in an Ubuntu build machine in an Azure DevOps Pipeline, the same issue manifests with a different error message:

error An unexpected error occurred: "spawn E2BIG".
  • node.js = v12.16.3
  • yarn = v1.22.4
  • OS = ubuntu-18.04

and in an older build machine:

  • node.js = v12.13.0
  • yarn = v1.17.1
  • OS = ubuntu-16.04

Likely related to #5264, #5420

@dbjorge
Copy link

dbjorge commented May 2, 2020

Note, it's not just files named NOTICE.txt that cause the issue; any file named notice or which starts with "notice.":

// get notice file
const noticeFile = files.find((filename): boolean => {
const lower = filename.toLowerCase();
return lower === 'notice' || lower.startsWith('notice.');
});

I'm not super familiar with Yarn's code, but based on #7419 I suspect it might be as simple as adding noticeText to the list of ignored manifest keys at

export const IGNORE_MANIFEST_KEYS: Set<string> = new Set([
'readme',
'notice',
'licenseText',
'activationEvents',
'contributes',
]);

@bobbrow
Copy link
Author

bobbrow commented Sep 25, 2020

This appears to be fixed now.

@bobbrow bobbrow closed this as completed Sep 25, 2020
@kevinlul
Copy link

This still happens in Node 14.18.2 and yarn 1.22.17 with a large NOTICE file.

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

Successfully merging a pull request may close this issue.

3 participants