Skip to content

Commit d3c1d50

Browse files
cmagliefacchinm
authored andcommitted
Auto-disable (deep) caching of core builds if needed (#479)
When build-path and cache-path are on different partitions it will not be possible (on windows) to reference them with a relative path. This commit allows this by automatically disabling the aggressive core caching. Previously an error was emitted and the build interrupted.
1 parent 37434d1 commit d3c1d50

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: legacy/builder/phases/core_builder.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ func (s *CoreBuilder) Run(ctx *types.Context) error {
5353
}
5454

5555
if coreBuildCachePath != nil {
56-
if err := coreBuildCachePath.MkdirAll(); err != nil {
56+
if _, err := coreBuildCachePath.RelTo(ctx.BuildPath); err != nil {
57+
logger := ctx.GetLogger()
58+
logger.Println(constants.LOG_LEVEL_INFO, "Couldn't deeply cache core build: {0}", err)
59+
logger.Println(constants.LOG_LEVEL_INFO, "Running normal build of the core...")
60+
coreBuildCachePath = nil
61+
ctx.CoreBuildCachePath = nil
62+
} else if err := coreBuildCachePath.MkdirAll(); err != nil {
5763
return i18n.WrapError(err)
5864
}
5965
}

0 commit comments

Comments
 (0)