]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Make sure 'id' and 'idx' are not marked as builtin functions?
authorepriestley <git@epriestley.com>
Sat, 28 May 2011 15:15:00 +0000 (08:15 -0700)
committerepriestley <git@epriestley.com>
Sun, 29 May 2011 09:35:26 +0000 (02:35 -0700)
Summary:
This is sort of a guess. In D357, arc has gone crazy and removed a bunch of
'utils' dependencies for gc3. I think this is because his HPHP/i has them marked
as builtins.

However, I don't have an HPHP/i build (and probably don't have the fortitude to
build it outside of a Facebook environment, I spent about two hours on it at one
point and got maybe 25% of the way through the build process before running into
things I didn't know how to resolve) so I'm not sure this is the issue. No one
else's diffs have exhibited this problem eitehr, so I'm not confident this is
actually the problem or solution.

gc3, can you apply this locally to a copy of arcanist and then run 'arc lint'
(or 'arc lint --apply-patches') on your commit and see if it restores all the
libphutil/utils requirements?

Test Plan:
unable, see summary

Added 'array_keys' to this blacklist and verified the technical behavior of the
patch is correct by var_dump()'ing builtins.

Reviewed By: gc3
Reviewers: gc3, tuomaspelkonen, jungejason, aran
CC: aran, gc3, epriestley
Differential Revision: 361

scripts/phutil_analyzer.php

index 80f5201f61dc1c45443d73438088e3ead4a1f343..2fdc5134fb3eaddb1a632cb45e8af9296487199c 100755 (executable)
@@ -26,15 +26,22 @@ $builtin = array(
   'class'     => array_fill_keys($builtin_classes, true) + array(
     'PhutilBootloader' => true,
   ),
-  'function'  => array_fill_keys($builtin_functions, true) + array(
-    'empty' => true,
-    'isset' => true,
-    'echo'  => true,
-    'print' => true,
-    'exit'  => true,
-    'die'   => true,
-    'phutil_load_library' => true,
-  ),
+  'function'  => array_filter(
+    array(
+      'empty' => true,
+      'isset' => true,
+      'echo'  => true,
+      'print' => true,
+      'exit'  => true,
+      'die'   => true,
+      'phutil_load_library' => true,
+
+      // HPHP/i defines these functions as 'internal', but they are NOT
+      // builtins and do not exist in vanilla PHP. Make sure we don't mark them
+      // as builtin since we need to add dependencies for them.
+      'idx'   => false,
+      'id'    => false,
+    ) + array_fill_keys($builtin_functions, true)),
   'interface' => array_fill_keys($builtin_interfaces, true),
 );