cl

package
v0.0.0-...-6ac6f58 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxWindowsCommandLength = 30000
)

Variables

View Source
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

View Source
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

func EscapeArg(s string) string

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

func MakeCmdLine(args []string) string

MakeCmdLine builds a command line out of args by escaping "special" characters and joining the arguments with spaces.

func NewTaskCL

func NewTaskCL() handler.Handler

NewTaskCL get a new cl-handler

Types

type TaskCL

type TaskCL struct {
	ForceLocalResponseFileKeys []string
	ForceLocalCppFileKeys      []string
	// contains filtered or unexported fields
}

TaskCL 定义了cl.exe编译的描述处理对象, 一般用来处理ue4-win下的cl编译

func NewCL

func NewCL() *TaskCL

++for cl-filter

func (*TaskCL) FinalExecute

func (cl *TaskCL) FinalExecute(args []string)

FinalExecute 清理临时文件

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

func (cl *TaskCL) GetPreprocessedBuf() string

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) InitExtra

func (cl *TaskCL) InitExtra(extra []byte)

InitExtra no need

func (*TaskCL) InitSandbox

func (cl *TaskCL) InitSandbox(sandbox *dcSyscall.Sandbox)

InitSandbox set sandbox to task-cl

func (*TaskCL) LocalExecute

func (cl *TaskCL) LocalExecute(command []string) (int, error)

LocalExecute no need

func (*TaskCL) LocalExecuteNeed

func (cl *TaskCL) LocalExecuteNeed(command []string) bool

LocalExecuteNeed no need

func (*TaskCL) LocalLockWeight

func (cl *TaskCL) LocalLockWeight(command []string) int32

LocalLockWeight decide local-execute lock weight, default 1

func (*TaskCL) NeedRemoteResource

func (cl *TaskCL) NeedRemoteResource(command []string) bool

NeedRemoteResource check whether this command need remote resource

func (*TaskCL) OnRemoteFail

func (cl *TaskCL) OnRemoteFail(command []string) (*dcSDK.BKDistCommand, error)

TODO : OnRemoteFail give chance to try other way if failed to remote execute

func (*TaskCL) PostExecute

func (cl *TaskCL) PostExecute(r *dcSDK.BKDistResult) error

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, error)

PreExecute 预处理

func (*TaskCL) PreExecuteNeedLock

func (cl *TaskCL) PreExecuteNeedLock(command []string) bool

PreExecuteNeedLock 防止预处理跑满本机CPU

func (*TaskCL) PreLockWeight

func (cl *TaskCL) PreLockWeight(command []string) int32

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

func (cl *TaskCL) RemoteRetryTimes() int

RemoteRetryTimes will return the remote retry times

func (*TaskCL) RenderArgs

func (cl *TaskCL) RenderArgs(config dcType.BoosterConfig, originArgs string) string

RenderArgs no need change

func (*TaskCL) ResultExtra

func (cl *TaskCL) ResultExtra() []byte

ResultExtra no need

func (*TaskCL) SetDepend

func (cl *TaskCL) SetDepend(f string)

Jump to

Keyboard shortcuts

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