drush icon indicating copy to clipboard operation
drush copied to clipboard

Suppress bash process substitution warnings

Open chx opened this issue 3 years ago • 4 comments

As shown in https://bugs.php.net/bug.php?id=53465 PHP has special syntax for bash process substitution. Now, since we pass the filename to shell utilities to do the actual work, it's okay(-ish) to just suppress all the warnings in PHP.

It also suppresses the natural fopen errors for all nonexisting files but since there's an explicit logger call for that, that's nicer in my opinion.

chx avatar Oct 05 '21 08:10 chx

PRs should now target 11.x branch. Also, how do i test this? what command?

weitzman avatar Oct 05 '21 11:10 weitzman

The easiest way to test is to replace drush sqlq --file=somefile.sql with drush sqlq --file=<(cat somefile.sql) under bash or zsh (this is pointless but it'll do for testing). You might want to run with --debug too.

chx avatar Oct 05 '21 11:10 chx

Does this look OK to folks? Any unwanted side effects? This area isnt exactly my strength.

weitzman avatar Oct 15 '21 20:10 weitzman

Seems okay to me. My only reservation is whether preg_match is the best way to detect a named file descriptor. Since getting this wrong would only amount to an extra log message (worst case), though, I think it's probably okay to let it go.

Still needs rebasing on 11.x.

greg-1-anderson avatar Jan 04 '22 02:01 greg-1-anderson