mirror of https://github.com/pulumi/pulumi.git
28033c22bc
Prior to this change, if you ended up with multiple Pulumi SDK packages loaded side-by-side, we would fail in obscure ways. The reason for this was that we initialize and store important state in static variables. In the case that you load the same library twice, however, you end up with separate copies of said statics, which means we would be missing engine RPC addresses and so on. This change adds the ability to recover from this situation by mirroring the initialized state in process-wide environment variables. By doing this, we can safely recover simply by reading them back when we detect that they are missing. I think we can eventually go even further here, and eliminate the entry point launcher shim altogether by simply having the engine launch the Node program with the right environment variables. This would be a nice simplification to the system (fewer moving pieces). There is still a risk that the separate copy is incompatible. Presumably the reason for loading multiple copies is that the NPM/Yarn version solver couldn't resolve to a shared version. This may yield obscure failure modes should RPC interfaces change. Figuring out what to do here is part of pulumi/pulumi#957. This fixes pulumi/pulumi#777 and pulumi/pulumi#1017. |
||
---|---|---|
.. | ||
index.js |