Invocation describes one `nocc` invocation inside a daemon. When `nocc g++ ...` is called, it pipes cmdLine to a background Daemon, which serves them in parallel. If this invocation is to compile .cpp to .o, it maps bidirectionally to server.Session.
| 20 | // When `nocc g++ ...` is called, it pipes cmdLine to a background Daemon, which serves them in parallel. |
| 21 | // If this invocation is to compile .cpp to .o, it maps bidirectionally to server.Session. |
| 22 | type Invocation struct { |
| 23 | invokeType int // one of the constants above |
| 24 | err error // any error occurred while parsing/uploading/compiling/receiving |
| 25 | |
| 26 | createTime time.Time // used for local timeout |
| 27 | sessionID uint32 // incremental while a daemon is alive |
| 28 | |
| 29 | // cmdLine is parsed to the following fields: |
| 30 | cppInFile string // input file as specified in cmd line (.cpp for compilation, .h for pch generation) |
| 31 | objOutFile string // output file as specified in cmd line (.o for compilation, .gch/.pch for pch generation) |
| 32 | cxxName string // g++ / clang / etc. |
| 33 | cxxArgs []string // args like -Wall, -fpch-preprocess and many more, except: |
| 34 | cxxIDirs IncludeDirs // -I / -iquote / -isystem go here |
| 35 | depsFlags DepCmdFlags // -MD -MF file and others, used for .d files generation (not passed to server) |
| 36 | |
| 37 | waitUploads int32 // files still waiting for upload to finish; 0 releases wgUpload; see Invocation.DoneUploadFile |
| 38 | doneRecv int32 // 1 if o file received or failed receiving; 1 releases wgRecv; see Invocation.DoneRecvObj |
| 39 | wgUpload sync.WaitGroup |
| 40 | wgRecv sync.WaitGroup |
| 41 | |
| 42 | // when remote compilation starts, the server starts a server.Session (with the same sessionID) |
| 43 | // after it finishes, we have these fields filled (and objOutFile saved) |
| 44 | cxxExitCode int |
| 45 | cxxStdout []byte |
| 46 | cxxStderr []byte |
| 47 | cxxDuration int32 |
| 48 | |
| 49 | summary *InvocationSummary |
| 50 | includesCache *IncludesCache // = Daemon.includesCache[cxxName] |
| 51 | } |
| 52 | |
| 53 | func isSourceFileName(fileName string) bool { |
| 54 | return strings.HasSuffix(fileName, ".cpp") || |
nothing calls this directly
no outgoing calls
no test coverage detected