diff --git a/builder/buildcache.go b/builder/buildcache.go index 83f077bc..b673de06 100644 --- a/builder/buildcache.go +++ b/builder/buildcache.go @@ -30,10 +30,7 @@ func cacheTimestamp(paths []string) (time.Time, error) { // Try to load a given file from the cache. Return "", nil if no cached file can // be found (or the file is stale), return the absolute path if there is a cache // and return an error on I/O errors. -// -// TODO: the configKey is currently ignored. It is supposed to be used as extra -// data for the cache key, like the compiler version and arguments. -func cacheLoad(name, configKey string, sourceFiles []string) (string, error) { +func cacheLoad(name string, sourceFiles []string) (string, error) { cachepath := filepath.Join(goenv.Get("GOCACHE"), name) cacheStat, err := os.Stat(cachepath) if os.IsNotExist(err) { @@ -58,9 +55,7 @@ func cacheLoad(name, configKey string, sourceFiles []string) (string, error) { // Store the file located at tmppath in the cache with the given name. The // tmppath may or may not be gone afterwards. -// -// Note: the configKey is ignored, see cacheLoad. -func cacheStore(tmppath, name, configKey string, sourceFiles []string) (string, error) { +func cacheStore(tmppath, name string, sourceFiles []string) (string, error) { // get the last modified time if len(sourceFiles) == 0 { panic("cache: no source files") diff --git a/builder/library.go b/builder/library.go index 0c7bb28f..886499d2 100644 --- a/builder/library.go +++ b/builder/library.go @@ -71,7 +71,7 @@ func (l *Library) load(target, tmpdir string) (path string, job *compileJob, err outfile := l.name + "-" + target + ".a" // Try to fetch this library from the cache. - if path, err := cacheLoad(outfile, commands["clang"][0], l.sourcePaths(target)); path != "" || err != nil { + if path, err := cacheLoad(outfile, l.sourcePaths(target)); path != "" || err != nil { // Cache hit. return path, nil, err } @@ -112,7 +112,7 @@ func (l *Library) load(target, tmpdir string) (path string, job *compileJob, err return err } // Store this archive in the cache. - _, err = cacheStore(arpath, outfile, commands["clang"][0], l.sourcePaths(target)) + _, err = cacheStore(arpath, outfile, l.sourcePaths(target)) return err }, }