diff --git a/src/backend/booster/bk_dist/handler/ue4/cl/handler.go b/src/backend/booster/bk_dist/handler/ue4/cl/handler.go index c6542992..9e845b75 100644 --- a/src/backend/booster/bk_dist/handler/ue4/cl/handler.go +++ b/src/backend/booster/bk_dist/handler/ue4/cl/handler.go @@ -110,6 +110,7 @@ type TaskCL struct { // 在rsp中/I后面的参数,需要将这些目录全部发送到远端 // 有特殊场景:编译不需要该路径下的文件,但需要该路径作为跳板,去查找其它相对路径下的头文件(或其它依赖文件) includePaths []string + logfilesarif string // forcedepend 是我们主动导出依赖文件,showinclude 是编译命令已经指定了导出依赖文件 forcedepend bool @@ -677,11 +678,12 @@ func (cl *TaskCL) trypump(command []string) (*dcSDK.BKDistCommand, error, error) tstart = tend // check whether support remote execute - _, err = scanArgs(args) + scandata, err := scanArgs(args) if err != nil { blog.Debugf("cl: try pump not support, scan args %v: %v", args, err) return nil, err, ErrorNotSupportRemote } + cl.logfilesarif = scandata.logfilesarif inblack, _ := cl.inPumpBlack(responseFile, args) if inblack { @@ -775,6 +777,12 @@ func (cl *TaskCL) trypump(command []string) (*dcSDK.BKDistCommand, error, error) if sourcedependfile != "" { results = append(results, sourcedependfile) } + if cl.logfilesarif != "" { + if !filepath.IsAbs(cl.logfilesarif) { + cl.logfilesarif, _ = filepath.Abs(filepath.Join(cl.sandbox.Dir, cl.logfilesarif)) + } + results = append(results, cl.logfilesarif) + } // set env which need append to remote envs := []string{} @@ -1016,6 +1024,11 @@ func (cl *TaskCL) preExecute(command []string) (*dcSDK.BKDistCommand, dcType.BKD } cl.customSave = true + results := []string{cl.outputFile} + if cl.logfilesarif != "" { + results = append(results, cl.logfilesarif) + } + return &dcSDK.BKDistCommand{ Commands: []dcSDK.BKCommand{ { @@ -1025,9 +1038,7 @@ func (cl *TaskCL) preExecute(command []string) (*dcSDK.BKDistCommand, dcType.BKD ExeToolChainKey: dcSDK.GetJsonToolChainKey(command[0]), Params: params, Inputfiles: inputFiles, - ResultFiles: []string{ - cl.outputFile, - }, + ResultFiles: results, }, }, CustomSave: true, @@ -1175,6 +1186,7 @@ func (cl *TaskCL) preBuild(args []string) error { cl.rewriteCrossArgs = cl.scannedArgs cl.includeRspFiles = scannedData.includeRspFiles cl.includePaths = scannedData.includePaths + cl.logfilesarif = scannedData.logfilesarif // handle the pch options finalArgs := cl.scanPchFile(cl.scannedArgs) diff --git a/src/backend/booster/bk_dist/handler/ue4/cl/utils.go b/src/backend/booster/bk_dist/handler/ue4/cl/utils.go index e1fddcf3..fd8b1ae9 100644 --- a/src/backend/booster/bk_dist/handler/ue4/cl/utils.go +++ b/src/backend/booster/bk_dist/handler/ue4/cl/utils.go @@ -603,8 +603,13 @@ type ccArgs struct { specifiedSourceType bool includeRspFiles []string includePaths []string + logfilesarif string // for ue 5.5 } +const ( + logsarifflag = "/experimental:log" +) + // scanArgs receive the complete compiling args, and the first item should always be a compiler name. func scanArgs(args []string) (*ccArgs, error) { blog.Debugf("cl: scanning arguments: %v", args) @@ -669,6 +674,23 @@ func scanArgs(args []string) (*ccArgs, error) { continue } + if strings.HasPrefix(arg, logsarifflag) { + // if just a prefix, save the remain of this line. + if len(arg) > len(logsarifflag) { + r.logfilesarif = strings.Trim(arg[len(logsarifflag):], "\"") + continue + } + + // if file name is in the next index, then take it. + index++ + if index >= len(args) { + blog.Warnf("cl: scan args: no file found after %s", logsarifflag) + return nil, ErrorMissingOption + } + r.logfilesarif = strings.Trim(args[index], "\"") + continue + } + if strings.HasPrefix(arg, "/Fo") { // /Fo should always appear once. if seenOptionO {