Page MenuHomePhabricator

`arc lint --everything` reporting all symbols missing in libphutil/ on Windows?
Open, NormalPublic

Description

See IRC; @bluehawk is seeing arc report all symbols as missing even after libphutil and arcanist updates.

Event Timeline

epriestley raised the priority of this task from to Normal.
epriestley updated the task description. (Show Details)
epriestley added projects: Arcanist, Windows.
epriestley added subscribers: epriestley, bluehawk.

I did some git bisect-ing but ran into troubles.

I did a git bisect in libphutil, and then whenever git would change the commit, I would run the following in the arcanist folder, so that arcanist was checked out to roughly the same era.

git checkout $(git rev-list -n 1 --before="`cd ../libphutil && git log --format='%aD' -1`" master)

The problem is that any commit from before 41d51cc gives me:

---------------------------
xhpast.exe - System Error
---------------------------
The program can't start because libgcc_s_dw2-1.dll is missing from your computer. Try reinstalling the program to fix this problem. 
---------------------------
OK   
---------------------------

Which is expected, I think, since that commit fixed T5372

I assume I'll need to make it so that I can build xhpast.exe myself, and see if I can get it working that way.

Tinkered with this again today, really frustrating trying to get phutil lint to work at all on windows.

Running arc lint --everything from within a completely up to date copy of libphutil (the copy that my arc command is using) yields some rather strange results. Some of the "Use of unknown class" are pulling out very strange things. Here is an example:

>>> Lint for F:\bin\arcanist\src\workflow\exception\ArcanistCapabilityNotSupportedException.php:


   Error  (PHL1) Unknown Symbol
    Use of unknown class 's Excepti'. Common causes are:

      - Your libphutil/ is out of date.
        This is the most common cause.
        Update this copy of libphutil: F:\bin\libphutil

      - Some other library is out of date.
        Update the library this symbol appears in.

      - This symbol is misspelled.
        Spell the symbol name correctly.
        Symbol name spelling is case-sensitive.

      - This symbol was added recently.
        Run `arc liberate` on the library it was added to.

      - This symbol is external. Use `@phutil-external-symbol`.
        Use `grep` to find usage examples of this directive.

    *** ALTHOUGH USUALLY EASY TO FIX, THIS IS A SERIOUS ERROR.
    *** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.

               1 <?php
               2
    >>>        3 final class ArcanistCapabilityNotSupportedException extends Exception {
               4
               5   public function __construct(ArcanistRepositoryAPI $api) {
               6     $name = $api->getSourceControlSystemName();

   Error  (PHL1) Unknown Symbol
    Use of unknown class/interface 'uct(ArcanistRepositor'. Common causes
    are:

      - Your libphutil/ is out of date.
        This is the most common cause.
        Update this copy of libphutil: F:\bin\libphutil

      - Some other library is out of date.
        Update the library this symbol appears in.

      - This symbol is misspelled.
        Spell the symbol name correctly.
        Symbol name spelling is case-sensitive.

      - This symbol was added recently.
        Run `arc liberate` on the library it was added to.

      - This symbol is external. Use `@phutil-external-symbol`.
        Use `grep` to find usage examples of this directive.

    *** ALTHOUGH USUALLY EASY TO FIX, THIS IS A SERIOUS ERROR.
    *** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.

               2
               3 final class ArcanistCapabilityNotSupportedException extends Exception {
               4
    >>>        5   public function __construct(ArcanistRepositoryAPI $api) {
               6     $name = $api->getSourceControlSystemName();
               7     parent::__construct(
               8       "This repository API ('{$name}') does not support the requested ".

   Error  (PHL1) Unknown Symbol
    Use of unknown class/interface '
        '. Common causes are:

      - Your libphutil/ is out of date.
        This is the most common cause.
        Update this copy of libphutil: F:\bin\libphutil

      - Some other library is out of date.
        Update the library this symbol appears in.

      - This symbol is misspelled.
        Spell the symbol name correctly.
        Symbol name spelling is case-sensitive.

      - This symbol was added recently.
        Run `arc liberate` on the library it was added to.

      - This symbol is external. Use `@phutil-external-symbol`.
        Use `grep` to find usage examples of this directive.

    *** ALTHOUGH USUALLY EASY TO FIX, THIS IS A SERIOUS ERROR.
    *** THIS ERROR IS YOUR FAULT. YOU MUST RESOLVE IT.

               3 final class ArcanistCapabilityNotSupportedException extends Exception {
               4
               5   public function __construct(ArcanistRepositoryAPI $api) {
    >>>        6     $name = $api->getSourceControlSystemName();
               7     parent::__construct(
               8       "This repository API ('{$name}') does not support the requested ".
               9       "capability.");

It appears that it's trying to look for the symbols s Excepti, uct(ArcanistRepositor and a newline.

I've just run into similar problem with arc liberate - mapped class names where starting with a space and missing last letter.

I suspect that both issues are caused by xhpast.exe reading from cin, which is not open in binary mode. All '\r\n' are converted to '\n' resulting in some data to being off by one.
The solution that works for me with MinGW toolchain is to add _setmode(_fileno(stdin), _O_BINARY); in xhpast.cpp (needs io.h and fcntl.h includes).