-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
build: re-enable V8 snapshots #1663
Conversation
@@ -581,7 +582,7 @@ def configure_arm(o): | |||
|
|||
# Print warning when snapshot is enabled and building on armv6 | |||
if is_arch_armv6() and options.with_snapshot: |
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.
options.unused_with_snapshot? Or maybe revert the rename.
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.
On second thought: not options.with_snapshot
is probably more accurate.
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.
remind me, did you want me to disable snapshots by default for armv6?
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.
Good question. Maybe enable it, remove the warning and see what the CI says?
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.
will try.
# Print warning when snapshot is enabled and building on armv6 | ||
if is_arch_armv6() and options.with_snapshot: | ||
warn('when building on ARMv6, don\'t use --with-snapshot') | ||
|
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.
The default is still to build without snapshot, right? I'm sorry, but the diff doesn't make it obvious for me.
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.
The new commit is to test CI and see if building/testing on armv6 w/ snapshot enabled works. It's just a test commit for the CI.
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.
@bnoordhuis I noticed on the CI job that there's no armv6 listed. Just armv7/8. So this config optin would be tested, right?
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.
pi1-raspbian-wheezy at least is armv6.
@rvagg can we get those RPis renamed at some point to follow the naming schema arch-distro-version
like the rest of the CI jobs, to avoid confusion.
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.
@silverwind ah, thanks for pointing that out. missed that one.
@bnoordhuis Seems armv6 build now works w/ snapshots. I'm troubleshooting the win failures, but they're not from this PR. LGTY? (well, after the squash that is) |
There are two other places in configure that use |
This also sligthly decreases the memory usage, from ~0.8 MiB to ~0.3 MiB per an empty context. |
This makes building with snapshots the default again - is that intended? |
@piscisaureus security consideration is no longer the case with a newer v8, this is why we revert that change. |
For the simple repeated (async) «var x = {}; vm.createContext(x);» test RSS with this patch does not reach 1.4 GiB now (as it did before), but stays around ~700 MiB (~800 MiB peak), heapUsed does not go above 480 MiB (was at least 880 MiB without this patch). That's still not perfect, but a bit better than it was. |
@indutny oh, I didn't know security was "fixed". Got more info on that? (bonus point for commit link :) |
@jbergstroem The discussion was at the issue this pr fixes: #1631 (comment) |
faed1f3
to
eda89af
Compare
@bnoordhuis don't see the two places you're talking about. I see:
Which is correct, since snapshot will have been enabled. And:
Which I believe is still correct because |
Oh, I see what I missed now... It's kind of confusing because AFAIK that makes it the only option that works that way. Let me go over the PR one more time. |
action='store_true', | ||
dest='unused_without_snapshot', | ||
action='store_false', | ||
dest='with_snapshot', |
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.
I think it would be clearer / more idiomatic if you named it 'without_snapshot'
with action='store_false'
(and you can drop the default=True
in that case.)
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.
I think you meant action='store_true'
. Otherwise it'll always be false.
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.
That is indeed what I meant. :-)
eda89af
to
a455238
Compare
@bnoordhuis Switched the variable name, and does seem to make more sense that way. PTAL. |
o['variables']['want_separate_host_toolset'] = 0 | ||
else: | ||
o['variables']['want_separate_host_toolset'] = 1 |
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.
I suspect that the logic is wrong here because it will set want_separate_host_toolset = 1
when target_arch == host_arch
.
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.
oh you're correct. I naively switched the statements. Has been fixed.
a455238
to
6979842
Compare
o['variables']['want_separate_host_toolset'] = 0 | ||
else: | ||
o['variables']['want_separate_host_toolset'] = 1 |
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.
This still doesn't look quite correct me. Host/target toolsetting should be enabled when cross-compiling with snapshots enabled so I think you could write this as:
cross_compiling = target_arch != host_arch
want_snapshots = not options.without_snapshot
o['variables']['want_separate_host_toolset'] = int(cross_compiling and want_snapshots)
The double negation reads kind of iffy but it is what it is.
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.
Thanks. Had to make a white space change to fit at 80, but made the change.
Also re-enable use of snapshots for armv6. Fixes: nodejs#1631
6979842
to
61154d7
Compare
LGTM if the CI is happy. I would explain in the commit log that enabling snapshots is no longer a security liability. |
Thanks @bnoordhuis for all the reviews. Landed in 8736a8e. |
Snapshots had been previously disabled because of a security vunerability. This has been fixed (ref: #1631 (comment)) Also, re-enable snapshots for ARMv6 builds. There were previous build issues that have been fixed. Fixes: #1631 PR-URL: #1663 Reviewed-By: Ben Noordhuis <[email protected]>
Edit: Actually landed in 36cdc7c. |
PR-URL: nodejs#1679 Notable Changes: * win,node-gyp: the delay-load hook for windows addons has now been correctly enabled by default, it had wrongly defaulted to off in the release version of 2.0.0 (Bert Belder) nodejs#1433 * os: tmpdir()'s trailing slash stripping has been refined to fix an issue when the temp directory is at '/'. Also considers which slash is used by the operating system. (cjihrig) nodejs#1673 * tls: default ciphers have been updated to use gcm and aes128 (Mike MacCana) nodejs#1660 * build: v8 snapshots have been re-enabled by default as suggested by the v8 team, since prior security issues have been resolved. This should give some perf improvements to both startup and vm context creation. (Trevor Norris) nodejs#1663 * src: fixed preload modules not working when other flags were used before --require (Yosuke Furukawa) nodejs#1694 * dgram: fixed send()'s callback not being asynchronous (Yosuke Furukawa) nodejs#1313 * readline: emitKeys now keeps buffering data until it has enough to parse. This fixes an issue with parsing split escapes. (Alex Kocharin) * cluster: works now properly emit 'disconnect' to cluser.worker (Oleg Elifantiev) nodejs#1386 events: uncaught errors now provide some context (Evan Lucas) nodejs#1654
Snapshots had been previously disabled because of a security vunerability. This has been fixed (ref: nodejs#1631 (comment)) Also, re-enable snapshots for ARMv6 builds. There were previous build issues that have been fixed. Fixes: nodejs#1631 PR-URL: nodejs#1663 Reviewed-By: Ben Noordhuis <[email protected]>
Fixes: #1631
R=@bnoordhuis