-
Notifications
You must be signed in to change notification settings - Fork 30k
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
lib: fix code cache generation, add more tests and enable them by default #23855
Conversation
test/code-cache/test-code-cache.js
Outdated
assert(isUint8Array(codeCache[key]) && codeCache[key].length > 0, | ||
`Code cache for "${key}" should've been generated`); | ||
} else { | ||
// The binary is not configured with code cache. |
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.
Remove "not" ?
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.
LGTM with nit addressed
assert.ifError(child.error); | ||
|
||
const stat = fs.statSync(dest); | ||
assert(stat.isFile()); |
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.
Prefer assert.ok
Is there anything else we can test about the file? Maybe that it has the string static uint8_t internal_bootstrap_cache_raw[]
?
Addressed nits and added tests for verifying |
Thank you! |
Hmm, CI was not happy, I'll investigate
|
e7f710c broke the code cache generation since internalBinding is now passed in through the wrapper and cannot be redeclared. This patch fixes that.
- Add the code cache tests to the default test suite, and test the bookkeeping when the binary is not built with the code cache. - Test the code cache generator to make sure we do not accidentally break it - until we enable code cache in the CI.
4b7cee0
to
135472a
Compare
Rebased and added logs when the CI: https://ci.nodejs.org/job/node-test-pull-request/18189/ EDIT: |
Apparently inspector is not available in the withoutintl job (cc @refack is that intentional?)..skipped the inspector modules when inspector is not available. |
trace events are also unavailable in withoutintl jobs..fixed the |
So the resume build is green: https://ci.nodejs.org/job/node-test-pull-request/18204/ I am leaning towards that's a irrelevant flake. |
@@ -42,6 +43,15 @@ const cannotUseCache = [ | |||
'internal/bootstrap/node' | |||
].concat(depsModule); | |||
|
|||
if (process.config.variables.v8_enable_inspector !== 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.
May be worthwhile including a quick comment with these that says why they cannot use the cache, just so it's clear to folks coming along later.
Landed in b255cd4...010a3f8 with the comment requested by @jasnell added |
e7f710c broke the code cache generation since internalBinding is now passed in through the wrapper and cannot be redeclared. This patch fixes that. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Add the code cache tests to the default test suite, and test the bookkeeping when the binary is not built with the code cache. - Test the code cache generator to make sure we do not accidentally break it - until we enable code cache in the CI. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
e7f710c broke the code cache generation since internalBinding is now passed in through the wrapper and cannot be redeclared. This patch fixes that. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Add the code cache tests to the default test suite, and test the bookkeeping when the binary is not built with the code cache. - Test the code cache generator to make sure we do not accidentally break it - until we enable code cache in the CI. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
e7f710c broke the code cache generation since internalBinding is now passed in through the wrapper and cannot be redeclared. This patch fixes that. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Add the code cache tests to the default test suite, and test the bookkeeping when the binary is not built with the code cache. - Test the code cache generator to make sure we do not accidentally break it - until we enable code cache in the CI. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
e7f710c broke the code cache generation since internalBinding is now passed in through the wrapper and cannot be redeclared. This patch fixes that. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Add the code cache tests to the default test suite, and test the bookkeeping when the binary is not built with the code cache. - Test the code cache generator to make sure we do not accidentally break it - until we enable code cache in the CI. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
e7f710c broke the code cache generation since internalBinding is now passed in through the wrapper and cannot be redeclared. This patch fixes that. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Add the code cache tests to the default test suite, and test the bookkeeping when the binary is not built with the code cache. - Test the code cache generator to make sure we do not accidentally break it - until we enable code cache in the CI. Refs: #21563 PR-URL: #23855 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
lib: fix code cache generation
e7f710c broke the code cache generation since internalBinding
is now passed in through the wrapper and cannot be redeclared.
This patch fixes that.
test: run code cache test by default and test generator
the bookkeeping when the binary is not built with the code cache.
break it - until we enable code cache in the CI.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes