{{ message }}
Repository navigation
Commit 53908ef
authored
fix(cli): support compiled next cli e2e runtime (supabase#5240)
## Summary
- Run the next CLI e2e suite against the compiled `dist/supabase-next`
binary so tests exercise the same artifact users run.
- Fix the two compiled-Bun blockers tracked by
[CLI-1452](https://linear.app/supabase/issue/CLI-1452/compiled-bun-compile-next-binary-cant-run-supabase-functions-dev)
and
[CLI-1453](https://linear.app/supabase/issue/CLI-1453/compiled-bun-compile-next-binary-start-detach-daemon-fork-ignores).
## CLI-1452: `functions dev` and native/runtime assets
The compiled next binary could not boot commands that pulled in
`@parcel/watcher`, because the native optional package is not embedded
by `bun --compile` and the fallback `.node` path does not exist inside
Bun's embedded filesystem.
This PR keeps the compiled binary path viable by making the next CLI e2e
harness run through `dist/supabase-next`, by statically referencing the
platform-specific watcher packages, and by embedding the Edge Runtime
bootstrap with Bun's native text import attribute instead of resolving
the bootstrap through a runtime source-file path. The Edge Runtime
service writes that embedded bootstrap source into the runtime temp
directory before launching the function runtime.
## CLI-1453: compiled binary daemon/supervisor dispatch
Compiled Bun ignores the script-path argv shape that works in JIT mode,
so `child_process.fork(daemonEntryPoint)` re-entered the compiled CLI
entrypoint instead of running the daemon script.
This PR makes compiled-binary dispatch explicit: `forkDaemon` marks
daemon children through the environment, and the compiled next CLI
entrypoint routes that child process directly to the daemon runner. The
same pattern is used for process supervision:
`@supabase/process-compose` forks through `process.execPath`, uses a
tiny env protocol only for compiled-Bun self-dispatch, and otherwise
remains a generic Node/Bun process supervision library. The supervisor
runtime/protocol are native `.ts` files, so Bun forks Bun and Node forks
Node.
## Reviewer Notes
The process-compose changes are intentionally runtime-neutral: there are
no Supabase-specific paths or command names in the library.
Supabase-specific compiled-binary dispatch lives in the CLI/stack
entrypoints that own that behavior.
The compiled Bun runtime-dispatch decision is now documented in [ADR
0012](https://github.com/supabase/cli/blob/julien/cli-1452-compiled-bun-compile-next-binary-cant-run-supabase-functions/docs/adr/0012-compiled-bun-runtime-dispatch.md),
and the detached-mode docs now describe the compiled-binary daemon
dispatch path. The watcher loader was also reshaped into nested
platform/arch branches per review feedback.1 parent 0832142 commit 53908ef
36 files changed
Lines changed: 802 additions & 391 deletions
File tree
- .repos
- apps
- cli-go/internal
- testing/fstest
- utils
- cli
- scripts
- src
- next
- commands
- functions/dev
- logs
- start
- status
- stop
- tests/helpers
- docs/adr
- packages
- cli-test-helpers/src
- process-compose/src
- stack
- docs
- src
- services
- tools/release
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
104 | 111 | | |
105 | 112 | | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | | - | |
| 116 | + | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| |||
150 | 158 | | |
151 | 159 | | |
152 | 160 | | |
| 161 | + | |
153 | 162 | | |
154 | | - | |
| 163 | + | |
155 | 164 | | |
156 | 165 | | |
157 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||

0 commit comments