I stumbled across its mention in the Arcanist Quick Start doc whilst setting up a new machine today so went to write a patch before realising that you'd just fixed this a few days ago. Is it expected that Diviner has yet to update?
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Mar 20 2021
Jan 11 2021
Rebased patch series
Rebased patch series
Rebased patch series
Catch Throwable in the test rather than converting to Exception inside phutil_utf8_convert
Ah even better.
https://3v4l.org/eYFoc does work for 5.2.2+ to pass by reference, provided which arguments are passed by reference is part of the contract. But probably best to keep it simple and define xsprintf_test_callback as you say.
Stay under 80 characters (and format the other long preg_match a bit more nicely)
Hm, Harbormaster is failing with:
Fatal error: Call to undefined function ArcanistFormattedStringXHPASTLinterRule::processXsprintfCallback() in /core/data/drydock/workingcopy-70/repo/arcanist/src/xsprintf/xsprintf.php on line 70
Does referencing static functions not work in old PHP versions or something? I tested with 7.4 and it was fine.
In D21500#272930, @epriestley wrote:In the case of hypothetical zsprintf("A %XYZ B", ...), where %XYZ is some multi-character conversion like %Ls, the real zsprintf() would call sprintf("A %s B") internally, while this will call sprintf("A %sYZ B") -- that is, this callback can't know that %XYZ is a single conversion, rather than %X + YZ.
I can't think of any problems this will cause today or any theoretical problems it will cause in the future, and there's no easy way to future-proof it anyway, so I think this is the most reasonable fix.
In D21501#272924, @epriestley wrote:Does this just break a test or something?
With the four revisions I've just added, arc lint works with PHP 8 when run inside the arcanist repo, and arc unit --everything has no regressions compared with PHP 7.4 (both do have a few failures but they're the same and relate to pyflakes/jshint/hg, and look environment-specific so nothing to do with PHP 8).
Trivially rebased for landing
Jan 10 2021
In trying to arc diff --update this I got an exception (but it worked with --head, which I had been using to submit each commit of the patch series). What's the best way to test out arc itself and reproduce that? Use admin.phacility.com to get a testing instance?
In D21497#272834, @epriestley wrote:What's the specific issue you run into with PHP8 with the existing code -- the function emits a deprecation warning when called?
Since the attack surface on the XML entity loader is huge/scary (historically, see D8049), I'd prefer to continue explicitly disabling it if we can. Although there's probably no real risk, I can imagine scenarios like some distro shipping a version of PHP which enables it by default, or users enabling it by default because they run some other software that needs it alongside Phabricator. In these cases, we're a little better off at runtime if we continue disabling the loader.
If this just raises a deprecation warning under PHP8, I'd be more comfortable "fixing" it by suppressing the warning with @ (so @libxml_disable_entity_loader(true); -- not sure how familiar you are with PHP) so that we're still making sure the loader is disabled. Is that reasonable, or does it create more problems?
Suppress deprecation warning with @ rather than skip the function call.