From 4c83cd3880d715ab2f53ca354de0243bab0fdef4 Mon Sep 17 00:00:00 2001 From: Vladimir Vagaytsev <10628074+vvagaytsev@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:14:07 +0100 Subject: [PATCH] fix: use non-legacy build staging file sync on Windows by default (#6758) * chore: re-order imports * fix: use non-legacy build staging file sync on Windows by default --- core/src/build-staging/build-staging.ts | 5 +++-- core/src/constants.ts | 3 +-- core/src/garden.ts | 7 +------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/core/src/build-staging/build-staging.ts b/core/src/build-staging/build-staging.ts index 8d2ab7177f..f6878f6527 100644 --- a/core/src/build-staging/build-staging.ts +++ b/core/src/build-staging/build-staging.ts @@ -7,8 +7,6 @@ */ import { isAbsolute, join, resolve, relative, parse, basename } from "path" -import fsExtra from "fs-extra" -const { emptyDir, ensureDir, mkdirp, pathExists, remove } = fsExtra import { ConfigurationError, InternalError, isErrnoException } from "../exceptions.js" import { normalizeRelativePath, joinWithPosix } from "../util/fs.js" import type { Log } from "../logger/log-entry.js" @@ -21,6 +19,9 @@ import { difference } from "lodash-es" import { unlink } from "fs" import type { BuildAction, BuildActionConfig } from "../actions/build.js" import type { ModuleConfig } from "../config/module.js" +import fsExtra from "fs-extra" + +const { emptyDir, ensureDir, mkdirp, pathExists, remove } = fsExtra const fileSyncConcurrencyLimit = 100 diff --git a/core/src/constants.ts b/core/src/constants.ts index a3d6815757..f246d604b9 100644 --- a/core/src/constants.ts +++ b/core/src/constants.ts @@ -78,7 +78,6 @@ export const gardenEnv = { GARDEN_DISABLE_WEB_APP_WARN: env.get("GARDEN_DISABLE_WEB_APP_WARN").required(false).default("false").asBool(), GARDEN_ENABLE_PROFILING: env.get("GARDEN_ENABLE_PROFILING").required(false).default("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_GE_SCHEDULED: env.get("GARDEN_GE_SCHEDULED").required(false).asBool(), GARDEN_GIT_SCAN_MODE: env .get("GARDEN_GIT_SCAN_MODE") @@ -86,7 +85,7 @@ export const gardenEnv = { .default(defaultGitScanMode) .asEnum(gitScanModes), GARDEN_GIT_LOG_UNTRACKED_FILES: env.get("GARDEN_GIT_LOG_UNTRACKED_FILES").required(false).default("false").asBool(), - GARDEN_LEGACY_BUILD_STAGE: env.get("GARDEN_LEGACY_BUILD_STAGE").required(false).asBool(), + GARDEN_LEGACY_BUILD_STAGE: env.get("GARDEN_LEGACY_BUILD_STAGE").required(false).default("false").asBool(), GARDEN_LOG_LEVEL: env.get("GARDEN_LOG_LEVEL").required(false).asString(), GARDEN_LOGGER_TYPE: env.get("GARDEN_LOGGER_TYPE").required(false).asString(), GARDEN_PROXY_DEFAULT_ADDRESS: env.get("GARDEN_PROXY_DEFAULT_ADDRESS").required(false).asString(), diff --git a/core/src/garden.ts b/core/src/garden.ts index 37ee923637..6e9fc4140c 100644 --- a/core/src/garden.ts +++ b/core/src/garden.ts @@ -408,13 +408,8 @@ export class Garden { cache: vcsCache, }) - // 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 = - params.opts.legacyBuildSync === undefined - ? gardenEnv.GARDEN_LEGACY_BUILD_STAGE || (platform() === "win32" && !gardenEnv.GARDEN_EXPERIMENTAL_BUILD_STAGE) - : params.opts.legacyBuildSync + params.opts.legacyBuildSync === undefined ? gardenEnv.GARDEN_LEGACY_BUILD_STAGE : params.opts.legacyBuildSync const buildDirCls = legacyBuildSync ? BuildStagingRsync : BuildStaging if (legacyBuildSync) {