Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bun patch crash 🥺 (symlinks) #15784

Open
subtleGradient opened this issue Dec 15, 2024 · 1 comment · May be fixed by #15809
Open

bun patch crash 🥺 (symlinks) #15784

subtleGradient opened this issue Dec 15, 2024 · 1 comment · May be fixed by #15809
Labels
crash An issue that could cause a crash macOS An issue that occurs on macOS

Comments

@subtleGradient
Copy link

subtleGradient commented Dec 15, 2024

How can we reproduce the crash?

not sure how you can reproduce it.
happened in a private repo that I'm not allowed to share yet.
it's a monorepo with two bun workspaces:

tom@Play-Aylott ReFrame % find . -name "package.json" | grep -vE 'node_modules|.next'

./package.json
./packages/@types/react-server-dom-webpack/package.json
./packages/@repo/ui/package.json
./packages/@repo/eslint-config/package.json
./packages/@repo/typescript-config/package.json
./packages/@subtlegradient/reframe/package.json
./packages/@double-observer/react-server/package.json
./packages/@double-observer/react-server-dom-esm/esm/package.json
./packages/@double-observer/react-server-dom-esm/package.json
./packages/@double-observer/react-client/package.json
./apps/web/package.json
./apps/docs/package.json
./demos/server/bun/package.json
./demos/server/node/package.json

There is another separate workspace in the same repo:
(to work around The Bun Hoisting Problem™ that makes it impossible to properly use React 18 and React 19 in the same workspace)

./demos/18/package.json
./demos/18/expo/package.json

crash happens when I try to patch @double-observer/react-server-dom-esm from inside of packages/@subtlegradient/reframe

Relevant log output

tom@Play-Aylott ReFrame % bun patch @double-observer/react-server-dom-esm
bun patch v1.1.38 (bf2f153f)

$ watchman watch-del "$PWD"; ./sh/sh.sh --quiet; cd demos/18; bun i
{
    "version": "2024.09.09.00",
    "error": "watchman::RootResolveError: failed to resolve root: unable to resolve root /Users/tom/Developer/subtleGradient/ReFrame: failed to resolve root: directory /Users/tom/Developer/subtleGradient/ReFrame is not watched"
}
🚫 node version 18.18.2 is older than required version 23.0.0
⚠️ podman version 5.2.5 is older than required version 5.3.1
🚫 Still missing tools: nodejs podman
Please install the missing tools manually:
   - nodejs: https://nodejs.org
   - podman: https://podman.io
🥺 Script doesn't know how to continue
bun install v1.1.38 (bf2f153f)

+ @double-observer/react-client@../../packages/@double-observer/react-client
+ @repo/eslint-config@../../packages/@repo/eslint-config
+ @repo/typescript-config@../../packages/@repo/typescript-config
+ @subtlegradient/reframe@../../packages/@subtlegradient/reframe
+ @types/react-server-dom-webpack@../../packages/@types/react-server-dom-webpack

9 packages installed [330.00ms]

Checked 639 installs across 640 packages (no changes) [1385.00ms]

To patch @double-observer/react-server-dom-esm, edit the following folder:

  node_modules/@double-observer/react-server-dom-esm

Once you're done with your changes, run:

  bun patch --commit 'node_modules/@double-observer/react-server-dom-esm'
tom@Play-Aylott ReFrame %

...


tom@Play-Aylott ReFrame % bun patch --commit '/Users/tom/Developer/subtleGradient/ReFrame/node_modules/@double-observer/react-server-dom-esm'

bun patch v1.1.38 (bf2f153f)
============================================================
Bun v1.1.38 (bf2f153f) macOS Silicon
macOS v15.1.1
Args: "bun" "patch" "--commit" "/Users/tom/Developer/subtleGradient/ReFrame/node_modules/@double-observer/react-server-dom-esm"
Elapsed: 5ms | User: 4ms | Sys: 7ms
RSS: 10.68MB | Peak: 10.68MB | Commit: 1.07GB | Faults: 84

panic(main thread): Segmentation fault at address 0x108
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.1.38/Mx1bf2f153AA_ux1qCus81Dm/vzD+3g6Dm+66DuzpB2ggB__A2AwQ

zsh: trace trap  bun patch --commit

Stack Trace (bun.report)

Bun v1.1.38 (bf2f153) on macos aarch64 [PatchCommand]

Segmentation fault at address 0x00000108

  • 1 unknown/js code
  • src.install.install.PackageManager.computeCacheDirAndSubpath
  • src.install.install.PackageManager.doPatchCommit__anon_85736
  • src.install.install.PackageManager.updatePackageJSONAndInstallWithManager__anon_82483
  • src.install.install.PackageManager.updatePackageJSONAndInstall
  • src.cli.patch_command.PatchCommand.exec
  • src.cli.Cli.start
  • main

Sentry Issue: BUN-9V4

@subtleGradient subtleGradient added the crash An issue that could cause a crash label Dec 15, 2024
@github-actions github-actions bot added the macOS An issue that occurs on macOS label Dec 15, 2024
@subtleGradient subtleGradient changed the title bun patch crash 🥺 bun patch crash 🥺 (symlinks) Dec 15, 2024
@subtleGradient
Copy link
Author

I'm trying to patch a linked workspace package (for secret reasons).

tom@Play-Aylott reframe % ls -la /Users/tom/Developer/subtleGradient/ReFrame/node_modules/@double-observer/react-server-dom-esm
lrwxrwxrwx@ 1 tom  staff  52 Dec 14 15:21 /Users/tom/Developer/subtleGradient/ReFrame/node_modules/@double-observer/react-server-dom-esm -> ../../packages/@double-observer/react-server-dom-esm

I'll try manually deleting the symlink and moving the real folder there to see if it works that way

Jarred-Sumner added a commit that referenced this issue Dec 17, 2024
@Jarred-Sumner Jarred-Sumner linked a pull request Dec 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash An issue that could cause a crash macOS An issue that occurs on macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant