oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.35k stars 2.78k forks source link

Call Bun__onExit + std.os.windows.kernel32.ExitProcess to exit on Windows #15237

Closed heimskr closed 3 days ago

heimskr commented 3 days ago

What does this PR do?

This fixes crashes on exit in Windows caused by how process termination works on Windows vs. POSIX.

How did you verify your code works?

I ran bun-debug --debug create astro then Ctrl-C'd partway through to exit, then tried scrolling and running ls to see whether the terminal state was being reset properly. I did this in three terminals: VS Code, Windows Terminal and cmd.exe.

robobun commented 3 days ago

:x: @dylan-conway, your commit 45ad885f1260d8614a6492714fef67a757d5ea84 has 8 failures in #6373:

  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64-baseline
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 aarch64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64-baseline
  • test/cli/install/registry/bun-install-registry.test.ts - timeout on 🐧 3.20 aarch64
  • test/cli/install/registry/bun-install-registry.test.ts - timeout on 🐧 3.20 x64-baseline
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 aarch64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64-baseline
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/js/bun/ffi/cc.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/bun/ffi/cc.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/bun/ffi/cc.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 aarch64
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 x64
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 x64-baseline