fix: Delete obsolete platform-compatibility-test#2419
Conversation
6d1b625 to
b324de6
Compare
b324de6 to
fc32323
Compare
kriskowal
left a comment
There was a problem hiding this comment.
The platform compatibility test specifically validates that SES works on Node.js 12 and can be deleted since it has vanished into history. Node.js 12 required special consideration because of its experimental ESM support. I would not mind following that down to the roots: The test:platform-compatibility script in the ses package.json can be deleted, as well as the test/package fixture.
fc32323 to
4825656
Compare
Done. PTAL |
a3840c7 to
ca4b5fb
Compare
Staged on #2419 Closes: #XXXX Refs: #2414 #2418 #2419 ## Description #2414 by itself does not work on Node 18 and Node 20 because - those platforms do not have `Array.prototype.transfer`, so #2414 must use `structuredClone` instead - `structuredClone` does exist on Node >= 18, so it should be on supported platforms (though see #2418 ). However, `structuredClone` itself is dangerous and so must not be added to the shared intrinsics. As a result, in #2414 , when `@endo/pass-style` is initialized in a created compartment, it fails to find either `Array.prototype.transfer` and `structuredClone To solve this, @kriskowal suggested that we also shim `Array.prototype.transfer` if needed during `lockdown`, along with other repairs. We are avoiding similarly shimming `Array.prototype.transferToImmutable` because it is not yet standard. But `Array.prototype.transfer` is standard, and so `lockdown` can globally shim it before hardening the shared intrinsics. This PR implements @kriskowal 's suggestion. ### Security Considerations none ### Scaling Considerations by itself, none ### Documentation Considerations nothing signicant. ### Testing Considerations See #2418 . Aside from that, none ### Compatibility and Upgrade Considerations On platforms with neither `Array.prototype.transfer` nor a global `structuredClone`, the ses-shim will *currently* not install an emulation of `Array.prototype.transfer`. However, once we verify that endo is not intended to support platforms without both, we may change lockdown to throw, failing to lock down.
Closes: #2418
Refs: #2417 #1308
Description
Adapted from #2419 (review) below
The platform compatibility test specifically validates that SES works on Node.js 12 and can be deleted since it has vanished into history. Node.js 12 required special consideration because of its experimental ESM support. Delete the
test:platform-compatibilityscript in the sespackage.json, as well as thetest/packagefixture in ci.ymlImmediate motivation explained in #2418 , #2417 broken the platform-compatibility-test tests because it depends on the platform providing either
Array.prototype.transferorstructuredClone. Node supportstransferstarting with Node 22, but supportsstructuredClonestarting in Node 18. That should be fine, since that is our declared support floor. This PR changes our one known remaining dependence on Node 12.Security Considerations
none
Scaling Considerations
none
Documentation Considerations
none beyond the need to explain our platform requirements, which this PR does not change.
Testing Considerations
The point. This PR only affects tests, not production code.
Reviewers, should this PR be labeled
test:instead offix:?Compatibility and Upgrade Considerations
After this PR, we will no longer notice further breakage on Node < 18. That fits with our declared support floor.