Package: arcanist
Version: 0~git20200925-1
Severity: normal

Dear Maintainer,

arcanist installs a bash-completion script at
/usr/share/bash-completion/completions/arcanist.bash-completion
which will not be loaded by bash-completion, which only tries:
/usr/share/bash-completion/completions/arcanist
/usr/share/bash-completion/completions/_arcanist
/usr/share/bash-completion/completions/arcanist.bash

Even if it were loaded, I suspect it would not function correctly
because `arc shell-complete --generate` will be unable to create
$GENERATED_RULES_FILE (/usr/share/bash-completion/rules/bash-rules.sh)
when run as a non-root user.  Running it as a user causes:

 GENERATE  Generating shell completion rules...
[2021-03-11 14:25:46] EXCEPTION: (FilesystemException) Requested path 
'/usr/share/arcanist/support/shell/rules' is not writable. at 
[<arcanist>/src/filesystem/Filesystem.php:1251]
arcanist()
  #0 Filesystem::assertWritable called at 
[<arcanist>/src/filesystem/Filesystem.php:73]
  #1 Filesystem::assertWritableFile called at 
[<arcanist>/src/filesystem/Filesystem.php:89]
  #2 Filesystem::writeFile called at 
[<arcanist>/src/toolset/workflow/ArcanistShellCompleteWorkflow.php:436]
  #3 ArcanistShellCompleteWorkflow::runGenerate called at 
[<arcanist>/src/toolset/workflow/ArcanistShellCompleteWorkflow.php:148]
  #4 ArcanistShellCompleteWorkflow::runWorkflow called at 
[<arcanist>/src/workflow/ArcanistWorkflow.php:227]
  #5 ArcanistWorkflow::executeWorkflow called at 
[<arcanist>/src/toolset/ArcanistPhutilWorkflow.php:21]
  #6 ArcanistPhutilWorkflow::execute called at 
[<arcanist>/src/parser/argument/PhutilArgumentParser.php:492]
  #7 PhutilArgumentParser::parseWorkflowsFull called at 
[<arcanist>/src/runtime/ArcanistRuntime.php:171]
  #8 ArcanistRuntime::executeCore called at 
[<arcanist>/src/runtime/ArcanistRuntime.php:37]
  #9 ArcanistRuntime::execute called at 
[<arcanist>/support/init/init-arcanist.php:6]
  #10 require_once(string) called at [<arcanist>/bin/arc:10]

If at all possible, I'd suggest running `arc shell-complete --generate`
during build and shipping
/usr/share/arcanist/support/shell/rules/bash-rules.sh in the package
with a symlink from /usr/share/bash-completion/completions/arcanist.

Thanks,
Kevin

Reply via email to