@@ -135,16 +135,16 @@ func StatsString() string {
135
135
sort .Strings (imports )
136
136
fmt .Fprint (buf , "\n gn-filepaths: " )
137
137
for _ , im := range imports {
138
- fmt .Fprintf (buf , "{%s:" , im )
138
+ fmt .Fprintf (buf , "{%s: " , im )
139
139
fp := FilePaths [im ]
140
140
if fp .StoreCount > 0 {
141
141
fmt .Fprintf (buf , "%s (%d)" , fp .StorePath , fp .StoreCount )
142
142
}
143
143
if fp .LoadCount > 0 {
144
144
if fp .StorePath == fp .LoadPath {
145
- fmt .Fprintf (buf , "- \" (%d)" , fp .LoadCount )
145
+ fmt .Fprintf (buf , " - \" (%d)" , fp .LoadCount )
146
146
} else {
147
- fmt .Fprintf (buf , "- %s (%d)" , fp .LoadPath , fp .LoadCount )
147
+ fmt .Fprintf (buf , " - %s (%d)" , fp .LoadPath , fp .LoadCount )
148
148
}
149
149
}
150
150
fmt .Fprintf (buf , "}" )
@@ -160,6 +160,9 @@ func recordStorePath(importPath, storePath string) {
160
160
fp = & FilePathStats {}
161
161
FilePaths [importPath ] = fp
162
162
}
163
+ if strings .HasPrefix (storePath , cacheRoot ) {
164
+ storePath = storePath [len (cacheRoot ):]
165
+ }
163
166
if fp .StorePath != "" && fp .StorePath != storePath {
164
167
fmt .Printf ("store path mismatch: %s, old %s, new: %s\n " , importPath , fp .StorePath , storePath )
165
168
}
@@ -173,6 +176,9 @@ func recordLoadPath(importPath, loadPath string) {
173
176
fp = & FilePathStats {}
174
177
FilePaths [importPath ] = fp
175
178
}
179
+ if strings .HasPrefix (loadPath , cacheRoot ) {
180
+ loadPath = loadPath [len (cacheRoot ):]
181
+ }
176
182
if fp .LoadPath != "" && fp .LoadPath != loadPath {
177
183
fmt .Printf ("load path mismatch: %s, old %s, new: %s\n " , importPath , fp .LoadPath , loadPath )
178
184
}
@@ -258,11 +264,11 @@ func (bc *BuildCache) LoadArchive(importPath string) *compiler.Archive {
258
264
259
265
// commonKey returns a part of the cache key common for all artifacts generated
260
266
// under a given BuildCache configuration.
261
- func (bc * BuildCache ) commonKey () string {
267
+ func (bc * BuildCache ) CommonKey () string {
262
268
return fmt .Sprintf ("%#v + %v" , * bc , compiler .Version )
263
269
}
264
270
265
271
// archiveKey returns a full cache key for a package's compiled archive.
266
272
func (bc * BuildCache ) archiveKey (importPath string ) string {
267
- return path .Join ("archive" , bc .commonKey (), importPath )
273
+ return path .Join ("archive" , bc .CommonKey (), importPath )
268
274
}
0 commit comments