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

feat(windows): allow open and Bun.file() with /dev/null #8499

Merged
merged 3 commits into from
Jan 29, 2024

Conversation

paperclover
Copy link
Member

@paperclover paperclover commented Jan 26, 2024

Closes #8359

On windows, opening the exact filename /dev/null, with forward slashes, will open the windows null device.

We should NOT recommend this pattern anywhere and it is ONLY here for compatibility with badly written npm dependencies, should any even exist.

The correct way to write this code is using os.devNull https://nodejs.org/api/os.html#osdevnull

Copy link
Contributor

github-actions bot commented Jan 26, 2024

Copy link
Contributor

github-actions bot commented Jan 26, 2024

Copy link
Contributor

github-actions bot commented Jan 26, 2024

Copy link
Contributor

github-actions bot commented Jan 26, 2024

Copy link
Contributor

github-actions bot commented Jan 26, 2024

❌🪟 @paperdave, there are 7 test regressions on Windows x86_64

  • test\bundler\bundler_edgecase.test.ts
  • test\bundler\cli.test.ts
  • test\cli\inspect\inspect.test.ts
  • test\js\bun\util\bun-file-windows.test.ts
  • test\js\node\async_hooks\AsyncLocalStorage.test.ts
  • test\regression\issue\08095.test.ts
  • test\transpiler\template-literal.test.ts

Full Test Output

@paperclover
Copy link
Member Author

TODO: make sure the string in bun.file() does not get freed

@Jarred-Sumner Jarred-Sumner merged commit 3046b0e into main Jan 29, 2024
20 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dave/win/devnull branch January 29, 2024 19:08
ryoppippi pushed a commit to ryoppippi/bun that referenced this pull request Feb 1, 2024
sroussey pushed a commit to sroussey/bun that referenced this pull request Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[windows] Make /dev/null work
2 participants