Documentation
¶
Overview ¶
Package builder is the compiler driver of TinyGo. It takes in a package name and an output path, and outputs an executable. It manages the entire compilation pipeline in between.
Index ¶
- func Build(pkgName, outpath string, config *compileopts.Config, action func(string) error) error
- func CompileBuiltins(target string, callback func(path string) error) error
- func GorootVersionString(goroot string) (string, error)
- func NewConfig(options *compileopts.Options) (*compileopts.Config, error)
- type MultiError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build performs a single package to executable Go build. It takes in a package name, an output path, and set of compile options and from that it manages the whole compilation process.
The error value may be of type *MultiError. Callers will likely want to check for this case and print such errors individually.
func CompileBuiltins ¶
CompileBuiltins compiles builtins from compiler-rt into a static library. When it succeeds, it will call the callback with the resulting path. The path will be removed after callback returns. If callback returns an error, this is passed through to the return value of this function.
func GorootVersionString ¶
GorootVersionString returns the version string as reported by the Go toolchain for the given GOROOT path. It is usually of the form `go1.x.y` but can have some variations (for beta releases, for example).
func NewConfig ¶
func NewConfig(options *compileopts.Options) (*compileopts.Config, error)
NewConfig builds a new Config object from a set of compiler options. It also loads some information from the environment while doing that. For example, it uses the currently active GOPATH (from the goenv package) to determine the Go version to use.
Types ¶
type MultiError ¶
type MultiError struct {
Errs []error
}
MultiError is a list of multiple errors (actually: diagnostics) returned during LLVM IR generation.
func (*MultiError) Error ¶
func (e *MultiError) Error() string