parse

package
v8.7.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2017 License: Apache-2.0 Imports: 16 Imported by: 18

Documentation

Overview

Package responsible for parsing build files and constructing build targets & the graph.

The actual work here is done by an embedded PyPy instance. Various rules are built in to the binary itself using go-bindata to embed the .py files; these are always available to all programs which is rather nice, but it does mean that must be run before 'go run' etc will work as expected.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(cTarget uintptr, cConfig *C.char, cCommand *C.char) *C.char

func AddData

func AddData(cTarget uintptr, cData *C.char) *C.char

func AddDep

func AddDep(cTarget uintptr, cDep *C.char) *C.char

func AddDependency

func AddDependency(cPackage uintptr, cTarget *C.char, cDep *C.char, exported bool) *C.char

func AddExportedDep

func AddExportedDep(cTarget uintptr, cDep *C.char) *C.char

func AddHash

func AddHash(cTarget uintptr, cHash *C.char) *C.char

func AddLabel

func AddLabel(cTarget uintptr, cLabel *C.char) *C.char

func AddLicence

func AddLicence(cTarget uintptr, cLicence *C.char) *C.char

func AddLicencePost

func AddLicencePost(cPackage uintptr, cTarget *C.char, cLicence *C.char) *C.char

func AddNamedOutput

func AddNamedOutput(cTarget uintptr, cName *C.char, cOutput *C.char) *C.char

func AddNamedOutputPost

func AddNamedOutputPost(cPackage uintptr, cTarget, cName, cOut *C.char) *C.char

func AddNamedSource

func AddNamedSource(cTarget uintptr, cName *C.char, cSource *C.char) *C.char

func AddNamedTool

func AddNamedTool(cTarget uintptr, cName *C.char, cTool *C.char) *C.char

func AddOptionalOutput

func AddOptionalOutput(cTarget uintptr, cOutput *C.char) *C.char

func AddOutput

func AddOutput(cTarget uintptr, cOutput *C.char) *C.char

func AddOutputPost

func AddOutputPost(cPackage uintptr, cTarget, cOut *C.char) *C.char

func AddProvide

func AddProvide(cTarget uintptr, cLanguage *C.char, cDep *C.char) *C.char

func AddRequire

func AddRequire(cTarget uintptr, cRequire *C.char) *C.char

func AddSecret

func AddSecret(cTarget uintptr, cSecret *C.char) *C.char

func AddSource

func AddSource(cTarget uintptr, cSource *C.char) *C.char

func AddTarget

func AddTarget(pkgPtr uintptr, cName, cCmd, cTestCmd *C.char, binary, test, needsTransitiveDeps,
	outputIsComplete, containerise, sandbox, testSandbox, noTestOutput, testOnly, stamp, filegroup, hashFilegroup bool,
	flakiness, buildTimeout, testTimeout int, cBuildingDescription *C.char) (ret C.size_t)

func AddTestCommand

func AddTestCommand(cTarget uintptr, cConfig *C.char, cCommand *C.char) *C.char

func AddTestOutput

func AddTestOutput(cTarget uintptr, cTestOutput *C.char) *C.char

func AddTool

func AddTool(cTarget uintptr, cTool *C.char) *C.char

func AddVis

func AddVis(cTarget uintptr, cVis *C.char) *C.char

func GetCommand

func GetCommand(cPackage uintptr, cTarget *C.char, cConfig *C.char) *C.char

func GetIncludeFile

func GetIncludeFile(cPackage uintptr, cLabel *C.char) *C.char

GetIncludeFile is a callback to the interpreter that returns the path it should be opening in order to include_defs() a file. We use in-band signalling for some errors since C can't handle multiple return values :)

func GetLabels

func GetLabels(cPackage uintptr, cTarget *C.char, cPrefix *C.char) **C.char

func GetSubincludeFile

func GetSubincludeFile(cPackage uintptr, cLabel *C.char) *C.char

GetSubincludeFile is a callback to the interpreter that returns the path it should be opening in order to subinclude() a build target. We use in-band signalling for some errors since C can't handle multiple return values :)

func Glob

func Glob(cPackage *C.char, cIncludes **C.char, numIncludes int, cExcludes **C.char, numExcludes int, includeHidden bool) **C.char

func IsValidTargetName

func IsValidTargetName(name *C.char) bool

IsValidTargetName returns true if the given name is valid in a package. This is provided to help error handling on the Python side.

func Log

func Log(level int, cPackage uintptr, cMessage *C.char)

func Parse

func Parse(tid int, state *core.BuildState, label, dependor core.BuildLabel, noDeps bool, include, exclude []string, forSubinclude bool)

Parses the package corresponding to a single build label. The label can be :all to add all targets in a package. It is not an error if the package has already been parsed.

By default, after the package is parsed, any targets that are now needed for the build and ready to be built are queued, and any new packages are queued for parsing. When a specific label is requested this is straightforward, but when parsing for pseudo-targets like :all and ..., various flags affect it: If 'noDeps' is true, then no new packages will be added and no new targets queued. 'include' and 'exclude' refer to the labels of targets to be added. If 'include' is non-empty then only targets with at least one matching label are added. Any targets with a label in 'exclude' are not added. 'forSubinclude' is set when the parse is required for a subinclude target so should proceed even when we're not otherwise building targets.

func RunCode

func RunCode(state *core.BuildState, code string) error

RunCode will run some arbitrary Python code using our embedded interpreter.

func RunPostBuildFunction

func RunPostBuildFunction(tid int, state *core.BuildState, target *core.BuildTarget, out string) error

RunPostBuildFunction runs a post-build callback function registered on a build target via post_build = <...>.

This is called after the target has been built and it is given the combined stdout/stderr of the build process. This output is passed to the post-build Python function which can then generate new targets or add dependencies to existing unbuilt targets.

func RunPreBuildFunction

func RunPreBuildFunction(tid int, state *core.BuildState, target *core.BuildTarget) error

RunPreBuildFunction runs a pre-build callback function registered on a build target via pre_build = <...>.

This is called before the target is built. It doesn't receive any output like the post-build one does but can be useful for other things; for example if you want to investigate a target's transitive labels to adjust its build command, you have to do that here (because in general the transitive dependencies aren't known when the rule is evaluated).

func SetCommand

func SetCommand(cPackage uintptr, cTarget *C.char, cConfigOrCommand *C.char, cCommand *C.char) *C.char

func SetContainerSetting

func SetContainerSetting(cTarget uintptr, cName, cValue *C.char) *C.char

func SetPostBuildFunction

func SetPostBuildFunction(callback uintptr, cBytecode *C.char, cTarget uintptr)

func SetPreBuildFunction

func SetPreBuildFunction(callback uintptr, cBytecode *C.char, cTarget uintptr)

func UndeferAnyParses

func UndeferAnyParses(state *core.BuildState, target *core.BuildTarget)

UndeferAnyParses un-defers the parsing of a package if it depended on some subinclude target being built.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL