Documentation ¶
Index ¶
- Constants
- Variables
- func EscapeArg(s string) string
- func MakeCmdLine(args []string) string
- func NewTaskCL() handler.Handler
- type TaskCL
- func (cl *TaskCL) CanExecuteWithLocalIdleResource(command []string) bool
- func (cl *TaskCL) FinalExecute(args []string)
- func (cl *TaskCL) GetFilterRules() ([]dcSDK.FilterRuleItem, error)
- func (cl *TaskCL) GetPreloadConfig(config dcType.BoosterConfig) (*dcSDK.PreloadConfig, error)
- func (cl *TaskCL) GetPreprocessedBuf() string
- func (cl *TaskCL) Includes(responseFile string, args []string, workdir string, forcefresh bool) ([]*dcFile.Info, error)
- func (cl *TaskCL) InitExtra(extra []byte)
- func (cl *TaskCL) InitSandbox(sandbox *dcSyscall.Sandbox)
- func (cl *TaskCL) LocalExecute(command []string) dcType.BKDistCommonError
- func (cl *TaskCL) LocalExecuteNeed(command []string) bool
- func (cl *TaskCL) LocalLockWeight(command []string) int32
- func (cl *TaskCL) NeedRemoteResource(command []string) bool
- func (cl *TaskCL) NeedRetryOnRemoteFail(command []string) bool
- func (cl *TaskCL) OnRemoteFail(command []string) (*dcSDK.BKDistCommand, dcType.BKDistCommonError)
- func (cl *TaskCL) PostExecute(r *dcSDK.BKDistResult) dcType.BKDistCommonError
- func (cl *TaskCL) PostExecuteNeedLock(result *dcSDK.BKDistResult) bool
- func (cl *TaskCL) PostLockWeight(result *dcSDK.BKDistResult) int32
- func (cl *TaskCL) PostWork(config *dcType.BoosterConfig) error
- func (cl *TaskCL) PreExecute(command []string) (*dcSDK.BKDistCommand, dcType.BKDistCommonError)
- func (cl *TaskCL) PreExecuteNeedLock(command []string) bool
- func (cl *TaskCL) PreLockWeight(command []string) int32
- func (cl *TaskCL) PreWork(config *dcType.BoosterConfig) error
- func (cl *TaskCL) RemoteRetryTimes() int
- func (cl *TaskCL) RenderArgs(config dcType.BoosterConfig, originArgs string) string
- func (cl *TaskCL) ResultExtra() []byte
- func (cl *TaskCL) SetDepend(f string)
Constants ¶
const (
MaxWindowsCommandLength = 30000
)
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") ErrorNoResultFile = fmt.Errorf("no result file") ErrorNotSupportE = fmt.Errorf("/E /EP /P must be local") ErrorNotSupportYc = fmt.Errorf("/Yc must be local") ErrorNotSupportYcStart = fmt.Errorf("option start with /Yc must be local") ErrorNotSupportOutputStdout = fmt.Errorf("output to stdout, must be local") ErrorNoPumpHeadFile = fmt.Errorf("pump head file not exist") ErrorNoDependFile = fmt.Errorf("depend file not exist") ErrorInvalidDependFile = fmt.Errorf("depend file invalid") ErrorNotRemoteTask = fmt.Errorf("not remote task") ErrorNotSupportRemote = fmt.Errorf("not support to remote execute") ErrorInPumpBlack = fmt.Errorf("in pump black list") )
errors for cl.exe
var ( // ForceLocalFileKeys force some module to compile locally // /GL for ProxyLOD // wrong inlcude for NetCore by user // unsuport PUSH_MACRO and POP_MACRO in NvClothIncludes.h for ClothingSystemRuntime DefaultForceLocalResponseFileKeys = []string{ "dte80a", "ProxyLOD", "NetCore", "ClothingSystemRuntime", "Module.LuaTools.cpp", "Module.Client.1_of_4.cpp", "Module.HoloLensTargetPlatform.cpp", "msado15.cpp", } // ForceLocalCppFileKeys force some cpp to compile locally DefaultForceLocalCppFileKeys = []string{ "dte80a", "ProxyLOD", "NetCore", "ClothingSystemRuntime", "Module.LuaTools.cpp", "Module.Client.1_of_4.cpp", "Module.HoloLensTargetPlatform.cpp", "msado15.cpp", } // DisabledWarnings for ue4 ,disable some warnings DisabledWarnings = []string{"/wd4828"} )
Functions ¶
func EscapeArg ¶
EscapeArg rewrites command line argument s as prescribed in https://msdn.microsoft.com/en-us/library/ms880421. This function returns "" (2 double quotes) if s is empty. Alternatively, these transformations are done:
- every back slash (\) is doubled, but only if immediately followed by double quote (");
- every double quote (") is escaped by back slash (\);
- finally, s is wrapped with double quotes (arg -> "arg"), but only if there is space or tab inside s.
func MakeCmdLine ¶
MakeCmdLine builds a command line out of args by escaping "special" characters and joining the arguments with spaces.
Types ¶
type TaskCL ¶
type TaskCL struct { ForceLocalResponseFileKeys []string ForceLocalCppFileKeys []string // contains filtered or unexported fields }
TaskCL 定义了cl.exe编译的描述处理对象, 一般用来处理ue4-win下的cl编译
func (*TaskCL) CanExecuteWithLocalIdleResource ¶
func (*TaskCL) GetFilterRules ¶
func (cl *TaskCL) GetFilterRules() ([]dcSDK.FilterRuleItem, error)
GetFilterRules add file send filter
func (*TaskCL) GetPreloadConfig ¶
func (cl *TaskCL) GetPreloadConfig(config dcType.BoosterConfig) (*dcSDK.PreloadConfig, error)
GetPreloadConfig get preload config
func (*TaskCL) GetPreprocessedBuf ¶
GetPreprocessedBuf return preprocessedErrorBuf
func (*TaskCL) Includes ¶
func (cl *TaskCL) Includes(responseFile string, args []string, workdir string, forcefresh bool) ([]*dcFile.Info, error)
search all include files for this compile command
func (*TaskCL) InitSandbox ¶
InitSandbox set sandbox to task-cl
func (*TaskCL) LocalExecute ¶
func (cl *TaskCL) LocalExecute(command []string) dcType.BKDistCommonError
LocalExecute no need
func (*TaskCL) LocalExecuteNeed ¶
LocalExecuteNeed no need
func (*TaskCL) LocalLockWeight ¶
LocalLockWeight decide local-execute lock weight, default 1
func (*TaskCL) NeedRemoteResource ¶
NeedRemoteResource check whether this command need remote resource
func (*TaskCL) NeedRetryOnRemoteFail ¶
NeedRetryOnRemoteFail check whether need retry on remote fail
func (*TaskCL) OnRemoteFail ¶
func (cl *TaskCL) OnRemoteFail(command []string) (*dcSDK.BKDistCommand, dcType.BKDistCommonError)
TODO : OnRemoteFail give chance to try other way if failed to remote execute
func (*TaskCL) PostExecute ¶
func (cl *TaskCL) PostExecute(r *dcSDK.BKDistResult) dcType.BKDistCommonError
PostExecute 后置处理
func (*TaskCL) PostExecuteNeedLock ¶
func (cl *TaskCL) PostExecuteNeedLock(result *dcSDK.BKDistResult) bool
PostExecuteNeedLock 防止回传的文件读写跑满本机磁盘
func (*TaskCL) PostLockWeight ¶
func (cl *TaskCL) PostLockWeight(result *dcSDK.BKDistResult) int32
PostLockWeight decide post-execute lock weight, default 1
func (*TaskCL) PostWork ¶
func (cl *TaskCL) PostWork(config *dcType.BoosterConfig) error
PostWork no need
func (*TaskCL) PreExecute ¶
func (cl *TaskCL) PreExecute(command []string) (*dcSDK.BKDistCommand, dcType.BKDistCommonError)
PreExecute 预处理
func (*TaskCL) PreExecuteNeedLock ¶
PreExecuteNeedLock 防止预处理跑满本机CPU
func (*TaskCL) PreLockWeight ¶
PreLockWeight decide pre-execute lock weight, default 1
func (*TaskCL) PreWork ¶
func (cl *TaskCL) PreWork(config *dcType.BoosterConfig) error
PreWork no need
func (*TaskCL) RemoteRetryTimes ¶
RemoteRetryTimes will return the remote retry times
func (*TaskCL) RenderArgs ¶
func (cl *TaskCL) RenderArgs(config dcType.BoosterConfig, originArgs string) string
RenderArgs no need change