Skip to content

Commit

Permalink
fix(core): default back to rsync build staging on Windows
Browse files Browse the repository at this point in the history
This temporarily mitigates #2299 by reverting back to using rsync for
build staging on Windows, while we work out why exactly it fails for
some users/projects.

Users can still opt into the newer rsync-less mode by setting
`GARDEN_EXPERIMENTAL_BUILD_STAGE=true` in their shell environment.
  • Loading branch information
edvald authored and thsig committed Mar 29, 2021
1 parent 9ac421c commit d96e490
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const gardenEnv = {
GARDEN_DISABLE_VERSION_CHECK: env.get("GARDEN_DISABLE_VERSION_CHECK").required(false).asBool(),
GARDEN_ENABLE_PROFILING: env.get("GARDEN_ENABLE_PROFILING").required(false).asBool(),
GARDEN_ENVIRONMENT: env.get("GARDEN_ENVIRONMENT").required(false).asString(),
GARDEN_EXPERIMENTAL_BUILD_STAGE: env.get("GARDEN_EXPERIMENTAL_BUILD_STAGE").required(false).asBool(),
GARDEN_LEGACY_BUILD_STAGE: env.get("GARDEN_LEGACY_BUILD_STAGE").required(false).asBool(),
GARDEN_LOG_LEVEL: env.get("GARDEN_LOG_LEVEL").required(false).asString(),
GARDEN_LOGGER_TYPE: env.get("GARDEN_LOGGER_TYPE").required(false).asString(),
Expand Down
8 changes: 7 additions & 1 deletion core/src/garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,14 @@ export async function resolveGardenParams(currentDirectory: string, opts: Garden
// Allow overriding variables
variables = { ...variables, ...(opts.variables || {}) }

// Use the legacy build sync mode if
// A) GARDEN_LEGACY_BUILD_STAGE=true is set or
// B) if running Windows and GARDEN_EXPERIMENTAL_BUILD_STAGE != true (until #2299 is properly fixed)
const legacyBuildSync =
opts.legacyBuildSync === undefined ? gardenEnv.GARDEN_LEGACY_BUILD_STAGE : opts.legacyBuildSync
opts.legacyBuildSync === undefined
? gardenEnv.GARDEN_LEGACY_BUILD_STAGE || (platform() === "win32" && !gardenEnv.GARDEN_EXPERIMENTAL_BUILD_STAGE)
: opts.legacyBuildSync

const buildDirCls = legacyBuildSync ? BuildDirRsync : BuildStaging
const buildDir = await buildDirCls.factory(projectRoot, gardenDirPath)
const workingCopyId = await getWorkingCopyId(gardenDirPath)
Expand Down

0 comments on commit d96e490

Please sign in to comment.