Merge pull request #166554 from bjornfor/fix-arc-anoid

arcanist: add missing deps
This commit is contained in:
Benjamin Staffin 2022-04-01 15:38:55 -04:00 committed by GitHub
commit da3204266c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 2 deletions

View file

@ -5,6 +5,8 @@
, php
, lib, stdenv
, installShellFiles
, which
, python3
}:
# Make a custom wrapper. If `wrapProgram` is used, arcanist thinks .arc-wrapped is being
@ -14,7 +16,7 @@
let makeArcWrapper = toolset: ''
cat << WRAPPER > $out/bin/${toolset}
#!$shell -e
export PATH='${php}/bin/'\''${PATH:+':'}\$PATH
export PATH='${php}/bin:${which}/bin'\''${PATH:+':'}\$PATH
exec ${php}/bin/php $out/libexec/arcanist/bin/${toolset} "\$@"
WRAPPER
chmod +x $out/bin/${toolset}
@ -32,7 +34,9 @@ stdenv.mkDerivation {
sha256 = "0jiv4aj4m5750dqw9r8hizjkwiyxk4cg4grkr63sllsa2dpiibxw";
};
buildInputs = [ php ];
patches = [ ./dont-require-python3-in-path.patch ];
buildInputs = [ php python3 ];
nativeBuildInputs = [ bison flex installShellFiles ];

View file

@ -0,0 +1,26 @@
Don't require python3 in PATH
Once packaged, the arcanoid.py script has an absolute path shebang to
python3, so there is no need to also require python3 in PATH.
This prevents leaking in a python3 in PATH in the environment which arc
runs linters etc.
Author: bjorn.forsman@gmail.com
diff -uNr arcanist.orig/src/workflow/ArcanistAnoidWorkflow.php arcanist.new/src/workflow/ArcanistAnoidWorkflow.php
--- arcanist.orig/src/workflow/ArcanistAnoidWorkflow.php 2022-03-31 13:23:30.865095192 +0200
+++ arcanist.new/src/workflow/ArcanistAnoidWorkflow.php 2022-04-01 12:19:15.644159639 +0200
@@ -24,13 +24,6 @@
}
public function runWorkflow() {
- if (!Filesystem::binaryExists('python3')) {
- throw new PhutilArgumentUsageException(
- pht(
- 'The "arc anoid" workflow requires "python3" to be available '.
- 'in your $PATH.'));
- }
-
$support_dir = phutil_get_library_root('arcanist');
$support_dir = dirname($support_dir);
$support_dir = $support_dir.'/support/';