From 6d1af54fd37adc04ca8d0edf99daec0d31dbe793 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 8 Nov 2022 14:29:28 -0600 Subject: [PATCH 01/12] fix: improve binary cleanup to look at binary rather than monorepo --- .circleci/config.yml | 6 +++++- scripts/binary/binary-cleanup.js | 30 ++++++++++++++++-------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec679f49bf8a..748e7f3eb45e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,6 +27,7 @@ mainBuildFilters: &mainBuildFilters branches: only: - develop + - 'ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo' # usually we don't build Mac app - it takes a long time # but sometimes we want to really confirm we are doing the right thing @@ -35,6 +36,7 @@ macWorkflowFilters: &darwin-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] + - equal: [ 'ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo', << pipeline.git.branch >> ] - matches: pattern: "-release$" value: << pipeline.git.branch >> @@ -43,6 +45,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] + - equal: [ 'ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo', << pipeline.git.branch >> ] - matches: pattern: "-release$" value: << pipeline.git.branch >> @@ -60,6 +63,7 @@ windowsWorkflowFilters: &windows-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] + - equal: [ 'ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo', << pipeline.git.branch >> ] - matches: pattern: "-release$" value: << pipeline.git.branch >> @@ -126,7 +130,7 @@ commands: - run: name: Check current branch to persist artifacts command: | - if [[ "$CIRCLE_BRANCH" != "develop" ]]; then + if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo" ]]; then echo "Not uploading artifacts or posting install comment for this branch." circleci-agent step halt fi diff --git a/scripts/binary/binary-cleanup.js b/scripts/binary/binary-cleanup.js index 47ac4c68676c..68dc96ac1df6 100644 --- a/scripts/binary/binary-cleanup.js +++ b/scripts/binary/binary-cleanup.js @@ -36,22 +36,22 @@ async function removeEmptyDirectories (directory) { } } -const getDependencyPathsToKeep = async () => { +const getDependencyPathsToKeep = async (buildAppDir) => { let entryPoints = new Set([ // This is the entry point for the server bundle. It will not have access to the snapshot yet. It needs to be kept in the binary - require.resolve('@packages/server/index.js'), + require.resolve('@packages/server/index.js', { paths: [buildAppDir] }), // This is a dynamic import that is used to load the snapshot require logic. It will not have access to the snapshot yet. It needs to be kept in the binary - require.resolve('@packages/server/hook-require.js'), + require.resolve('@packages/server/hook-require.js', { paths: [buildAppDir] }), // These dependencies are started in a new process or thread and will not have access to the snapshot. They need to be kept in the binary - require.resolve('@packages/server/lib/plugins/child/require_async_child.js'), - require.resolve('@packages/server/lib/plugins/child/register_ts_node.js'), - require.resolve('@packages/rewriter/lib/threads/worker.ts'), + require.resolve('@packages/server/lib/plugins/child/require_async_child.js', { paths: [buildAppDir] }), + require.resolve('@packages/server/lib/plugins/child/register_ts_node.js', { paths: [buildAppDir] }), + require.resolve('@packages/rewriter/lib/threads/worker.ts', { paths: [buildAppDir] }), // These dependencies use the `require.resolve(, { paths: [] })` pattern where is a path within the cypress monorepo. These will not be // pulled in by esbuild but still need to be kept in the binary. - require.resolve('webpack'), - require.resolve('webpack-dev-server', { paths: [path.join(__dirname, '..', '..', 'npm', 'webpack-dev-server')] }), - require.resolve('html-webpack-plugin-4', { paths: [path.join(__dirname, '..', '..', 'npm', 'webpack-dev-server')] }), - require.resolve('html-webpack-plugin-5', { paths: [path.join(__dirname, '..', '..', 'npm', 'webpack-dev-server')] }), + require.resolve('webpack', { paths: [buildAppDir] }), + require.resolve('webpack-dev-server', { paths: [buildAppDir] }), + require.resolve('html-webpack-plugin-4', { paths: [buildAppDir] }), + require.resolve('html-webpack-plugin-5', { paths: [buildAppDir] }), // These dependencies are completely dynamic using the pattern `require(`./${name}`)` and will not be pulled in by esbuild but still need to be kept in the binary. ...['ibmi', 'sunos', @@ -61,7 +61,7 @@ const getDependencyPathsToKeep = async () => { 'linux', 'openbsd', 'sunos', - 'win32'].map((platform) => require.resolve(`default-gateway/${platform}`)), + 'win32'].map((platform) => require.resolve(`default-gateway/${platform}`, { paths: [buildAppDir] })), ]) let esbuildResult let newEntryPointsFound = true @@ -77,7 +77,9 @@ const getDependencyPathsToKeep = async () => { outdir: workingDir, platform: 'node', metafile: true, + absWorkingDir: buildAppDir, external: [ + './packages/packherd-require/dist/transpile-ts', './packages/server/server-entry', 'fsevents', 'pnpapi', @@ -95,9 +97,9 @@ const getDependencyPathsToKeep = async () => { let entryPoint if (warningSubject.startsWith('.')) { - entryPoint = path.join(__dirname, '..', '..', path.dirname(warning.location.file), warningSubject) + entryPoint = path.join(buildAppDir, path.dirname(warning.location.file), warningSubject) } else { - entryPoint = require.resolve(warningSubject) + entryPoint = require.resolve(warningSubject, { paths: [path.join(buildAppDir, path.dirname(warning.location.file))] }) } if (path.extname(entryPoint) !== '' && !entryPoints.has(entryPoint)) { @@ -114,7 +116,7 @@ const getDependencyPathsToKeep = async () => { const cleanup = async (buildAppDir) => { // 1. Retrieve all dependencies that still need to be kept in the binary. In theory, we could use the bundles generated here as single files within the binary, // but for now, we just track on the dependencies that get pulled in - const keptDependencies = [...await getDependencyPathsToKeep(), 'package.json', 'packages/server/server-entry.js'] + const keptDependencies = [...await getDependencyPathsToKeep(buildAppDir), 'package.json', 'packages/server/server-entry.js'] // 2. Gather the dependencies that could potentially be removed from the binary due to being in the snapshot const potentiallyRemovedDependencies = [...snapshotMetadata.healthy, ...snapshotMetadata.deferred, ...snapshotMetadata.norewrite] From efd0af71af461bb8690d2545bf82c259938ede54 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 8 Nov 2022 15:00:41 -0600 Subject: [PATCH 02/12] fix rewriter --- scripts/binary/binary-cleanup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/binary/binary-cleanup.js b/scripts/binary/binary-cleanup.js index 68dc96ac1df6..a56e64c090a3 100644 --- a/scripts/binary/binary-cleanup.js +++ b/scripts/binary/binary-cleanup.js @@ -45,7 +45,7 @@ const getDependencyPathsToKeep = async (buildAppDir) => { // These dependencies are started in a new process or thread and will not have access to the snapshot. They need to be kept in the binary require.resolve('@packages/server/lib/plugins/child/require_async_child.js', { paths: [buildAppDir] }), require.resolve('@packages/server/lib/plugins/child/register_ts_node.js', { paths: [buildAppDir] }), - require.resolve('@packages/rewriter/lib/threads/worker.ts', { paths: [buildAppDir] }), + require.resolve('@packages/rewriter/lib/threads/worker.js', { paths: [buildAppDir] }), // These dependencies use the `require.resolve(, { paths: [] })` pattern where is a path within the cypress monorepo. These will not be // pulled in by esbuild but still need to be kept in the binary. require.resolve('webpack', { paths: [buildAppDir] }), From 8e22bad5338846a45072e626bd513db781335590 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 08:28:46 -0600 Subject: [PATCH 03/12] Additional fixes --- npm/webpack-preprocessor/index.ts | 2 +- npm/webpack-preprocessor/package.json | 1 + scripts/binary/binary-cleanup.js | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/npm/webpack-preprocessor/index.ts b/npm/webpack-preprocessor/index.ts index a8b98a3e3f5c..3b93af15b35b 100644 --- a/npm/webpack-preprocessor/index.ts +++ b/npm/webpack-preprocessor/index.ts @@ -249,7 +249,7 @@ const preprocessor: WebpackPreprocessor = (options: PreprocessorOptions = {}): F webpackOptions.module.rules.unshift({ test: /\.(js|ts|jsx|tsx)$/, use: [{ - loader: path.join(__dirname, 'lib/cross-origin-callback-loader'), + loader: require.resolve('@cypress/webpack-preprocessor/dist/lib/cross-origin-callback-loader.js'), options: { commands: callbackReplacementCommands, }, diff --git a/npm/webpack-preprocessor/package.json b/npm/webpack-preprocessor/package.json index 0d164da248fa..1b1252809ea5 100644 --- a/npm/webpack-preprocessor/package.json +++ b/npm/webpack-preprocessor/package.json @@ -20,6 +20,7 @@ "watch": "rimraf dist && tsc --watch" }, "dependencies": { + "@babel/parser": "7.13.0", "bluebird": "3.7.1", "debug": "^4.3.2", "fs-extra": "^10.1.0", diff --git a/scripts/binary/binary-cleanup.js b/scripts/binary/binary-cleanup.js index a56e64c090a3..9562297a7776 100644 --- a/scripts/binary/binary-cleanup.js +++ b/scripts/binary/binary-cleanup.js @@ -52,6 +52,8 @@ const getDependencyPathsToKeep = async (buildAppDir) => { require.resolve('webpack-dev-server', { paths: [buildAppDir] }), require.resolve('html-webpack-plugin-4', { paths: [buildAppDir] }), require.resolve('html-webpack-plugin-5', { paths: [buildAppDir] }), + // This is a dynamic import swizzle that needs to happen in the reporter + require.resolve('mocha-7.0.1', { paths: [buildAppDir] }), // These dependencies are completely dynamic using the pattern `require(`./${name}`)` and will not be pulled in by esbuild but still need to be kept in the binary. ...['ibmi', 'sunos', From f236a3d3edd3ab07fbfc96fddfaa276760ff561e Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 10:07:59 -0600 Subject: [PATCH 04/12] fix windows --- scripts/binary/binary-cleanup.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/binary/binary-cleanup.js b/scripts/binary/binary-cleanup.js index 9562297a7776..31a48b6c5b56 100644 --- a/scripts/binary/binary-cleanup.js +++ b/scripts/binary/binary-cleanup.js @@ -81,8 +81,8 @@ const getDependencyPathsToKeep = async (buildAppDir) => { metafile: true, absWorkingDir: buildAppDir, external: [ - './packages/packherd-require/dist/transpile-ts', - './packages/server/server-entry', + './transpile-ts', + './server-entry', 'fsevents', 'pnpapi', '@swc/core', From 4912d23d55522ee5749bd7ab4abb61f49f80ab5b Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 11:07:40 -0600 Subject: [PATCH 05/12] fix issue with errors and babel/runtime --- scripts/binary/binary-cleanup.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/binary/binary-cleanup.js b/scripts/binary/binary-cleanup.js index 31a48b6c5b56..8cd8b1a9008a 100644 --- a/scripts/binary/binary-cleanup.js +++ b/scripts/binary/binary-cleanup.js @@ -52,7 +52,7 @@ const getDependencyPathsToKeep = async (buildAppDir) => { require.resolve('webpack-dev-server', { paths: [buildAppDir] }), require.resolve('html-webpack-plugin-4', { paths: [buildAppDir] }), require.resolve('html-webpack-plugin-5', { paths: [buildAppDir] }), - // This is a dynamic import swizzle that needs to happen in the reporter + // These involve dynamic requires that are not resolved by esbuild. They need to be kept in the binary. require.resolve('mocha-7.0.1', { paths: [buildAppDir] }), // These dependencies are completely dynamic using the pattern `require(`./${name}`)` and will not be pulled in by esbuild but still need to be kept in the binary. ...['ibmi', @@ -125,9 +125,11 @@ const cleanup = async (buildAppDir) => { // 3. Remove all dependencies that are in the snapshot but not in the list of kept dependencies from the binary await Promise.all(potentiallyRemovedDependencies.map(async (dependency) => { - // marionette-client requires all of its dependencies in a very non-standard dynamic way. We will keep anything in marionette-client - if (!keptDependencies.includes(dependency.slice(2)) && !dependency.includes('marionette-client')) { - await fs.remove(path.join(buildAppDir, dependency.replace(/.ts$/, '.js'))) + const typeScriptlessDependency = dependency.replace(/\.ts$/, '.js') + + // marionette-client and babel/runtime require all of their dependencies in a very non-standard dynamic way. We will keep anything in marionette-client and babel/runtime + if (!keptDependencies.includes(typeScriptlessDependency.slice(2)) && !typeScriptlessDependency.includes('marionette-client') && !typeScriptlessDependency.includes('@babel/runtime')) { + await fs.remove(path.join(buildAppDir, typeScriptlessDependency)) } })) From e5fe1e90cfd8749bf3d2beb62aa5968832ab82a3 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 13:33:42 -0600 Subject: [PATCH 06/12] fix windows build --- scripts/binary/binary-cleanup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/binary/binary-cleanup.js b/scripts/binary/binary-cleanup.js index 8cd8b1a9008a..852ba6264479 100644 --- a/scripts/binary/binary-cleanup.js +++ b/scripts/binary/binary-cleanup.js @@ -79,7 +79,7 @@ const getDependencyPathsToKeep = async (buildAppDir) => { outdir: workingDir, platform: 'node', metafile: true, - absWorkingDir: buildAppDir, + absWorkingDir: buildAppDir.split(path.sep).join(path.posix.sep), external: [ './transpile-ts', './server-entry', From c01362fcda6e3dac7b5a7f056e9cf008161e0628 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 13:55:00 -0600 Subject: [PATCH 07/12] fix windows --- scripts/binary/binary-cleanup.js | 39 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/scripts/binary/binary-cleanup.js b/scripts/binary/binary-cleanup.js index 852ba6264479..89d789d6cfe2 100644 --- a/scripts/binary/binary-cleanup.js +++ b/scripts/binary/binary-cleanup.js @@ -37,23 +37,22 @@ async function removeEmptyDirectories (directory) { } const getDependencyPathsToKeep = async (buildAppDir) => { + const unixBuildAppDir = buildAppDir.split(path.sep).join(path.posix.sep) + const startingEntryPoints = [ + '@packages/server/index.js', + '@packages/server/hook-require.js', + '@packages/server/lib/plugins/child/require_async_child.js', + '@packages/server/lib/plugins/child/register_ts_node.js', + '@packages/rewriter/lib/threads/worker.js', + 'webpack', + 'webpack-dev-server', + 'html-webpack-plugin-4', + 'html-webpack-plugin-5', + 'mocha-7.0.1', + ] + let entryPoints = new Set([ - // This is the entry point for the server bundle. It will not have access to the snapshot yet. It needs to be kept in the binary - require.resolve('@packages/server/index.js', { paths: [buildAppDir] }), - // This is a dynamic import that is used to load the snapshot require logic. It will not have access to the snapshot yet. It needs to be kept in the binary - require.resolve('@packages/server/hook-require.js', { paths: [buildAppDir] }), - // These dependencies are started in a new process or thread and will not have access to the snapshot. They need to be kept in the binary - require.resolve('@packages/server/lib/plugins/child/require_async_child.js', { paths: [buildAppDir] }), - require.resolve('@packages/server/lib/plugins/child/register_ts_node.js', { paths: [buildAppDir] }), - require.resolve('@packages/rewriter/lib/threads/worker.js', { paths: [buildAppDir] }), - // These dependencies use the `require.resolve(, { paths: [] })` pattern where is a path within the cypress monorepo. These will not be - // pulled in by esbuild but still need to be kept in the binary. - require.resolve('webpack', { paths: [buildAppDir] }), - require.resolve('webpack-dev-server', { paths: [buildAppDir] }), - require.resolve('html-webpack-plugin-4', { paths: [buildAppDir] }), - require.resolve('html-webpack-plugin-5', { paths: [buildAppDir] }), - // These involve dynamic requires that are not resolved by esbuild. They need to be kept in the binary. - require.resolve('mocha-7.0.1', { paths: [buildAppDir] }), + ...startingEntryPoints.map((entryPoint) => require.resolve(entryPoint, { paths: [unixBuildAppDir] })), // These dependencies are completely dynamic using the pattern `require(`./${name}`)` and will not be pulled in by esbuild but still need to be kept in the binary. ...['ibmi', 'sunos', @@ -63,7 +62,7 @@ const getDependencyPathsToKeep = async (buildAppDir) => { 'linux', 'openbsd', 'sunos', - 'win32'].map((platform) => require.resolve(`default-gateway/${platform}`, { paths: [buildAppDir] })), + 'win32'].map((platform) => require.resolve(`default-gateway/${platform}`, { paths: [unixBuildAppDir] })), ]) let esbuildResult let newEntryPointsFound = true @@ -79,7 +78,7 @@ const getDependencyPathsToKeep = async (buildAppDir) => { outdir: workingDir, platform: 'node', metafile: true, - absWorkingDir: buildAppDir.split(path.sep).join(path.posix.sep), + absWorkingDir: unixBuildAppDir, external: [ './transpile-ts', './server-entry', @@ -99,9 +98,9 @@ const getDependencyPathsToKeep = async (buildAppDir) => { let entryPoint if (warningSubject.startsWith('.')) { - entryPoint = path.join(buildAppDir, path.dirname(warning.location.file), warningSubject) + entryPoint = path.join(unixBuildAppDir, path.dirname(warning.location.file), warningSubject) } else { - entryPoint = require.resolve(warningSubject, { paths: [path.join(buildAppDir, path.dirname(warning.location.file))] }) + entryPoint = require.resolve(warningSubject, { paths: [path.join(unixBuildAppDir, path.dirname(warning.location.file))] }) } if (path.extname(entryPoint) !== '' && !entryPoints.has(entryPoint)) { From a77d4f0e83f4f16b997824d177649c934343af2c Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 14:55:05 -0600 Subject: [PATCH 08/12] fix windows --- scripts/binary/binary-cleanup.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/binary/binary-cleanup.js b/scripts/binary/binary-cleanup.js index 89d789d6cfe2..dc6a70545baf 100644 --- a/scripts/binary/binary-cleanup.js +++ b/scripts/binary/binary-cleanup.js @@ -39,20 +39,20 @@ async function removeEmptyDirectories (directory) { const getDependencyPathsToKeep = async (buildAppDir) => { const unixBuildAppDir = buildAppDir.split(path.sep).join(path.posix.sep) const startingEntryPoints = [ - '@packages/server/index.js', - '@packages/server/hook-require.js', - '@packages/server/lib/plugins/child/require_async_child.js', - '@packages/server/lib/plugins/child/register_ts_node.js', - '@packages/rewriter/lib/threads/worker.js', - 'webpack', - 'webpack-dev-server', - 'html-webpack-plugin-4', - 'html-webpack-plugin-5', - 'mocha-7.0.1', + 'packages/server/index.js', + 'packages/server/hook-require.js', + 'packages/server/lib/plugins/child/require_async_child.js', + 'packages/server/lib/plugins/child/register_ts_node.js', + 'packages/rewriter/lib/threads/worker.js', + 'node_modules/webpack/lib/webpack.js', + 'node_modules/webpack-dev-server/lib/Server.js', + 'node_modules/html-webpack-plugin-4/index.js', + 'node_modules/html-webpack-plugin-5/index.js', + 'node_modules/mocha-7.0.1/index.js', ] let entryPoints = new Set([ - ...startingEntryPoints.map((entryPoint) => require.resolve(entryPoint, { paths: [unixBuildAppDir] })), + ...startingEntryPoints.map((entryPoint) => path.join(unixBuildAppDir, entryPoint)), // These dependencies are completely dynamic using the pattern `require(`./${name}`)` and will not be pulled in by esbuild but still need to be kept in the binary. ...['ibmi', 'sunos', @@ -62,7 +62,7 @@ const getDependencyPathsToKeep = async (buildAppDir) => { 'linux', 'openbsd', 'sunos', - 'win32'].map((platform) => require.resolve(`default-gateway/${platform}`, { paths: [unixBuildAppDir] })), + 'win32'].map((platform) => path.join(unixBuildAppDir, `node_modules/default-gateway/${platform}.js`)), ]) let esbuildResult let newEntryPointsFound = true From 69d3b8c912a2dd9e1b982cd7fbb0de844de07247 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 16:05:24 -0600 Subject: [PATCH 09/12] Update config.yml --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 748e7f3eb45e..63129f9e1b73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,7 +27,7 @@ mainBuildFilters: &mainBuildFilters branches: only: - develop - - 'ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo' + - 'ryanm/fix/improve-binary-cleanup' # usually we don't build Mac app - it takes a long time # but sometimes we want to really confirm we are doing the right thing @@ -36,7 +36,7 @@ macWorkflowFilters: &darwin-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] - - equal: [ 'ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo', << pipeline.git.branch >> ] + - equal: [ 'ryanm/fix/improve-binary-cleanup', << pipeline.git.branch >> ] - matches: pattern: "-release$" value: << pipeline.git.branch >> @@ -45,7 +45,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] - - equal: [ 'ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo', << pipeline.git.branch >> ] + - equal: [ 'ryanm/fix/improve-binary-cleanup', << pipeline.git.branch >> ] - matches: pattern: "-release$" value: << pipeline.git.branch >> @@ -63,7 +63,7 @@ windowsWorkflowFilters: &windows-workflow-filters when: or: - equal: [ develop, << pipeline.git.branch >> ] - - equal: [ 'ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo', << pipeline.git.branch >> ] + - equal: [ 'ryanm/fix/improve-binary-cleanup', << pipeline.git.branch >> ] - matches: pattern: "-release$" value: << pipeline.git.branch >> @@ -130,7 +130,7 @@ commands: - run: name: Check current branch to persist artifacts command: | - if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "ryanm/fix/improve-binary-cleanup-to-look-at-binary-rather-than-monorepo" ]]; then + if [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "ryanm/fix/improve-binary-cleanup" ]]; then echo "Not uploading artifacts or posting install comment for this branch." circleci-agent step halt fi From a37bfa846433dc8cd50321da57d03d0b67cf1696 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 17:24:52 -0600 Subject: [PATCH 10/12] fix issue with CT tests not reloading --- .../v8-snapshot/cache/prod-darwin/snapshot-meta.cache.json | 6 +++--- .../v8-snapshot/cache/prod-linux/snapshot-meta.cache.json | 4 ++-- .../v8-snapshot/cache/prod-win32/snapshot-meta.cache.json | 4 ++-- tooling/v8-snapshot/src/setup/force-no-rewrite.ts | 2 ++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tooling/v8-snapshot/cache/prod-darwin/snapshot-meta.cache.json b/tooling/v8-snapshot/cache/prod-darwin/snapshot-meta.cache.json index 2dbe1a95ef92..94474b178204 100644 --- a/tooling/v8-snapshot/cache/prod-darwin/snapshot-meta.cache.json +++ b/tooling/v8-snapshot/cache/prod-darwin/snapshot-meta.cache.json @@ -49,6 +49,8 @@ "./packages/server/lib/modes/record.js", "./packages/server/lib/modes/run.ts", "./packages/server/lib/open_project.ts", + "./packages/server/lib/project-base.ts", + "./packages/server/lib/socket-ct.ts", "./packages/server/lib/util/suppress_warnings.js", "./packages/server/node_modules/@benmalka/foxdriver/node_modules/graceful-fs/polyfills.js", "./packages/server/node_modules/glob/node_modules/minimatch/minimatch.js", @@ -844,7 +846,6 @@ "./packages/server/lib/plugins/dev-server.js", "./packages/server/lib/plugins/preprocessor.js", "./packages/server/lib/plugins/run_events.js", - "./packages/server/lib/project-base.ts", "./packages/server/lib/project_utils.ts", "./packages/server/lib/remote_states.ts", "./packages/server/lib/reporter.js", @@ -857,7 +858,6 @@ "./packages/server/lib/server-ct.ts", "./packages/server/lib/server-e2e.ts", "./packages/server/lib/socket-base.ts", - "./packages/server/lib/socket-ct.ts", "./packages/server/lib/socket-e2e.ts", "./packages/server/lib/unhandled_exceptions.ts", "./packages/server/lib/util/app_data.js", @@ -3929,5 +3929,5 @@ "./tooling/v8-snapshot/cache/prod-darwin/snapshot-entry.js" ], "deferredHashFile": "yarn.lock", - "deferredHash": "95205f49259fe2d246d45ef15d1499f6e3d1d235d6db892124bbd5423f1ba872" + "deferredHash": "8b71698b89d3804ed712295c20a140cfcd674fa5c3ad9569530282dd6c3e9906" } \ No newline at end of file diff --git a/tooling/v8-snapshot/cache/prod-linux/snapshot-meta.cache.json b/tooling/v8-snapshot/cache/prod-linux/snapshot-meta.cache.json index 61fc0d6d6cd6..e5959db684fd 100644 --- a/tooling/v8-snapshot/cache/prod-linux/snapshot-meta.cache.json +++ b/tooling/v8-snapshot/cache/prod-linux/snapshot-meta.cache.json @@ -49,6 +49,8 @@ "./packages/server/lib/modes/record.js", "./packages/server/lib/modes/run.ts", "./packages/server/lib/open_project.ts", + "./packages/server/lib/project-base.ts", + "./packages/server/lib/socket-ct.ts", "./packages/server/lib/util/suppress_warnings.js", "./packages/server/node_modules/@benmalka/foxdriver/node_modules/graceful-fs/polyfills.js", "./packages/server/node_modules/glob/node_modules/minimatch/minimatch.js", @@ -843,7 +845,6 @@ "./packages/server/lib/plugins/dev-server.js", "./packages/server/lib/plugins/preprocessor.js", "./packages/server/lib/plugins/run_events.js", - "./packages/server/lib/project-base.ts", "./packages/server/lib/project_utils.ts", "./packages/server/lib/remote_states.ts", "./packages/server/lib/reporter.js", @@ -856,7 +857,6 @@ "./packages/server/lib/server-ct.ts", "./packages/server/lib/server-e2e.ts", "./packages/server/lib/socket-base.ts", - "./packages/server/lib/socket-ct.ts", "./packages/server/lib/socket-e2e.ts", "./packages/server/lib/unhandled_exceptions.ts", "./packages/server/lib/util/app_data.js", diff --git a/tooling/v8-snapshot/cache/prod-win32/snapshot-meta.cache.json b/tooling/v8-snapshot/cache/prod-win32/snapshot-meta.cache.json index c0c3943ff8e6..86d740dacfe6 100644 --- a/tooling/v8-snapshot/cache/prod-win32/snapshot-meta.cache.json +++ b/tooling/v8-snapshot/cache/prod-win32/snapshot-meta.cache.json @@ -49,6 +49,8 @@ "./packages/server/lib/modes/record.js", "./packages/server/lib/modes/run.ts", "./packages/server/lib/open_project.ts", + "./packages/server/lib/project-base.ts", + "./packages/server/lib/socket-ct.ts", "./packages/server/lib/util/suppress_warnings.js", "./packages/server/node_modules/@benmalka/foxdriver/node_modules/graceful-fs/polyfills.js", "./packages/server/node_modules/glob/node_modules/minimatch/minimatch.js", @@ -846,7 +848,6 @@ "./packages/server/lib/plugins/dev-server.js", "./packages/server/lib/plugins/preprocessor.js", "./packages/server/lib/plugins/run_events.js", - "./packages/server/lib/project-base.ts", "./packages/server/lib/project_utils.ts", "./packages/server/lib/remote_states.ts", "./packages/server/lib/reporter.js", @@ -859,7 +860,6 @@ "./packages/server/lib/server-ct.ts", "./packages/server/lib/server-e2e.ts", "./packages/server/lib/socket-base.ts", - "./packages/server/lib/socket-ct.ts", "./packages/server/lib/socket-e2e.ts", "./packages/server/lib/unhandled_exceptions.ts", "./packages/server/lib/util/app_data.js", diff --git a/tooling/v8-snapshot/src/setup/force-no-rewrite.ts b/tooling/v8-snapshot/src/setup/force-no-rewrite.ts index 1449b0475684..077365a6d8de 100644 --- a/tooling/v8-snapshot/src/setup/force-no-rewrite.ts +++ b/tooling/v8-snapshot/src/setup/force-no-rewrite.ts @@ -56,4 +56,6 @@ export default [ 'packages/server/node_modules/glob/node_modules/minimatch/minimatch.js', 'node_modules/js-yaml/lib/js-yaml/type/js/function.js', 'packages/server/lib/open_project.ts', + 'packages/server/lib/project-base.ts', + 'packages/server/lib/socket-ct.ts', ] From fe0b78440a4667291feee2cda7d5b841306fc7ba Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 18:33:16 -0600 Subject: [PATCH 11/12] Update bootstrap-docker-container.sh --- system-tests/scripts/bootstrap-docker-container.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-tests/scripts/bootstrap-docker-container.sh b/system-tests/scripts/bootstrap-docker-container.sh index 19bcda1bf8f9..23f8b6149d18 100755 --- a/system-tests/scripts/bootstrap-docker-container.sh +++ b/system-tests/scripts/bootstrap-docker-container.sh @@ -39,7 +39,7 @@ export npm_config_package_lock=false mkdir $npm_config_cache chown -R 1000:1000 $npm_config_cache -npx npm@latest install --unsafe-perm --allow-root --force file:$CLI_PATH +npx npm@9.1.0 install --unsafe-perm --allow-root --force file:$CLI_PATH PATH=$PATH:./node_modules/.bin From ad08d19bb795f563446d659fab5791d4bcc00e31 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Wed, 9 Nov 2022 19:28:17 -0600 Subject: [PATCH 12/12] Update bootstrap-docker-container.sh --- system-tests/scripts/bootstrap-docker-container.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-tests/scripts/bootstrap-docker-container.sh b/system-tests/scripts/bootstrap-docker-container.sh index 23f8b6149d18..d74e1fadea0f 100755 --- a/system-tests/scripts/bootstrap-docker-container.sh +++ b/system-tests/scripts/bootstrap-docker-container.sh @@ -39,7 +39,7 @@ export npm_config_package_lock=false mkdir $npm_config_cache chown -R 1000:1000 $npm_config_cache -npx npm@9.1.0 install --unsafe-perm --allow-root --force file:$CLI_PATH +npx npm@8 install --unsafe-perm --allow-root --force file:$CLI_PATH PATH=$PATH:./node_modules/.bin