Page MenuHomePhabricator

Arcanist failed patch lint on windows (because "cp" does not exist)
Closed, ResolvedPublic

Description

Contexte : A bug reports for windows this time, switched to a windows machine to fix some bugs with crlf line ending making docker crash.

I will clearly understand if you choose not to support the CMD.exe but only git bash.
If so, maybe change "Now you should be able to run arc normally (either from cmd.exe or Git Bash) and it should work more-or-less properly." in https://secure.phabricator.com/book/phabricator/article/arcanist_windows/#required-components

Os

Windows 10
CMD Shell

Arcanist and libphutil versions

~HEAD today, see traceback

Steps to reproduce

  • on windows create a new file
  • write some text, don't end with a new line to trigger lint
  • arc diff it, lint triger, and ask if you want to patch
  • say yes
  • bam

Taceback

>>> Lint for compose\django\entrypoint.sh:


   Error  (TXT4) File Does Not End in Newline
    Files must end in a newline.

               8 fi
               9 export DATABASE_URL=postgres://$POSTGRES_ENV_POSTGRES_USER:$POSTGRES_ENV_POSTGRES_PASSWORD@postgres:5432/$POSTGRES_ENV_POSTGRES_USER
              10 export CELERY_BROKER_URL=$REDIS_URL
    >>> -     11 exec "$@"
        +        exec "$@"
>>> [54] <exec> $ diff -u "C:\Users\x\Documents\projectx\compose\django\entrypoint.sh" "C:\Users\x\AppData\Local\Temp\66ki898yw6os0444\7504EE.tmp"
<<< [54] <exec> 15,960 us
'diff' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.


    Apply this patch to compose\django\entrypoint.sh? [Y/n] Y

>>> [55] <exec> $ cp -p "C:\Users\x\Documents\projectx\compose\django\entrypoint.sh" "C:\Users\x\Documents\projectx\compose\django\entrypoint.sh.linted"
<<< [55] <exec> 12,593 us

[2015-12-11 10:46:50] EXCEPTION: (CommandException) Command failed with error #1!
COMMAND
cp -p "C:\Users\x\Documents\projectx\compose\django\entrypoint.sh" "C:\Users\x\Documents\projectx\compose\django\entrypoint.sh.linted"

STDOUT
(empty)

STDERR
'cp' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
 at [<phutil>\src\future\exec\ExecFuture.php:416]
arcanist(head=master, ref.master=dfde57ff812b), djangounit(head=fix_windows_docker, ref.master=e19d2f676836, ref.fix_windows_docker=62932d70f397), phutil(head=master, ref.master=db3667a62f66)
  #0 ExecFuture::resolvex() called at [<phutil>\src\future\exec\execx.php:17]
  #1 execx(string, string, string) called at [<arcanist>\src\lint\ArcanistLintPatcher.php:45]
  #2 ArcanistLintPatcher::writePatchToDisk() called at [<arcanist>\src\workflow\ArcanistLintWorkflow.php:526]
  #3 ArcanistLintWorkflow::run() called at [<arcanist>\src\workflow\ArcanistDiffWorkflow.php:1256]
  #4 ArcanistDiffWorkflow::runLint() called at [<arcanist>\src\workflow\ArcanistDiffWorkflow.php:1217]
  #5 ArcanistDiffWorkflow::runLintUnit() called at [<arcanist>\src\workflow\ArcanistDiffWorkflow.php:474]
  #6 ArcanistDiffWorkflow::run() called at [<arcanist>\scripts\arcanist.php:382]

Event Timeline

tycho.tatitscheff changed the edit policy from "All Users" to "Custom Policy".
tycho.tatitscheff created this task.
tycho.tatitscheff raised the priority of this task from to Needs Triage.

Side question, so I can submit a patch, is it a libphutil way to :

if (workflow_os == "Windows") {
  exec(window_feature);
} else {
  exec(unix_feature);
};

Also, arc sometimes has issues with non-English locals - see T5554.

epriestley closed this task as Resolved.
epriestley claimed this task.

This was almost certainly resolved by D16273.

epriestley renamed this task from Arcanist failed patch lint on windows to Arcanist failed patch lint on windows (because "cp" does not exist).Oct 2 2018, 12:59 PM