-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description This PR adds support for non UTF-8 output from tasks. Previously we would fail if a task produced UTF-8 when attempting to convert it into a `String` via either [`BufRead::lines`](https://doc.rust-lang.org/std/io/trait.BufRead.html#method.lines) or [`BufRead::read_line`](https://doc.rust-lang.org/std/io/trait.BufRead.html#method.read_line) I'd suggest reviewing this by-commit as each commit should either: - add a failing test - fix the failing test that was added in the previous commit ### Testing Instructions Added failing unit tests for dealing with bytes that aren't valid UTF-8. Tested the behavior of how we handle non-utf8 output in `turbo`: ``` # Script that produces invalid utf8 [0 olszewski@chriss-mbp] /tmp/global $ cat packages/ui/nasty.sh printf "%b" '\x00\x9f\x92\x96' [0 olszewski@chriss-mbp] /tmp/global $ turbo_dev build --experimental-rust-codepath --filter=ui --force ui:build: cache bypass, force executing c1a3e94329df105c ui:build: ui:build: > ui@0.0.0 build /private/tmp/global/packages/ui ui:build: > ./nasty.sh ui:build: ui:build: [0 olszewski@chriss-mbp] /tmp/global $ turbo_dev build --experimental-rust-codepath --filter=ui ui:build: cache hit, suppressing logs c1a3e94329df105c ui:build: ui:build: > ui@0.0.0 build /private/tmp/global/packages/ui ui:build: > ./nasty.sh ui:build: ui:build: ``` Closes TURBO-1460 --------- Co-authored-by: Chris Olszewski <Chris Olszewski>
- Loading branch information
1 parent
b18ee00
commit 18f190d
Showing
7 changed files
with
128 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const process = require("node:process"); | ||
process.stdout.write(new Uint8Array([0, 159, 146, 150]), () => { | ||
// Print newline | ||
console.log(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters