Skip to content
TypeScript

fix(relay): production deploys no longer hang while computing the plan (#30513)

Julius Marminge87f3d93deae0
diff --git a/patches/@[email protected] b/patches/@[email protected]
new file mode 100644
index 00000000000..def5a11fca3
--- /dev/null
+++ b/patches/@[email protected]
@@ -0,0 +1,23 @@
+diff --git a/lib/Schema.js b/lib/Schema.js
+index c24265b3c23237d846c7b8ff249cb6c23452ec31..744c7bce4de464d472b183b3c9c25987b67b3a5e 100644
+--- a/lib/Schema.js
++++ b/lib/Schema.js
+@@ -7,6 +7,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
+ return path;
+ };
+ import * as crypto from "node:crypto";
++import * as NodePath from "node:path";
+ import * as Artifacts from "alchemy/Artifacts";
+ import { isResolved } from "alchemy/Diff";
+ import { Interaction } from "alchemy/Interaction";
+@@ -150,7 +151,9 @@ Effect.tryPromise({
+ // A `drizzle-kit/cli` command as an Effect, failing on a thrown or reported error.
+ const command = (name) => Effect.fn(`drizzleKit.${name}`)(function* (options) {
+ const cli = yield* importModule("drizzle-kit/cli");
+- const result = yield* callDrizzleKit(name, () => cli[name](options));
++ // drizzle-kit reads snapshots as `./${path}`, which breaks an absolute `out`.
++ const kitOptions = { ...options, out: NodePath.relative(process.cwd(), options.out) || "." };
++ const result = yield* callDrizzleKit(name, () => cli[name](kitOptions));
+ if (result.status === "error") {
+ return yield* new DrizzleKitFailed({ command: name, cause: result.error });
+ }
diff --git a/patches/[email protected] b/patches/[email protected]
new file mode 100644
index 00000000000..89116d11648
--- /dev/null
+++ b/patches/[email protected]
@@ -0,0 +1,15 @@
+diff --git a/lib/Artifacts.js b/lib/Artifacts.js
+index 648209c089f984dc45bd5eba0788130c9813a1d6..c66b5433427498ced6c91ee7c371ad8295f6205a 100644
+--- a/lib/Artifacts.js
++++ b/lib/Artifacts.js
+@@ -81,8 +81,8 @@ export const cached = (id) => (eff) => Effect.gen(function* () {
+ return cached;
+ }
+ yield* artifacts.set(id, Deferred.await(deferred));
+- const result = yield* eff;
+- yield* Deferred.succeed(deferred, result);
++ // Settle waiters on failure too, or every later caller hangs.
++ const result = yield* eff.pipe(Effect.onExit((exit) => Deferred.done(deferred, exit)));
+ yield* artifacts.set(id, result);
+ return result;
+ });
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index efc7f6e902d..6ddbc362245 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -363,6 +363,7 @@ packageExtensionsChecksum: sha256-EowbsmlBFaoO0Ypufw901RnvdyjKG5dcdk2FRbc7Dr0=
pnpmfileChecksum: sha256-STsbxG7+RxOFI611PrDEj1TonJgqKKllY9hYCFMLYiU=
patchedDependencies:
+ '@alchemy.run/[email protected]': 2cee685395dc78be51c09096e212b72c67110b487b988b8cf862761055266f47
'@alchemy.run/[email protected]': 29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e
'@clerk/[email protected]': 7a808b92da8460750b85818552e13be3fb73d111691c7db76965970351e124e4
'@effect/[email protected]': 299510b71c36537a832a67e9d160a5f112a5f326a29e95c41cb45fc8234e47c7
@@ -376,6 +377,7 @@ patchedDependencies:
'@react-native-ai/[email protected]': 2d09870c2848d185cb05b53ed823a46e12dba519324d8dd8e584e28731990f9d
'@react-native-menu/[email protected]': 910ec1bf22aa85a96fcf12299cd823bc30f702dd9b2d77b564d10b9ed709f7f6
'@react-navigation/[email protected]': 990d575444c4af2ce8218b3b7a8280fe244c03abbdb32b822a2e862f791dbf42
+ [email protected]: 07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd
[email protected]: 0fbe9ae51783f5768ebe197d12d1fdb7d477a08c92e5db2f6356bcce62613c53
[email protected]: cfff57561b0ee59b5addb3b2e6c6f20906e967507a530ab67e8db8108e520ba4
[email protected]: b391b150cf67acdf23a9d924b791a63f8c4c84ec7a7b18cc82f815f7933fe4ba
@@ -1363,16 +1365,16 @@ importers:
dependencies:
'@alchemy.run/axiom':
specifier: 'catalog:'
'@alchemy.run/cloudflare':
specifier: 'catalog:'
- version: 2.0.0-beta.85(3c6bb1d0d4de1cb5d4932cf1224d79e6)
+ version: 2.0.0-beta.85(dd7c32aca3799e8e8ce256cb7e3dc7c9)
'@alchemy.run/drizzle':
specifier: 'catalog:'
- version: 2.0.0-beta.85(0f2f0b2f6e85ad5bbc9df78a7c15a609)
+ version: 2.0.0-beta.85(patch_hash=2cee685395dc78be51c09096e212b72c67110b487b988b8cf862761055266f47)(c1f3d09c6baaf4c1733ba821d1f217d2)
'@alchemy.run/planetscale':
specifier: 'catalog:'
'@clerk/backend':
specifier: 3.25.0
@@ -1402,7 +1404,7 @@ importers:
version: link:../../packages/shared
alchemy:
specifier: 2.0.0-beta.85
drizzle-orm:
specifier: 1.0.0-rc.5-ab785fc
@@ -1412,7 +1414,7 @@ importers:
devDependencies:
'@alchemy.run/test':
specifier: 'catalog:'
- version: 2.0.0-beta.85(patch_hash=29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e)(071253407c4f3cb63d401833ee1dda26)
+ version: 2.0.0-beta.85(patch_hash=29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e)(ab1fd4de217877436c0d2ce8bcf45a98)
'@cloudflare/workers-types':
specifier: ^4.20260601.1
version: 4.20260604.1
@@ -1445,13 +1447,13 @@ importers:
dependencies:
'@alchemy.run/axiom':
specifier: 'catalog:'
'@alchemy.run/cloudflare':
specifier: 'catalog:'
- version: 2.0.0-beta.85(3c6bb1d0d4de1cb5d4932cf1224d79e6)
+ version: 2.0.0-beta.85(dd7c32aca3799e8e8ce256cb7e3dc7c9)
alchemy:
specifier: 2.0.0-beta.85
effect:
specifier: 4.1.2
version: 4.1.2
@@ -6068,10 +6070,6 @@ packages:
'@pierre/[email protected]':
resolution: {integrity: sha512-hTpcOU1EzDAP4bYtEhxmMu2jwMvtkUydRUBUpWMSHTs3dw0IaC3Ld5ansMy18L0GE3b6Vfl2OGkLK+pWWpnBmw==}
- '@pierre/[email protected]':
- resolution: {integrity: sha512-GC2OWTAfTIIWWYhPCygwG8t2EtePQkRfON4MI2rwIkJylmiyqIttJID2dCL8sUD8cNdEvYkEyfEHHKMeCiDLoQ==}
- engines: {vscode: ^1.0.0}
-
'@pierre/[email protected]':
resolution: {integrity: sha512-yNDd9GYLQl1mEUJR8AneJ5e4ohLIHQd/wZLWr4fagt78vS2RwwZNW530vVgHqXFAyFVcFlRmGUD5ramXH46OXw==}
engines: {vscode: ^1.0.0}
@@ -12538,17 +12536,17 @@ snapshots:
dependencies:
json-schema: 0.4.0
dependencies:
'@distilled.cloud/acme': 1.0.0-rc.18([email protected])
effect: 4.1.2
dependencies:
'@distilled.cloud/axiom': 1.0.0-rc.18([email protected])
'@distilled.cloud/core': 1.0.0-rc.18([email protected])
effect: 4.1.2
@@ -12575,19 +12573,19 @@ snapshots:
- proxy-agent
- typescript
- '@alchemy.run/[email protected](3c6bb1d0d4de1cb5d4932cf1224d79e6)':
+ '@alchemy.run/[email protected](dd7c32aca3799e8e8ce256cb7e3dc7c9)':
dependencies:
'@distilled.cloud/aws': 1.0.0-rc.18([email protected])
'@distilled.cloud/aws4signer': 1.0.0-rc.18([email protected])
'@distilled.cloud/cloudflare': 1.0.0-rc.18([email protected])
'@distilled.cloud/core': 1.0.0-rc.18([email protected])
'@distilled.cloud/iceberg': 1.0.0-rc.18([email protected])
'@effect/sql-d1': 4.1.1([email protected])
effect: 4.1.2
pathe: 2.0.3
picomatch: 4.0.7
@@ -12607,24 +12605,24 @@ snapshots:
- proxy-agent
- typescript
dependencies:
effect: 4.1.2
rolldown: 1.2.13
optionalDependencies:
'@effect/platform-bun': 4.1.2([email protected])([email protected])([email protected])
- '@alchemy.run/[email protected](0f2f0b2f6e85ad5bbc9df78a7c15a609)':
+ '@alchemy.run/[email protected](patch_hash=2cee685395dc78be51c09096e212b72c67110b487b988b8cf862761055266f47)(c1f3d09c6baaf4c1733ba821d1f217d2)':
dependencies:
'@effect/sql-d1': 4.1.1([email protected])
'@effect/sql-sqlite-do': 4.1.2([email protected])
effect: 4.1.2
optionalDependencies:
- '@alchemy.run/cloudflare': 2.0.0-beta.85(3c6bb1d0d4de1cb5d4932cf1224d79e6)
+ '@alchemy.run/cloudflare': 2.0.0-beta.85(dd7c32aca3799e8e8ce256cb7e3dc7c9)
'@effect/sql-pg': 4.1.2([email protected])
drizzle-kit: 1.0.0-rc.5-ab785fc
transitivePeerDependencies:
@@ -12636,12 +12634,12 @@ snapshots:
chokidar: 5.0.0
rolldown: 1.2.13
dependencies:
'@distilled.cloud/core': 1.0.0-rc.18([email protected])
'@distilled.cloud/planetscale': 1.0.0-rc.18([email protected])
effect: 4.1.2
optionalDependencies:
pg: 8.23.0
@@ -12655,21 +12653,21 @@ snapshots:
'@types/react': 19.3.0
react-devtools-core: 6.1.5([email protected])([email protected])
dependencies:
effect: 4.1.2
optionalDependencies:
'@effect/sql-pg': 4.1.2([email protected])
pg: 8.23.0
- '@alchemy.run/[email protected](patch_hash=29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e)(071253407c4f3cb63d401833ee1dda26)':
+ '@alchemy.run/[email protected](patch_hash=29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e)(ab1fd4de217877436c0d2ce8bcf45a98)':
dependencies:
'@effect/platform-bun': 4.1.2([email protected])([email protected])([email protected])
effect: 4.1.2
optionalDependencies:
transitivePeerDependencies:
- bufferutil
@@ -15697,8 +15695,6 @@ snapshots:
'@pierre/[email protected]': {}
- '@pierre/[email protected]': {}
-
'@pierre/[email protected]': {}
@@ -17235,7 +17231,7 @@ snapshots:
json-schema-traverse: 1.0.0
require-from-string: 2.0.2
dependencies:
'@alchemy.run/node-utils': 2.0.0-beta.85
'@alchemy.run/sigil': 0.1.0-alpha.1(@types/[email protected])([email protected]([email protected])([email protected]))
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 40583e9402d..72167e4d891 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -409,6 +409,10 @@ patchedDependencies:
# Observe the owned host exit independently of descendants retaining its stdio.
"@muse-code/[email protected]": patches/@[email protected]
+ # drizzle-kit fails on an absolute `out`: https://github.com/alchemy-run/alchemy/issues/2980
+ "@alchemy.run/[email protected]": patches/@[email protected]
+ # A failed Artifacts.cached effect hangs every later caller: https://github.com/alchemy-run/alchemy/issues/2981
peerDependencyRules:
allowAny: