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

Set encoding for write pipe #364

Merged
merged 2 commits into from Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
# Unreleased

* Fix `Encoding::UndefinedConversionError` error for Rails applications when precompiling cache. (#364)

# 1.7.5

* Handle a regression of Ruby 2.7.3 causing Bootsnap to call the deprecated `untaint` method. (#360)
Expand Down
6 changes: 5 additions & 1 deletion lib/bootsnap/cli/worker_pool.rb
Expand Up @@ -37,7 +37,11 @@ class Worker

def initialize(jobs)
@jobs = jobs
@pipe_out, @to_io = IO.pipe
@pipe_out, @to_io = IO.pipe(binmode: true)
# Set the writer encoding to binary since IO.pipe only sets it for the reader.
# https://github.com/rails/rails/issues/16514#issuecomment-52313290
@to_io.set_encoding(Encoding::BINARY)

@pid = nil
end

Expand Down