Wrap exec command call with shell to avoid corrupted output#808
Conversation
Morriar
left a comment
There was a problem hiding this comment.
Wouldn't it be clearer to call /bin/sh -c instead?
|
@Morriar that was the original version but it adds a complexity of having to handle two types of quotes in the string, so a bit more noisy and error-prone. I can change it to Because I was not able to reproduce the issue in local Spoom tests, I personally believe that the fix here is not necessary, and we should find the core issue, while using this branch as a relief point for the team and a guidance on where to look for. |
d51d214 to
29e551a
Compare
|
This is a complex issue so I wanted to share my current understanding of how and why it's happening: At Shopify, many of our dev environments are set up with Nix. In some of our Nix-ified environment, Nix wraps Ruby in an execution script that sets This libtiff directory contains the following file: Shelling out from Ruby mitigates the issue because it forces commands to execute from the system shell, where Sorbet will only load the system version of C++ stdlib, thus preventing the error. |
For one of the issues we've seen internally, wrapping the command call into shell to avoid the issue.
Related: https://github.com/Shopify/team-ruby-dx/issues/1724