Uh oh!
There was an error while loading. Please reload this page.
policy: cleanup to allow snapshotting - #42191
Conversation
nodejs-github-bot
commented
Mar 2, 2022
Review requested:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bmeck
commented
Mar 7, 2022
will wait and rebase after #42203 |
aduh95
commented
Mar 12, 2022
#42203 have landed, this needs a rebase. |
nodejs-github-bot
commented
Mar 21, 2022
nodejs-github-bot
commented
Mar 21, 2022
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Mar 22, 2022
bmeck
commented
Mar 22, 2022
looks like i've got to dance around no crypto builds |
bmeck
commented
Mar 22, 2022
@joyeecheung it looks like we still cannot include crypto in the snapshot via |
joyeecheung
commented
Mar 24, 2022
@bmeck hmm, I don’t think that is snapshot-specific - if policy still needs crypto to check integrity in non-crypto builds, how is that supposed to work? It seems some code should be added in policy to throw an error when the build has no OpenSSL instead? |
bmeck
commented
Mar 24, 2022
@joyeecheung anything using |
bmeck
commented
Mar 24, 2022
To clarify a bit, the overall goal is to get ESM/CJS loading into the snapshot and they have a transitive dependency on |
Maybe we need to rewrite node/lib/internal/policy/manifest.js Lines 32 to 37 in ceadb47 letcreateHash,timingSafeEqual,HashUpdate,HashDigest;if(config.hasSSL){constcrypto=require('crypto');({createHash, timingSafeEqual}=crypto);HashUpdate=uncurryThis(crypto.Hash.prototype.update);HashDigest=uncurryThis(crypto.Hash.prototype.digest);}That should solve the issue at hand I think. |
I think it should be fine to revert back to something like |
bmeck
commented
Mar 28, 2022
@joyeecheung the amount of checks would not be in policy itself, but anything consuming policy as well. I don't want to spider web out the checks throughout the codebase. |
avivkeller
commented
May 7, 2024
Hi, I'm sure you've heard that the Thank you! |
This is just some cleanup/refactoring to move getOptionValue away as much as possible for snapshotting reasons and some general startup cleaning.
Since this makes it always at least init an empty policy I thought adding it to the snapshot makes sense but I'm fine leaving it out as well.
CC: @joyeecheung