Page MenuHomePhabricator

Strip libphutil for parts
Closed, ResolvedPublic

Description

Today, libphutil has a substantial amount of code which is used only by Phabricator, not by Arcanist.

Historically, the theory here was that libphutil might be used as a third-party library (e.g., you want LinesOfALargeFile or something, so you link against libphutil). Although a handful of use cases for this do exist, they're rare, and first-party and third-party extension development against Phabricator almost universally treats Phabricator as a whole web application platform, not as a utility library.

In an alternate future, D19688 completely removes libphutil. However, this leaves Arcanist with a lot of code it doesn't interact with and which has no reason to be there.

The state of the world can generally be made easier to reason about by moving web-only pieces of libphutil to Phabricator and retconning the merge in D19688. These pieces can move in particular:

  • All OAuth Adapters. Arcanist will never realistically drive an OAuth handshake. (Some usage of OAuth-authenticated APIs may make sense to retain.)
  • All Query layer stuff. Arcanist will never realistically connect directly to a MySQL database.
  • Stuff related to sprites (can this all just be deleted?)
  • All remarkup / markup engine code. Arcanist will never realistically need to render remarkup locally, and can't get a consistent result in the presence of extensions. If it did want to do this kind of rendering, it would use the API.
  • Stemming and search query parsing code.
  • Calendar/ICS parsers.
  • Lipsum Context Free Grammars.

Revisions and Commits

rPHU libphutil
D20979
D20979
D20976
D20974
D20940
D20837
D20773
rARC Arcanist
Needs Review
D20997
D20996
D20993
D20992
D20991
D20990
D20988
D20987
D20986
D20984
D20982
D20980
D20978
rP Phabricator
D21624
D21550
D20995
D20994
D20981
D20977
D20975
D20939
D20838
D20774

Event Timeline

epriestley created this task.

See also https://discourse.phabricator-community.org/t/storage-upgrade-failed-class-phutilauthadapter-not-defined/3468.

If you have a piece of custom extension code which:

  • extends some class previously defined in libphutil/; and
  • is loaded via libphutil/src/extensions/.

You must move it to arcanist/src/extensions/ (if it extends a class now defined in arcanist/) or phabricator/src/extensions/ (if it extends a class now defined in phabricator/). Extensions loaded via libphutil/src/extensions/ may not extend classes which are no longer defined in libphutil/.

I'm also going to collapse as much of experimental into master as I can here, make the minimum required PHP version 5.5 (see T11968), and attempt to collapse wilds.

epriestley claimed this task.

I have another patch on top of D20998 which brings unit over, but it's currently so broken that it can't diff itself.

The diff between master and wilds is still fairly large, but much of what is left can't port cleanly right now (e.g. "delete all lint code") or doesn't need to ever come over. I'm going to call this "done" since libphutil looks dead in any case.