-
Notifications
You must be signed in to change notification settings - Fork 5k
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: Fix LavaMoat build failures and restore RegExp OOM mitigation #29637
Conversation
Removed dependencies detected. Learn more about Socket for GitHub ↗︎ 🚮 Removed packages: npm/[email protected] |
LavaMoat was updated recently, but the patch we had of `lavamoat-core` was not updated with it. This restores the changes made in that patch. Note that the old patch still exists because we're still using the older version of `lavamoat-core` for the `lavamoat-viz` tool. The patch had three changes; the third was upstreamed already so it was not required, but the first two (RegExp cache and skipping policy write) were still required. Fixes #29482
bf515a9
to
b431bc0
Compare
opts.scuttlerFunc = globalRef[opts.scuttlerName] | ||
} | ||
+ | ||
+ // cache regular expressions to work around https://github.com/MetaMask/metamask-extension/issues/21006 |
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 scuttling logic was refactored between these releases; it used to be in kernelCoreTempalte
, but in v16 it was moved to scuttle.js
. I had to move this cache along with it.
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Builds ready [9d023d4]
Page Load Metrics (1770 ± 98 ms)
Bundle size diffs
|
Description
LavaMoat was updated recently, but the patch we had of
lavamoat-core
was not updated with it. This restores the changes made in that patch.Note that the old patch still exists because we're still using the older version of
lavamoat-core
for thelavamoat-viz
tool.The patch had three changes; the third was upstreamed already so it was not required, but the first two (RegExp cache and skipping policy write) were still required.
Related issues
Fixes #29482
Manual testing steps
There is no consistent way to test the intermittent build failure issue, though we could try running this over and over.
For the RegExp cache, we never had a clear reproduction for the OOM error that was meant to mitigate either.
Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist