-
Notifications
You must be signed in to change notification settings - Fork 76
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: include default max_old_space_size
in binaries [HEAD-1045]
#168
fix: include default max_old_space_size
in binaries [HEAD-1045]
#168
Conversation
.releaserc
Outdated
@@ -4,7 +4,7 @@ | |||
{ | |||
"//": "build the alpine, macos, linux and windows binaries", | |||
"path": "@semantic-release/exec", | |||
"cmd": "npm i -g pkg && pkg . -t node14-alpine-x64,node14-linux-x64,node14-macos-x64,node14-win-x64" | |||
"cmd": "npm i -g pkg && pkg . --options max_old_space_size=16384 -t node14-alpine-x64,node14-linux-x64,node14-macos-x64,node14-win-x64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: I think we should pin the version and not use latest all the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which version do you mean? For the pkg
tool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, npm i -g pkg
installs the latest version of pkg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please share more about the benefits you see in pinning, and what issues we're aiming to prevent?
Pinning does bring build stability, but considering that pkg
is just a build tool and our pipeline doesn't run often as far as I can see, I'm more concerned about being outdated over time and missing bug fixes or improvements of the tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Currently also major upgrades will be included even breaking changes, which is problematic.
- PKG is not just a build tool, it determines which node version is being bundled in the binaries.
- Pinning doesn't mean to not consume bugfix releases, but at least not automatically consume major changes.
🎉 This PR is included in version 2.3.8 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What this does
This PR introduces a change in the packaging command for our binaries to specify a default maximum old space size for V8's memory. The change was prompted by the need to accommodate larger projects that may require more memory than the default settings allow.
A change in the
pkg-fetch
repository (see vercel/pkg-fetch@7f3403b) disabled theNODE_OPTIONS
environment variable, which previously allowed consumers to set Node.js runtime options, including--max-old-space-size
, at runtime. This has impacted users who need to increase the memory limit beyond the default when running thesnyk-to-html
tool.Given that we cannot rely on
NODE_OPTIONS
, this PR takes the approach of setting a conservative default memory limit at build time using the--options max_old_space_size=16384
flag. This will set the old space size to 16GB, which should suffice for the majority of use cases without manual intervention.Notes for the reviewer
To be able to test this change I added a log like the following:
and we can see the output in the following image:
More information
HEAD-1045
HEAD-1051