From 5407e5e5c67e1e3b62650b7069af0becfc15e05e Mon Sep 17 00:00:00 2001 From: James Brown Date: Mon, 2 Aug 2021 15:48:15 -0700 Subject: [PATCH] Fix PhutilLibraryMapBuilder to call the right function in log() Summary: `arc liberate` has been broken for a while because the `log` function attempts to call `fwrite` (whose third argument is an integer length) instead of `fprintf`. I think maybe PHP 5 was more lenient about this? Anyway, this bug makes other development somewhat tricky. The arcanist source in general seems to be split between `fwrite(STDERR, $message."\n")` and `fprintf(STDERR, "%\n", $message)`; I decided to go with the latter. This is sort of a test balloon on submitting diffs to Phorge. Please feel free to let me know if there's anything you'd like done differently! Test Plan: Ran `arc liberate` to regenerate source maps and didn't get any errors Reviewers: O1 Blessed Committers, eax Reviewed By: O1 Blessed Committers, eax Subscribers: chris, speck, tobiaswiese Differential Revision: https://we.phorge.it/D25017 --- src/moduleutils/PhutilLibraryMapBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/moduleutils/PhutilLibraryMapBuilder.php b/src/moduleutils/PhutilLibraryMapBuilder.php index e590e092..684ae640 100644 --- a/src/moduleutils/PhutilLibraryMapBuilder.php +++ b/src/moduleutils/PhutilLibraryMapBuilder.php @@ -122,7 +122,7 @@ final class PhutilLibraryMapBuilder extends Phobject { */ private function log($message) { if (!$this->quiet) { - @fwrite(STDERR, "%s\n", $message); + @fprintf(STDERR, "%s\n", $message); } return $this; }