From 7cf00d1503510bf4dc8b8b986e6a3060d3c21e99 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sun, 5 Nov 2023 16:54:00 +0100 Subject: [PATCH] [backend] Move to our own fork of the re2 package This fixes builds on alpine-arm64 (and presumably also other musl-arm64 distros) --- .pnp.cjs | 34 +++++++++---------- ...p-re2-npm-1.20.6-2ee015ddd5-d1831fdd46.zip | 3 ++ .../re2-npm-1.20.5-851f906517-94979a62e5.zip | 3 -- .yarnrc.yml | 4 +++ packages/backend/package.json | 2 +- .../1644010796173-convert-hard-mutes.ts | 2 +- packages/backend/src/misc/check-word-mute.ts | 2 +- .../src/server/api/endpoints/i/update.ts | 2 +- yarn.lock | 24 ++++++------- 9 files changed, 40 insertions(+), 36 deletions(-) create mode 100644 .yarn/cache/@iceshrimp-re2-npm-1.20.6-2ee015ddd5-d1831fdd46.zip delete mode 100644 .yarn/cache/re2-npm-1.20.5-851f906517-94979a62e5.zip diff --git a/.pnp.cjs b/.pnp.cjs index e3db0d269..aa2678576 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -414,6 +414,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "@humanwhocodes/object-schema",\ "npm:1.2.1"\ ],\ + [\ + "@iceshrimp/re2",\ + "npm:1.20.6::__archiveUrl=https%3A%2F%2Ficeshrimp.dev%2Fapi%2Fpackages%2Ficeshrimp%2Fnpm%2F%2540iceshrimp%252Fre2%2F-%2F1.20.6%2Fre2-1.20.6.tgz"\ + ],\ [\ "@ioredis/commands",\ "npm:1.2.0"\ @@ -5586,10 +5590,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "rdf-canonize",\ "npm:3.4.0"\ ],\ - [\ - "re2",\ - "npm:1.20.5"\ - ],\ [\ "react-is",\ "npm:18.2.0"\ @@ -9048,6 +9048,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ + ["@iceshrimp/re2", [\ + ["npm:1.20.6::__archiveUrl=https%3A%2F%2Ficeshrimp.dev%2Fapi%2Fpackages%2Ficeshrimp%2Fnpm%2F%2540iceshrimp%252Fre2%2F-%2F1.20.6%2Fre2-1.20.6.tgz", {\ + "packageLocation": "./.yarn/unplugged/@iceshrimp-re2-npm-1.20.6-2ee015ddd5/node_modules/@iceshrimp/re2/",\ + "packageDependencies": [\ + ["@iceshrimp/re2", "npm:1.20.6::__archiveUrl=https%3A%2F%2Ficeshrimp.dev%2Fapi%2Fpackages%2Ficeshrimp%2Fnpm%2F%2540iceshrimp%252Fre2%2F-%2F1.20.6%2Fre2-1.20.6.tgz"],\ + ["install-artifact-from-github", "npm:1.3.3"],\ + ["nan", "npm:2.18.0"],\ + ["node-gyp", "npm:9.4.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@ioredis/commands", [\ ["npm:1.2.0", {\ "packageLocation": "./.yarn/cache/@ioredis-commands-npm-1.2.0-47541de88b-9b20225ba3.zip/node_modules/@ioredis/commands/",\ @@ -13935,6 +13947,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@bull-board/ui", "npm:5.6.0"],\ ["@discordapp/twemoji", "npm:14.1.2"],\ ["@elastic/elasticsearch", "npm:7.17.0"],\ + ["@iceshrimp/re2", "npm:1.20.6::__archiveUrl=https%3A%2F%2Ficeshrimp.dev%2Fapi%2Fpackages%2Ficeshrimp%2Fnpm%2F%2540iceshrimp%252Fre2%2F-%2F1.20.6%2Fre2-1.20.6.tgz"],\ ["@koa/cors", "npm:3.4.3"],\ ["@koa/multer", "virtual:aa59773ac87791c4813d53447077fcf8a847d6de5a301d34dc31286584b1dbb26d30d3adb5b4c41c1e8aea04371e926fda05c09c6253647c432e11d872a304ba#npm:3.0.2"],\ ["@koa/router", "npm:9.0.1"],\ @@ -14072,7 +14085,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["qs", "npm:6.11.2"],\ ["random-seed", "npm:0.3.0"],\ ["ratelimiter", "npm:3.4.1"],\ - ["re2", "npm:1.20.5"],\ ["redis-lock", "npm:0.1.4"],\ ["redis-semaphore", "virtual:aa59773ac87791c4813d53447077fcf8a847d6de5a301d34dc31286584b1dbb26d30d3adb5b4c41c1e8aea04371e926fda05c09c6253647c432e11d872a304ba#npm:5.3.1"],\ ["reflect-metadata", "npm:0.1.13"],\ @@ -27672,18 +27684,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "linkType": "HARD"\ }]\ ]],\ - ["re2", [\ - ["npm:1.20.5", {\ - "packageLocation": "./.yarn/unplugged/re2-npm-1.20.5-851f906517/node_modules/re2/",\ - "packageDependencies": [\ - ["re2", "npm:1.20.5"],\ - ["install-artifact-from-github", "npm:1.3.3"],\ - ["nan", "npm:2.18.0"],\ - ["node-gyp", "npm:9.4.0"]\ - ],\ - "linkType": "HARD"\ - }]\ - ]],\ ["react-is", [\ ["npm:17.0.2", {\ "packageLocation": "./.yarn/cache/react-is-npm-17.0.2-091bbb8db6-9d6d111d89.zip/node_modules/react-is/",\ diff --git a/.yarn/cache/@iceshrimp-re2-npm-1.20.6-2ee015ddd5-d1831fdd46.zip b/.yarn/cache/@iceshrimp-re2-npm-1.20.6-2ee015ddd5-d1831fdd46.zip new file mode 100644 index 000000000..6776dc444 --- /dev/null +++ b/.yarn/cache/@iceshrimp-re2-npm-1.20.6-2ee015ddd5-d1831fdd46.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54c21c9ede88688d17735036df0abfa2361d7dff07843de388e08dc58fb76ccb +size 3590196 diff --git a/.yarn/cache/re2-npm-1.20.5-851f906517-94979a62e5.zip b/.yarn/cache/re2-npm-1.20.5-851f906517-94979a62e5.zip deleted file mode 100644 index 4366329c9..000000000 --- a/.yarn/cache/re2-npm-1.20.5-851f906517-94979a62e5.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e69a5558758f7d7f136166c3e98a65783c30a3e13a0ae401a119e1ca5854ee0a -size 3550106 diff --git a/.yarnrc.yml b/.yarnrc.yml index 59fec2db7..430ab343a 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -9,3 +9,7 @@ supportedArchitectures: plugins: - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs spec: "@yarnpkg/plugin-workspace-tools" + +npmScopes: + iceshrimp: + npmRegistryServer: "https://iceshrimp.dev/api/packages/iceshrimp/npm/" diff --git a/packages/backend/package.json b/packages/backend/package.json index 47a1f6d0d..6fa70887e 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -28,6 +28,7 @@ "@bull-board/ui": "5.6.0", "@discordapp/twemoji": "14.1.2", "@elastic/elasticsearch": "7.17.0", + "@iceshrimp/re2": "^1.20.6", "@koa/cors": "3.4.3", "@koa/multer": "3.0.2", "@koa/router": "9.0.1", @@ -110,7 +111,6 @@ "qs": "6.11.2", "random-seed": "0.3.0", "ratelimiter": "3.4.1", - "re2": "^1.20.5", "redis-lock": "0.1.4", "redis-semaphore": "5.3.1", "reflect-metadata": "0.1.13", diff --git a/packages/backend/src/migration/1644010796173-convert-hard-mutes.ts b/packages/backend/src/migration/1644010796173-convert-hard-mutes.ts index 0ddd2bdf3..7b00238f1 100644 --- a/packages/backend/src/migration/1644010796173-convert-hard-mutes.ts +++ b/packages/backend/src/migration/1644010796173-convert-hard-mutes.ts @@ -1,5 +1,5 @@ import { MigrationInterface, QueryRunner } from "typeorm"; -import RE2 from "re2"; +import RE2 from "@iceshrimp/re2"; export class convertHardMutes1644010796173 implements MigrationInterface { name = "convertHardMutes1644010796173"; diff --git a/packages/backend/src/misc/check-word-mute.ts b/packages/backend/src/misc/check-word-mute.ts index 341b3b52f..dc89859f8 100644 --- a/packages/backend/src/misc/check-word-mute.ts +++ b/packages/backend/src/misc/check-word-mute.ts @@ -1,4 +1,4 @@ -import RE2 from "re2"; +import RE2 from "@iceshrimp/re2"; import type { Note } from "@/models/entities/note.js"; import type { User } from "@/models/entities/user.js"; diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index 84e1f0bb2..5e9570d9f 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -1,4 +1,4 @@ -import RE2 from "re2"; +import RE2 from "@iceshrimp/re2"; import * as mfm from "mfm-js"; import { publishMainStream, publishUserEvent } from "@/services/stream.js"; import acceptAllFollowRequests from "@/services/following/requests/accept-all.js"; diff --git a/yarn.lock b/yarn.lock index 88e417f16..db3399f54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1387,6 +1387,17 @@ __metadata: languageName: node linkType: hard +"@iceshrimp/re2@npm:^1.20.6": + version: 1.20.6 + resolution: "@iceshrimp/re2@npm:1.20.6::__archiveUrl=https%3A%2F%2Ficeshrimp.dev%2Fapi%2Fpackages%2Ficeshrimp%2Fnpm%2F%2540iceshrimp%252Fre2%2F-%2F1.20.6%2Fre2-1.20.6.tgz" + dependencies: + install-artifact-from-github: ^1.3.3 + nan: ^2.18.0 + node-gyp: ^9.4.0 + checksum: d1831fdd46f23cf46993773156ce796ee3cada4d5083a1916a9c8ba716d05a93a77d15f162cdadc8ff4c3fa4fa977300082b92053076ced294ca512069ab92bc + languageName: node + linkType: hard + "@ioredis/commands@npm:^1.1.1": version: 1.2.0 resolution: "@ioredis/commands@npm:1.2.0" @@ -5289,6 +5300,7 @@ __metadata: "@bull-board/ui": 5.6.0 "@discordapp/twemoji": 14.1.2 "@elastic/elasticsearch": 7.17.0 + "@iceshrimp/re2": ^1.20.6 "@koa/cors": 3.4.3 "@koa/multer": 3.0.2 "@koa/router": 9.0.1 @@ -5426,7 +5438,6 @@ __metadata: qs: 6.11.2 random-seed: 0.3.0 ratelimiter: 3.4.1 - re2: ^1.20.5 redis-lock: 0.1.4 redis-semaphore: 5.3.1 reflect-metadata: 0.1.13 @@ -17230,17 +17241,6 @@ __metadata: languageName: node linkType: hard -"re2@npm:^1.20.5": - version: 1.20.5 - resolution: "re2@npm:1.20.5" - dependencies: - install-artifact-from-github: ^1.3.3 - nan: ^2.18.0 - node-gyp: ^9.4.0 - checksum: 94979a62e52cd35530ea496c64e9bc10266265ce8fb8ed233184b99c035d1cfe8e353bb46e0f5ac1648f0496bda28bc39026d71a32c7078e4b4daa984a7c510e - languageName: node - linkType: hard - "react-is@npm:^17.0.1": version: 17.0.2 resolution: "react-is@npm:17.0.2"