MCPcopy Create free account
hub / github.com/VKCOM/nocc / ObjFileCache

Struct ObjFileCache

internal/server/obj-cache.go:18–24  ·  view source on GitHub ↗

ObjFileCache is a /tmp/nocc/obj/obj-cache directory, where the resulting .o files are saved. Its purpose is to reuse a ready .o file if the same .cpp is requested to be compiled again. This is especially useful to share .o files across build agents: if one build agent compiles the master branch, oth

Source from the content-addressed store, hash-verified

16// The hardest problem is how to detect that "this .cpp was already compiled, we can use .o".
17// See ObjFileCache.MakeObjCacheKey.
18type ObjFileCache struct {
19 *FileCache
20
21 // next to obj-cache, there is a /tmp/nocc/obj/cxx-out directory (session.objOutFile point here)
22 // after being compiled, files from here are hard linked to obj-cache
23 objTmpDir string
24}
25
26func MakeObjFileCache(cacheDir string, objTmpDir string, limitBytes int64) (*ObjFileCache, error) {
27 cache, err := MakeFileCache(cacheDir, limitBytes)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected