Skip to content

Commit

Permalink
fix: use non-legacy build staging file sync on Windows by default (#6758
Browse files Browse the repository at this point in the history
)

* chore: re-order imports

* fix: use non-legacy build staging file sync on Windows by default
  • Loading branch information
vvagaytsev authored Jan 13, 2025
1 parent 10d2c2c commit 4c83cd3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
5 changes: 3 additions & 2 deletions core/src/build-staging/build-staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down
3 changes: 1 addition & 2 deletions core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,14 @@ 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")
.required(false)
.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(),
Expand Down
7 changes: 1 addition & 6 deletions core/src/garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4c83cd3

Please sign in to comment.