pulumi/pkg/compiler
joeduffy d100f77b9c Implement dependency resolution
This change includes logic to resolve dependencies declared by stacks.  The design
is described in https://github.com/marapongo/mu/blob/master/docs/deps.md.

In summary, each stack may declare dependencies, which are name/semver pairs.  A
new structure has been introduced, ast.Ref, to distinguish between ast.Names and
dependency names.  An ast.Ref includes a protocol, base part, and a name part (the
latter being an ast.Name); for example, in "https://hub.mu.com/mu/container/",
"https://" is the protocol, "hub.mu.com/" is the base, and "mu/container" is the
name.  This is used to resolve URL-like names to package manager-like artifacts.

The dependency resolution phase happens after parsing, but before semantic analysis.
This is because dependencies are "source-like" in that we must load and parse all
dependency metadata files.  We stick the full transitive closure of dependencies
into a map attached to the compiler to avoid loading dependencies multiple times.
Note that, although dependencies prohibit cycles, this forms a DAG, meaning multiple
inbound edges to a single stack may come from multiple places.

From there, we rely on ordinary visitation to deal with dependencies further.
This includes inserting symbol entries into the symbol table, mapping names to the
loaded stacks, during the first phase of binding so that they may be found
subsequently when typechecking during the second phase and beyond.
2016-11-21 11:19:25 -08:00
..
backends Use assertions in more places 2016-11-19 16:13:13 -08:00
core Implement dependency resolution 2016-11-21 11:19:25 -08:00
predef Fix a type assertion (should be string, not ast.Name) 2016-11-19 11:22:58 -08:00
testdata Rearrange workspace logic 2016-11-20 08:20:19 -08:00
binder.go Implement dependency resolution 2016-11-21 11:19:25 -08:00
binder_test.go Add some targeting tests 2016-11-17 13:08:20 -08:00
common_test.go Rename BuildJSON/BuildYAML to just BuildFile 2016-11-17 15:13:36 -08:00
compiler.go Implement dependency resolution 2016-11-21 11:19:25 -08:00
compiler_test.go Add Stack subclassing 2016-11-18 17:30:32 -08:00
opts.go Add a Backend interface, and dispatch to it 2016-11-18 12:40:15 -08:00
parser.go Use assertions in more places 2016-11-19 16:13:13 -08:00
parsetree.go Implement dependency resolution 2016-11-21 11:19:25 -08:00
parsetree_test.go Add some targeting tests 2016-11-17 13:08:20 -08:00
symbols.go Add rudimentary type binding 2016-11-16 18:55:20 -08:00