From fdab3f483c78c9a012b93c274f1cc5fd7a9b9a9d Mon Sep 17 00:00:00 2001 From: Eli Polonsky Date: Sun, 6 Jun 2021 19:00:52 +0300 Subject: [PATCH] chore: remove rosetta patch (#15001) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our `yarn-upgrade` workflow is failing with: ```console @lerna/package-graph@4.0.0 ✔ **ERROR** Failed to apply patch for package jsii-rosetta at path node_modules/jsii-rosetta This error was caused because jsii-rosetta has changed since you made the patch file for it. This introduced conflicts with your patch, just like a merge conflict in Git when separate incompatible changes are made to the same piece of code. ``` Basically, its not able to apply the [rosetta patch](https://github.com/aws/aws-cdk/blob/master/patches/jsii-rosetta%2B1.28.0.patch) anymore since a new version of `jsii-rosetta` has been released which creates conflicts. The new version of rosetta [addresses](https://github.com/aws/jsii/pull/2816) the problem the patch was trying to solve, so it is no longer needed (yey). ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- package.json | 2 +- patches/jsii-rosetta+1.28.0.patch | 14 -------------- yarn.lock | 24 ++++++++++++++++++++++++ 3 files changed, 25 insertions(+), 15 deletions(-) delete mode 100644 patches/jsii-rosetta+1.28.0.patch diff --git a/package.json b/package.json index ddd49a146f393..66211c4660943 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "jsii-diff": "^1.29.0", "jsii-pacmak": "^1.29.0", "jsii-reflect": "^1.29.0", - "jsii-rosetta": "^1.29.0", + "jsii-rosetta": "^1.30.0", "lerna": "^4.0.0", "patch-package": "^6.4.7", "standard-version": "^9.3.0", diff --git a/patches/jsii-rosetta+1.28.0.patch b/patches/jsii-rosetta+1.28.0.patch deleted file mode 100644 index 89dc133e267ca..0000000000000 --- a/patches/jsii-rosetta+1.28.0.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/node_modules/jsii-rosetta/lib/commands/extract.js b/node_modules/jsii-rosetta/lib/commands/extract.js -index e695ea9..539038e 100644 ---- a/node_modules/jsii-rosetta/lib/commands/extract.js -+++ b/node_modules/jsii-rosetta/lib/commands/extract.js -@@ -104,7 +104,8 @@ exports.singleThreadedTranslateAll = singleThreadedTranslateAll; - async function workerBasedTranslateAll(worker, snippets, includeCompilerDiagnostics) { - // Use about half the advertised cores because hyperthreading doesn't seem to help that - // much (on my machine, using more than half the cores actually makes it slower). -- const N = Math.max(1, Math.ceil(os.cpus().length / 2)); -+ // Cap to a reasonable top-level limit to prevent thrash on machines with many, many cores. -+ const N = Math.min(16, Math.max(1, Math.ceil(os.cpus().length / 2))); - const snippetArr = Array.from(snippets); - const groups = util_1.divideEvenly(N, snippetArr); - logging.info(`Translating ${snippetArr.length} snippets using ${groups.length} workers`); diff --git a/yarn.lock b/yarn.lock index 60b0cc2629c51..0b6d779ce7535 100644 --- a/yarn.lock +++ b/yarn.lock @@ -537,6 +537,13 @@ dependencies: jsonschema "^1.4.0" +"@jsii/spec@^1.30.0": + version "1.30.0" + resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.30.0.tgz#e5b2381b2be0b9c0839190f9f45d0a038654c73d" + integrity sha512-oXIwvZyHHc/TrwA/3pzQ3gkqBe916EWBvaexNI3rnKZujlHZT4vVVHMCjQ/kUJhcR0GEaahvwlNhiPTu6roC2g== + dependencies: + jsonschema "^1.4.0" + "@lerna/add@4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@lerna/add/-/add-4.0.0.tgz#c36f57d132502a57b9e7058d1548b7a565ef183f" @@ -6098,6 +6105,18 @@ jsii-rosetta@^1.29.0: xmldom "^0.5.0" yargs "^16.2.0" +jsii-rosetta@^1.30.0: + version "1.30.0" + resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.30.0.tgz#5c974eefef9a8e5e1b8364e53e6856f07c7eaf68" + integrity sha512-ChFg5qhvxCaM2bspCqizs48yMtsm5YLHjBoNZLCkbXyc3yMM5l8pnn787B5ww5TI3+tKxKYWkbiKf356kQ1OgQ== + dependencies: + "@jsii/spec" "^1.30.0" + commonmark "^0.29.3" + fs-extra "^9.1.0" + typescript "~3.9.9" + xmldom "^0.6.0" + yargs "^16.2.0" + jsii@^1.29.0: version "1.29.0" resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.29.0.tgz#1f34c29db9299ace0f361e6d72627d4478994396" @@ -10271,6 +10290,11 @@ xmldom@^0.5.0: resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.5.0.tgz#193cb96b84aa3486127ea6272c4596354cb4962e" integrity sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA== +xmldom@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/xmldom/-/xmldom-0.6.0.tgz#43a96ecb8beece991cef382c08397d82d4d0c46f" + integrity sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg== + xregexp@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-2.0.0.tgz#52a63e56ca0b84a7f3a5f3d61872f126ad7a5943"