Documentation ¶
Index ¶
- Variables
- func NewTaskCC() (handler.Handler, error)
- type ProjectExtraData
- type TaskCC
- func (cc *TaskCC) FinalExecute(args []string)
- func (cc *TaskCC) GetFilterRules() ([]dcSDK.FilterRuleItem, error)
- func (cc *TaskCC) GetPreloadConfig(config dcType.BoosterConfig) (*dcSDK.PreloadConfig, error)
- func (cc *TaskCC) InitExtra(extra []byte)
- func (cc *TaskCC) InitSandbox(sandbox *dcSyscall.Sandbox)
- func (cc *TaskCC) LocalExecute(command []string) (int, error)
- func (cc *TaskCC) LocalExecuteNeed(command []string) bool
- func (cc *TaskCC) LocalLockWeight(command []string) int32
- func (cc *TaskCC) NeedRemoteResource(command []string) bool
- func (cc *TaskCC) OnRemoteFail(command []string) (*dcSDK.BKDistCommand, error)
- func (cc *TaskCC) PostExecute(r *dcSDK.BKDistResult) error
- func (cc *TaskCC) PostExecuteNeedLock(result *dcSDK.BKDistResult) bool
- func (cc *TaskCC) PostLockWeight(result *dcSDK.BKDistResult) int32
- func (cc *TaskCC) PostWork(config *dcType.BoosterConfig) error
- func (cc *TaskCC) PreExecute(command []string) (*dcSDK.BKDistCommand, error)
- func (cc *TaskCC) PreExecuteNeedLock(command []string) bool
- func (cc *TaskCC) PreLockWeight(command []string) int32
- func (cc *TaskCC) PreWork(config *dcType.BoosterConfig) error
- func (cc *TaskCC) RemoteRetryTimes() int
- func (cc *TaskCC) RenderArgs(config dcType.BoosterConfig, originArgs string) string
- func (cc *TaskCC) ResultExtra() []byte
Constants ¶
This section is empty.
Variables ¶
var ( ErrorMissingOption = fmt.Errorf("missing option/operand") ErrorInvalidOption = fmt.Errorf("invalid option/operand") ErrorUnrecognizedOption = fmt.Errorf("unrecognized option") ErrorNoAvailable4Remote = fmt.Errorf("no available for remote") ErrorFileNotExist = fmt.Errorf("file/path not exist") ErrorFileInvalid = fmt.Errorf("file/path invalid") ErrorInvalidParam = fmt.Errorf("param is invalid") ErrorNotSupportE = fmt.Errorf("-E must be local") ErrorNotSupportMarchNative = fmt.Errorf("-march=native must be local") ErrorNotSupportMtuneNative = fmt.Errorf("-mtune=native must be local") ErrorNotSupportFrepo = fmt.Errorf("-frepo must be local") ErrorNotSupportM = fmt.Errorf("-M must be local") ErrorNotSupportWa = fmt.Errorf("-Wa[,-a|--MD] must be local") ErrorNotSupportSpecs = fmt.Errorf("-specs= must be local") ErrorNotSupportX = fmt.Errorf("-x must be local") ErrorNotSupportDr = fmt.Errorf("-dr must be local") ErrorNotSupportConftest = fmt.Errorf("tmp.conftest. must be local") ErrorNotSupportOutputStdout = fmt.Errorf("output with - to stdout, must be local") ErrorNotSupportGch = fmt.Errorf("output with .gch, must be local") )
define errors
var (
DefaultForceLocalCppFileKeys = make([]string, 0, 0)
)
Functions ¶
Types ¶
type ProjectExtraData ¶
type ProjectExtraData struct { CCacheEnable bool `json:"ccache_enable"` CCacheEnabled bool `json:"ccache_enabled"` }
ProjectExtraData describe the extra data store in project ccache_enable and ccache_enabled are both to control ccache usage, if one of them is true, then ccache enabled.
type TaskCC ¶
type TaskCC struct { ForceLocalCppFileKeys []string // contains filtered or unexported fields }
TaskCC 定义了c/c++编译的描述处理对象
func (*TaskCC) GetFilterRules ¶
func (cc *TaskCC) GetFilterRules() ([]dcSDK.FilterRuleItem, error)
GetFilterRules add file send filter
func (*TaskCC) GetPreloadConfig ¶
func (cc *TaskCC) GetPreloadConfig(config dcType.BoosterConfig) (*dcSDK.PreloadConfig, error)
GetPreloadConfig 获取preload配置
func (*TaskCC) InitSandbox ¶
InitSandbox set sandbox to task-cc
func (*TaskCC) LocalExecute ¶
LocalExecute 无需自定义本地处理
func (*TaskCC) LocalExecuteNeed ¶
LocalExecuteNeed 无需自定义本地处理
func (*TaskCC) LocalLockWeight ¶
LocalLockWeight decide local-execute lock weight, default 1
func (*TaskCC) NeedRemoteResource ¶
NeedRemoteResource check whether this command need remote resource
func (*TaskCC) OnRemoteFail ¶
func (cc *TaskCC) OnRemoteFail(command []string) (*dcSDK.BKDistCommand, error)
OnRemoteFail give chance to try other way if failed to remote execute
func (*TaskCC) PostExecute ¶
func (cc *TaskCC) PostExecute(r *dcSDK.BKDistResult) error
PostExecute 后置处理, 判断远程执行的结果是否正确
func (*TaskCC) PostExecuteNeedLock ¶
func (cc *TaskCC) PostExecuteNeedLock(result *dcSDK.BKDistResult) bool
PostExecuteNeedLock 不需要post-lock
func (*TaskCC) PostLockWeight ¶
func (cc *TaskCC) PostLockWeight(result *dcSDK.BKDistResult) int32
PostLockWeight decide post-execute lock weight, default 1
func (*TaskCC) PostWork ¶
func (cc *TaskCC) PostWork(config *dcType.BoosterConfig) error
PostWork 处理整个编译的后置工作, 收集ccache数据
func (*TaskCC) PreExecute ¶
func (cc *TaskCC) PreExecute(command []string) (*dcSDK.BKDistCommand, error)
PreExecute 预处理
func (*TaskCC) PreExecuteNeedLock ¶
PreExecuteNeedLock 如果编译本身是预处理, 那么不需要pre-lock, 因为它会在pre-execute中转本地, 不会真正地执行预处理
func (*TaskCC) PreLockWeight ¶
PreLockWeight decide pre-execute lock weight, default 1
func (*TaskCC) PreWork ¶
func (cc *TaskCC) PreWork(config *dcType.BoosterConfig) error
PreWork 处理整个编译的前置工作, 例如清除ccache数据缓存, 更新launcher脚本等
func (*TaskCC) RemoteRetryTimes ¶
RemoteRetryTimes will return the remote retry times
func (*TaskCC) RenderArgs ¶
func (cc *TaskCC) RenderArgs(config dcType.BoosterConfig, originArgs string) string
RenderArgs receive the user's origin commands, and render some extra thins to it For instance: bazel command should be add extra --action_env
func (*TaskCC) ResultExtra ¶
ResultExtra generate the extra result data to upload stats