mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Allow bootstrap to be run before anything else is installed
This commit is contained in:
parent
6b75aa47cb
commit
e72e08ea9c
5 changed files with 40 additions and 9 deletions
|
@ -78,7 +78,7 @@ If you've already partially compiled servo but forgot to do this step, run `./ma
|
||||||
|
|
||||||
#### On Debian-based Linuxes
|
#### On Debian-based Linuxes
|
||||||
|
|
||||||
Please run `sudo apt install python-virtualenv build-essential libssl-dev libffi-dev python-dev` followed by `./mach bootstrap`.
|
Please run `./mach bootstrap`.
|
||||||
|
|
||||||
If this doesn't work, file a bug, and, run the commands below:
|
If this doesn't work, file a bug, and, run the commands below:
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ If `virtualenv` does not exist, try `python-virtualenv`.
|
||||||
|
|
||||||
#### On Fedora
|
#### On Fedora
|
||||||
|
|
||||||
Please run `sudo dnf install python2-virtualenv gcc libffi-devel python-devel openssl-devel` followed by `./mach bootstrap`.
|
Please run `./mach bootstrap`.
|
||||||
|
|
||||||
If this doesn't work, file a bug, and, run the commands below:
|
If this doesn't work, file a bug, and, run the commands below:
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ sudo dnf install curl libtool gcc-c++ libXi-devel \
|
||||||
#### On CentOS
|
#### On CentOS
|
||||||
|
|
||||||
|
|
||||||
Please run `sudo yum install python2-virtualenv gcc libffi-devel python-devel openssl-devel` followed by `./mach bootstrap`.
|
Please run `./mach bootstrap`.
|
||||||
|
|
||||||
If this doesn't work, file a bug, and, run the commands below:
|
If this doesn't work, file a bug, and, run the commands below:
|
||||||
|
|
||||||
|
|
7
mach
7
mach
|
@ -20,8 +20,11 @@ def main(args):
|
||||||
topdir = os.path.abspath(os.path.dirname(sys.argv[0]))
|
topdir = os.path.abspath(os.path.dirname(sys.argv[0]))
|
||||||
sys.path.insert(0, os.path.join(topdir, "python"))
|
sys.path.insert(0, os.path.join(topdir, "python"))
|
||||||
import mach_bootstrap
|
import mach_bootstrap
|
||||||
mach = mach_bootstrap.bootstrap(topdir)
|
if len(sys.argv) > 1 and sys.argv[1] == "bootstrap":
|
||||||
sys.exit(mach.run(sys.argv[1:]))
|
sys.exit(mach_bootstrap.bootstrap_command_only(topdir))
|
||||||
|
else:
|
||||||
|
mach = mach_bootstrap.bootstrap(topdir)
|
||||||
|
sys.exit(mach.run(sys.argv[1:]))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -224,11 +224,29 @@ def _is_windows():
|
||||||
return sys.platform == 'win32'
|
return sys.platform == 'win32'
|
||||||
|
|
||||||
|
|
||||||
|
class DummyContext(object):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def bootstrap_command_only(topdir):
|
||||||
|
from servo.bootstrap import bootstrap
|
||||||
|
|
||||||
|
context = DummyContext()
|
||||||
|
context.topdir = topdir
|
||||||
|
force = False
|
||||||
|
if len(sys.argv) == 3 and sys.argv[2] == "-f":
|
||||||
|
force = True
|
||||||
|
bootstrap(context, force)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def bootstrap(topdir):
|
def bootstrap(topdir):
|
||||||
_ensure_case_insensitive_if_windows()
|
_ensure_case_insensitive_if_windows()
|
||||||
|
|
||||||
topdir = os.path.abspath(topdir)
|
topdir = os.path.abspath(topdir)
|
||||||
|
|
||||||
|
len(sys.argv) > 1 and sys.argv[1] == "bootstrap"
|
||||||
|
|
||||||
# We don't support paths with Unicode characters for now
|
# We don't support paths with Unicode characters for now
|
||||||
# https://github.com/servo/servo/issues/10002
|
# https://github.com/servo/servo/issues/10002
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -49,11 +49,16 @@ def install_linux_deps(context, pkgs_ubuntu, pkgs_fedora, force):
|
||||||
command.append('-y')
|
command.append('-y')
|
||||||
print("Installing missing dependencies...")
|
print("Installing missing dependencies...")
|
||||||
run_as_root(command + pkgs)
|
run_as_root(command + pkgs)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def install_salt_dependencies(context, force):
|
def install_salt_dependencies(context, force):
|
||||||
pkgs_apt = ['build-essential', 'libssl-dev', 'libffi-dev', 'python-dev']
|
pkgs_apt = ['build-essential', 'libssl-dev', 'libffi-dev', 'python-dev']
|
||||||
pkgs_dnf = ['gcc', 'libffi-devel', 'python-devel', 'openssl-devel']
|
pkgs_dnf = ['gcc', 'libffi-devel', 'python-devel', 'openssl-devel']
|
||||||
install_linux_deps(context, pkgs_apt, pkgs_dnf, force)
|
if not install_linux_deps(context, pkgs_apt, pkgs_dnf, force):
|
||||||
|
print("Dependencies are already installed")
|
||||||
|
|
||||||
|
|
||||||
def gstreamer(context, force=False):
|
def gstreamer(context, force=False):
|
||||||
cur = os.curdir
|
cur = os.curdir
|
||||||
|
@ -62,6 +67,9 @@ def gstreamer(context, force=False):
|
||||||
os.chdir(gstdir)
|
os.chdir(gstdir)
|
||||||
subprocess.call(["bash", "gstreamer.sh"])
|
subprocess.call(["bash", "gstreamer.sh"])
|
||||||
os.chdir(cur)
|
os.chdir(cur)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def linux(context, force=False):
|
def linux(context, force=False):
|
||||||
# Please keep these in sync with the packages in README.md
|
# Please keep these in sync with the packages in README.md
|
||||||
|
@ -98,11 +106,13 @@ def linux(context, force=False):
|
||||||
else:
|
else:
|
||||||
pkgs_apt += ["libssl1.0-dev"]
|
pkgs_apt += ["libssl1.0-dev"]
|
||||||
|
|
||||||
install_linux_deps(context, pkgs_apt, pkgs_dnf, force)
|
installed_something = install_linux_deps(context, pkgs_apt, pkgs_dnf, force)
|
||||||
|
|
||||||
if not check_gstreamer_lib():
|
if not check_gstreamer_lib():
|
||||||
gstreamer(context, force)
|
installed_something |= gstreamer(context, force)
|
||||||
|
|
||||||
|
if not installed_something:
|
||||||
|
print("Dependencies were already installed!")
|
||||||
|
|
||||||
|
|
||||||
def salt(context, force=False):
|
def salt(context, force=False):
|
||||||
|
|
|
@ -20,7 +20,6 @@ import StringIO
|
||||||
import sys
|
import sys
|
||||||
import zipfile
|
import zipfile
|
||||||
import urllib2
|
import urllib2
|
||||||
import certifi
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -30,6 +29,7 @@ except ImportError:
|
||||||
|
|
||||||
# The cafile parameter was added in 2.7.9
|
# The cafile parameter was added in 2.7.9
|
||||||
if HAS_SNI and sys.version_info >= (2, 7, 9):
|
if HAS_SNI and sys.version_info >= (2, 7, 9):
|
||||||
|
import certifi
|
||||||
STATIC_RUST_LANG_ORG_DIST = "https://static.rust-lang.org/dist"
|
STATIC_RUST_LANG_ORG_DIST = "https://static.rust-lang.org/dist"
|
||||||
URLOPEN_KWARGS = {"cafile": certifi.where()}
|
URLOPEN_KWARGS = {"cafile": certifi.where()}
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue