Commit graph

11 commits

Author SHA1 Message Date
Alex Clemmer 3bc86055c2 Add pulumi-analyzer-package scripts in publishing pipeline 2019-07-16 00:58:33 -07:00
Matt Ellis d7575072f2 Do not use relative path when launching dynamic provider
Previously, we assumed that the dynamic provider was located in
`./node_modules/@pulumi/pulumi/../` which is correct in the majority
of cases. However, tools like lerna or yarn workspaces (or custom
workflows) allow the node_modules folder to be located elsewhere on
disk, and node will still find it because of its algorithm for module
resolution.

So, do what we do in the language host itself, first launch node and
ask it to tell us where it resolves a require statement to on disk and
then launch node against that script.

Fixes #2261
2018-12-05 13:45:06 -08:00
Matt Ellis 50c98edd72 Don't set NODE_PATH in dynamic provider
This is a holdover from our old strategy for closure serialization. We
no longer use this module, so we don't need to tell Node where it is
anymore.
2018-06-15 11:12:24 -07:00
Matt Ellis 409477b951 Invoke node directly from the language host
Instead of using a shell script to jump from the language host into
node, just invoke node directly. This makes our start-up path a little
simpler to understand and indirectly fixes pulumi/home#156, where we
would fail on Windows if the `-exec` script was in a folder that had
spaces in it (due to a subtle interaction between how go launches cmd
files and how cmd.exe parses arguments).
2018-05-02 11:16:58 -07:00
Sean Gillespie 5decc10cbb
Improve the error message if Pulumi runtime SDK isn't installed (#1286)
* Improve the error message when npm/yarn install hasn't been run

* Same thing, but for Python

* Use PULUMI_RUN in batch script

* Use -e, -f doesn't work for symlinked paths (e.g. yarn link)
2018-04-27 16:55:41 -07:00
Matt Ellis ca2fbca13f Continue to add native modules to NODE_PATH
While we no longer use the native runtime module, older versions of
@pulumi/pulumi still require it. Let's continue to have the launcher
put the native module location on the `$PATH`. And we'll include them
in the SDK for a while longer.

Fixes #1177
2018-04-13 14:26:32 -07:00
Sean Gillespie 682f908e77
Implement scope chain free variable lookup in pure TypeScript (#1139)
* Implement closure scope chain analysis in pure TypeScript

This change makes use of four V8 intrinsics to avoid having to use a
native module to inspect the scope chains of live Function objects. This
unfortunately leads to the limitation of not allowing captures of 'this'
in arrow functions, but that is something we are willing to live with
for now.

* Remove native module build and restore from the Makefile

* CR feedback: Be a little more efficient when scanning the scope chain

* Nuke everything related to custom Node versions and the native Node module

* CR feedback: rename native.ts -> v8.ts, document some interfaces in v8.ts
2018-04-10 10:04:11 -07:00
joeduffy 365a96f9ad Add custom NODE_PATH to resource cmd 2018-02-19 18:45:12 -08:00
joeduffy e4cf4e3b31 Delete errant plugin command 2018-02-19 13:37:59 -08:00
joeduffy ca3516d3e5 Fix language script merge 2018-02-18 08:08:15 -08:00
joeduffy 548c22d014 Reimplement GetRequiredPlugins in Go
This brings back the Node.js language plugin's GetRequiredPlugins
function, reimplemented in Go now that the language host has been
rewritten from JavaScript.  Fairly rote translation, along with
some random fixes required to get tests passing again.
2018-02-18 08:08:15 -08:00