endo icon indicating copy to clipboard operation
endo copied to clipboard

remove package cycles

Open turadg opened this issue 1 year ago • 4 comments

What is the Problem Being Solved?

Lerna complains,

lerna WARN ECYCLE Dependency cycles detected, you should fix these!
lerna WARN ECYCLE @endo/compartment-mapper -> ses -> @endo/compartment-mapper
lerna WARN ECYCLE @endo/static-module-record -> (nested cycle: @endo/compartment-mapper -> ses -> @endo/compartment-mapper) -> @endo/static-module-record
lerna WARN ECYCLE (nested cycle: @endo/static-module-record -> (nested cycle: @endo/compartment-mapper -> ses -> @endo/compartment-mapper) -> @endo/static-module-record) -> (nested cycle: @endo/static-module-record -> (nested cycle: @endo/compartment-mapper -> ses -> @endo/compartment-mapper) -> @endo/static-module-record)

Since https://github.com/endojs/endo/pull/1633 this repo doesn't have any cycles in its dependencies graph, but it still has cycles when including devDependencies.

Description of the Design

Refactor devDependencies to remove the cycles.

Security Considerations

Scaling Considerations

Test Plan

Compatibility Considerations

Upgrade Considerations

turadg avatar Apr 01 '24 16:04 turadg

I’m not sure that it is possible to solve this problem. There is a certain meta-circularity in the dev toolchain. SES is at the bottom of the layer cake, but it reaches up to compartment-mapper/bundle.js to build the “rollups” in dist/* when it is published to npm.

kriskowal avatar Apr 03 '24 03:04 kriskowal

I’m not sure that it is possible to solve this problem. There is a certain meta-circularity in the dev toolchain. SES is at the bottom of the layer cake, but it reaches up to compartment-mapper/bundle.js to build the “rollups” in dist/* when it is published to npm.

Does ses need the local version of component-mapper/bundle.js? If it's just using it to bundle, it could pull from NPM.

If ses has to depend on component-mapper then the parts of SES that compartment-mapper depends on could be moved into a lower dependency like @endo/ses-core.

turadg avatar Apr 03 '24 14:04 turadg

Compartment Mapper depends on Compartment but doesn’t depend on Lockdown. There is a possibility that we could separate the Compartment shim. Or, we could decompose Compartment into the underlying Module Harmony machinery for ModuleSource (StaticModuleRecord) and Module instance (to drive the dependency trampoline without necessarily executing.

kriskowal avatar Apr 05 '24 20:04 kriskowal

https://github.com/endojs/endo/pull/2356 is a failed experiment to make some progress on this.

erights avatar Jul 15 '24 01:07 erights