weberc2 / builder

Prototype build tool
0 stars 0 forks source link

Allow importing BUILD files #19

Closed weberc2 closed 5 years ago

weberc2 commented 5 years ago

Rather than using reftarget() to address other targets from BUILD files, we should allow importing/loading them and referencing them using their symbols in the starlark language.

Considerations

weberc2 commented 5 years ago

This is largely addressed by cb8a0eb0e999f09e0fa1bca863c7d274c958438a. There is now a distinction between loading packages (BUILD files) and loading libraries (.star files). Libraries must be loaded via load("lib://path/to/lib", ...) where the path must point to a .star file. Libraries may also load other libraries but not targets, and libraries may also not invoke mktarget directly. This may change in the future, especially concerning libraries that would like to add a dependency (e.g., the py_test function creates Python test targets which should each depend on the pytest target).