Page MenuHomePhabricator

Mostly remove "STDERR" and "STDOUT" constants from Arcanist
ClosedPublic

Authored by epriestley on Apr 28 2022, 10:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 28, 7:28 PM
Unknown Object (File)
Sat, Apr 20, 5:54 PM
Unknown Object (File)
Sat, Apr 20, 5:36 PM
Unknown Object (File)
Fri, Apr 19, 9:35 AM
Unknown Object (File)
Mon, Apr 15, 11:26 PM
Unknown Object (File)
Mon, Apr 8, 1:47 AM
Unknown Object (File)
Mon, Apr 8, 12:39 AM
Unknown Object (File)
Sun, Apr 7, 7:28 PM
Subscribers

Details

Summary

Ref T13675. Ref T13556. The "STDOUT" and "STDERR" constants are defined by the PHP CLI SAPI, in cli_register_file_handles().

The "native arc" embedded PHP wrapper doesn't define these, and there's no real reason to define them, since they're just defined in terms of the PHP stream wrappers ("php://stdin", etc) anyway.

This patch isn't exhaustive (and a subsequent change should add lint, rejecting these magic constants) but is just trying to make native arc functional.

Test Plan

Created this revision with a standalone native arc binary.

Diff Detail

Repository
rARC Arcanist
Branch
stdio
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsrc/filesystem/PhutilErrorLog.php:31XHP20Tautological Expression
Unit
Test Failures
Build Status
Buildable 25688
Build 35516: arc lint + arc unit

Unit TestsFailed

TimeTest
1,118 msArcanistBundleTestCase::testGitRepository
EXCEPTION (Exception): This patch has binary data. The PHP zlib extension is required to apply patches with binary data to git. Install the PHP zlib extension to continue. #0 /Users/epriestley/dev/core/lib/arcanist/src/parser/ArcanistBundle.php(823): ArcanistBundle::newBase85Data('\x89PNG\r\n\x1A\n\x00\x00\x00\rIHD...', '\n') #1 /Users/epriestley/dev/core/lib/arcanist/src/parser/ArcanistBundle.php(813): ArcanistBundle->emitBinaryDiffBody('\x89PNG\r\n\x1A\n\x00\x00\x00\rIHD...')
0 msAbstractDirectedGraphTestCase::testCyclicGraph
1 assertion(s) passed.
0 msAbstractDirectedGraphTestCase::testEdgeLoadFailure
1 assertion(s) passed.
0 msAbstractDirectedGraphTestCase::testNonTreeGraph
1 assertion(s) passed.
0 msAbstractDirectedGraphTestCase::testNoncyclicGraph
1 assertion(s) passed.
View Full Test Results (1 Failed · 240 Passed)

Event Timeline

epriestley created this revision.
cspeckmim added inline comments.
src/utils/PhutilSystem.php
31

This and the next function look swapped. This is getStderr but is initializing and returning stdout, and vice-versa below

src/utils/PhutilSystem.php
31

Ah, quite. Thanks!

  • Fix stderr vs stdout mixup.
This revision was not accepted when it landed; it landed in state Needs Review.May 3 2022, 6:58 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.