Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Fix MozillaSecurity#9 - compileShell fails on Fedora due to autoconf …
Browse files Browse the repository at this point in the history
…2.13 binary name discrepancy
  • Loading branch information
nth10sd committed Apr 27, 2018
1 parent 5881b7d commit 90e985b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/funfuzz/js/compile_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import os
import platform
import shutil
import subprocess
import sys
import tarfile
import traceback
Expand All @@ -34,6 +33,11 @@
from ..util import subprocesses as sps
from ..util.lock_dir import LockDir

if sys.version_info.major == 2 and os.name == "posix":
import subprocess32 as subprocess # pylint: disable=import-error
else:
import subprocess

S3_SHELL_CACHE_DIRNAME = "shell-cache" # Used by autobisectjs

if platform.system() == "Windows":
Expand Down Expand Up @@ -260,14 +264,12 @@ def autoconfRun(cwDir): # pylint: disable=invalid-name,missing-param-doc,missin
autoconf213_mac_bin = "autoconf213"
subprocess.check_call([autoconf213_mac_bin], cwd=cwDir)
elif platform.system() == "Linux":
# FIXME: We should use a method that is similar to the client.mk one, as per # pylint: disable=fixme
# https://github.com/MozillaSecurity/funfuzz/issues/9
try:
# Ubuntu
subprocess.check_call(["autoconf2.13"], cwd=cwDir)
except OSError:
# Fedora has a different name
subprocess.check_call(["autoconf-2.13"], cwd=cwDir)
if which("autoconf2.13"):
subprocess.run(["autoconf2.13"], check=True, cwd=cwDir)
elif which("autoconf-2.13"):
subprocess.run(["autoconf-2.13"], check=True, cwd=cwDir)
elif which("autoconf213"):
subprocess.run(["autoconf213"], check=True, cwd=cwDir)
elif platform.system() == "Windows":
# Windows needs to call sh to be able to find autoconf.
subprocess.check_call(["sh", "autoconf-2.13"], cwd=cwDir)
Expand Down

0 comments on commit 90e985b

Please sign in to comment.