Page MenuHomePhabricator

Windows 7: arc diff --nolint --nounit not working
Closed, ResolvedPublic

Assigned To
Authored By
sngreg
Oct 19 2014, 6:47 PM
Referenced Files
F221146: php_version.JPG
Oct 19 2014, 11:06 PM
F221148: editor.JPG
Oct 19 2014, 11:06 PM
F221135: commit.png
Oct 19 2014, 10:46 PM
F221072: bug.png
Oct 19 2014, 6:47 PM

Description

I am on windows 7 and installed arcanist. I have successfully done an arc patch but when I try to do an arc diff I am not having any luck. Once I close the editor (I have tried notepad++, sublime, and gitbash following https://secure.phabricator.com/book/phabricator/article/arcanist_windows/), I get an error.

It sits on the word Provide until I press enter and then it aborts. (See attached)

If you have any ideas please let me know.

bug.png (83×447 px, 2 KB)

Event Timeline

sngreg raised the priority of this task from to Needs Triage.
sngreg updated the task description. (Show Details)
sngreg added a subscriber: sngreg.

What are you putting in the commit message?

@chad

Here is a commit one of the commit messages I have tried. I have also tried filling in summary and subscribers with the same luck of it not working.

commit.png (536×657 px, 67 KB)

It should say "Provide explanation for skipping lint or press Enter to abort: "

I'll see if I can build a repro, but we haven't had other reports. Can you provide more details on your setup? PHP version? CLI? Editor? etc...

Also, does arc diff work when you don't skip lint and unit?

I haven't been able to get arc diff to work because I don't have karma configured so I was just trying get it working with nolint and nounit.

PHP -

php_version.JPG (51×519 px, 15 KB)

CLI - Windows cmd prompt

Editor - I tried sublime, notepad++, and gitbash / Vim.

editor.JPG (50×633 px, 14 KB)

Is there anything I can type when it says Provide to move it forward? I can type but when I press enter it aborts.

It should just take any excuse you type after the prompt. Does it seem like it's crashing PHP? anything in the error logs?

I've run into this as well occasionally at my work. We never isolated the conditions (seems to be some combination of windows and gitbash, but it works for some people)

There is a work around if you pass --excuse "Some lame excuse for not doing tests and lint" then it doesn't ask you to "Provide" and blow up.

We have a piece of code which does a bunch of bash wizardry to try to fake history on these prompts. I think we should just remove the history feature; it doesn't seem valuable enough to justify figuring out what's going on here and working around it.

A less severe approach would be to disable the feature unconditionally on Windows.

Specifically, the code is here:

https://secure.phabricator.com/diffusion/PHU/browse/master/src/console/format.php;160eeba602bf5329ec7fee0fc0834e924557d9b3$53-73

Either:

  1. Remove all the "history" code, remove the $history parameter, and find all callsites that pass it and delete the parameter (thus removing the feature completely); or
  2. make sure $use_history is always false if phutil_is_windows(), and remove the Windows-specific escaping code; or
  3. figure out how to fix that bash -c ... mess to work reliably on the various Windows shells.

I suggest (1), would accept (2) if anyone feels like the history feature is fairly useful, and don't think (3) is worth the effort.

Specifically, the history feature allows you to press the up/down arrow keys to select previous answers you've given to the prompt.

The history support is useful. I might be able to find out what's happening.

Relevant: https://bugs.php.net/bug.php?id=68140

Basically, double quotes disappear when passed through escapeshellarg. The command for history basically becomes:

bash -c "history -r  C:/Users/Richard/arc/libphutil/.git/arc/lint-excuses  2>/dev/null; read -e -p      Provide explanation for skipping lint or press Enter to abort:  ; echo  $REPLY ; history -s  $REPLY  2>/dev/null; history -w  C:/Users/Richard/arc/libphutil/.git/arc/lint-excuses  2>/dev/null"

I think that clarifies the output you're getting. I'll send a diff in a few minutes removing history support for Windows.