From 1d6f3610e9b84ac1fa9070bf36c957104f0d2e1e Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Tue, 1 Oct 2024 19:45:21 +0200 Subject: [PATCH 1/3] feat: allow bypassing OS validation --- cli/lib/tasks/install.js | 9 ++++++++- cli/lib/util.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cli/lib/tasks/install.js b/cli/lib/tasks/install.js index 04665ba88cec..1bf2b707a1f2 100644 --- a/cli/lib/tasks/install.js +++ b/cli/lib/tasks/install.js @@ -233,7 +233,14 @@ const start = async (options = {}) => { const binaryDir = state.getBinaryDir(pkgVersion) if (!(await validateOS())) { - return throwFormErrorText(errors.invalidOS)() + if (util.getEnv('CYPRESS_BYPASS_OS_VALIDATION')) { + logger.log( + stripIndent` + ${chalk.yellow('Note:')} OS validation failed, but bypassed. This is unsupported configuration, you are on your own.`, + ) + } else { + return throwFormErrorText(errors.invalidOS)() + } } await fs.ensureDirAsync(cacheDir) diff --git a/cli/lib/util.js b/cli/lib/util.js index 653ffdd1af0d..387afe65e42b 100644 --- a/cli/lib/util.js +++ b/cli/lib/util.js @@ -457,7 +457,7 @@ const util = { ` }, - _cachedArch: undefined, + _cachedArch: process.env.CYPRESS_ARCH, /** * Attempt to return the real system arch (not process.arch, which is only the Node binary's arch) From a24df67219e1012035534dd54505d36f800084b7 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Mon, 7 Oct 2024 10:27:46 +0200 Subject: [PATCH 2/3] Update install.js --- cli/lib/tasks/install.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/lib/tasks/install.js b/cli/lib/tasks/install.js index 1bf2b707a1f2..39c6fe9d44e0 100644 --- a/cli/lib/tasks/install.js +++ b/cli/lib/tasks/install.js @@ -236,7 +236,8 @@ const start = async (options = {}) => { if (util.getEnv('CYPRESS_BYPASS_OS_VALIDATION')) { logger.log( stripIndent` - ${chalk.yellow('Note:')} OS validation failed, but bypassed. This is unsupported configuration, you are on your own.`, + ${chalk.yellow('Note:')} OS validation failed, but bypassed. This is unsupported configuration, you are on your own. + `, ) } else { return throwFormErrorText(errors.invalidOS)() From 708692e49d188819ab1d4d84d765f0a2bcdae569 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Mon, 7 Oct 2024 10:28:57 +0200 Subject: [PATCH 3/3] revert arch --- cli/lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/lib/util.js b/cli/lib/util.js index 387afe65e42b..653ffdd1af0d 100644 --- a/cli/lib/util.js +++ b/cli/lib/util.js @@ -457,7 +457,7 @@ const util = { ` }, - _cachedArch: process.env.CYPRESS_ARCH, + _cachedArch: undefined, /** * Attempt to return the real system arch (not process.arch, which is only the Node binary's arch)