aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/servo/bootstrap.py49
-rw-r--r--python/servo/post_build_commands.py20
-rw-r--r--python/servo/testing_commands.py12
-rw-r--r--python/tidy/servo_tidy/tidy.py2
4 files changed, 60 insertions, 23 deletions
diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py
index 486147451fa..4f9744a7c17 100644
--- a/python/servo/bootstrap.py
+++ b/python/servo/bootstrap.py
@@ -341,6 +341,37 @@ LINUX_SPECIFIC_BOOTSTRAPPERS = {
}
+def get_linux_distribution():
+ distro, version, _ = platform.linux_distribution()
+
+ if distro == 'LinuxMint':
+ if '.' in version:
+ major, _ = version.split('.', 1)
+ else:
+ major = version
+
+ if major == '19':
+ base_version = '18.04'
+ elif major == '18':
+ base_version = '16.04'
+ elif major == '17':
+ base_version = '14.04'
+ else:
+ raise Exception('unsupported version of %s: %s' % (distro, version))
+
+ distro, version = 'Ubuntu', base_version
+ elif distro.lower() not in [
+ 'centos',
+ 'centos linux',
+ 'debian',
+ 'fedora',
+ 'ubuntu',
+ ]:
+ raise Exception('mach bootstrap does not support %s, please file a bug' % distro)
+
+ return distro, version
+
+
def bootstrap(context, force=False, specific=None):
'''Dispatches to the right bootstrapping function for the OS.'''
@@ -348,19 +379,11 @@ def bootstrap(context, force=False, specific=None):
if "windows-msvc" in host_triple():
bootstrapper = windows_msvc
elif "linux-gnu" in host_triple():
- distro, version, _ = platform.linux_distribution()
- if distro.lower() in [
- 'centos',
- 'centos linux',
- 'debian',
- 'fedora',
- 'ubuntu',
- ]:
- context.distro = distro
- context.distro_version = version
- bootstrapper = LINUX_SPECIFIC_BOOTSTRAPPERS.get(specific, linux)
- else:
- raise Exception("mach bootstrap does not support %s, please file a bug" % distro)
+ distro, version = get_linux_distribution()
+
+ context.distro = distro
+ context.distro_version = version
+ bootstrapper = LINUX_SPECIFIC_BOOTSTRAPPERS.get(specific, linux)
if bootstrapper is None:
print('Bootstrap support is not yet available for your OS.')
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index dc2731c0318..4050f33f932 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -13,6 +13,7 @@ import json
import os
import os.path as path
import subprocess
+import sys
from shutil import copytree, rmtree, copy2
from mach.decorators import (
@@ -263,10 +264,23 @@ class PostBuildCommands(CommandBase):
else:
copy2(full_name, destination)
- return self.call_rustup_run(
+ returncode = self.call_rustup_run(
["cargo", "doc", "--manifest-path", self.ports_servo_manifest()] + params,
- env=self.build_env()
- )
+ env=self.build_env())
+ if returncode:
+ return returncode
+
+ static = path.join(self.context.topdir, "etc", "doc.servo.org")
+ for name in os.listdir(static):
+ copy2(path.join(static, name), path.join(docs, name))
+
+ build = path.join(self.context.topdir, "components", "style", "properties", "build.py")
+ subprocess.check_call([sys.executable, build, "servo", "html"])
+
+ script = path.join(self.context.topdir, "components", "script")
+ subprocess.check_call(["cmake", "."], cwd=script)
+ subprocess.check_call(["cmake", "--build", ".", "--target", "supported-apis"], cwd=script)
+ copy2(path.join(script, "apis.html"), path.join(docs, "servo", "apis.html"))
@Command('browse-doc',
description='Generate documentation and open it in a web browser',
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index 90bded199a6..7924cd5e7dd 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -543,7 +543,7 @@ class MachCommands(CommandBase):
reported = set()
proc = subprocess.Popen(
- ["git", "log", "--merges", "--oneline", "-1"],
+ ["git", "log", "--oneline", "-1"],
stdout=subprocess.PIPE)
(last_merge, _) = proc.communicate()
@@ -571,19 +571,19 @@ class MachCommands(CommandBase):
if log_intermittents:
with open(log_intermittents, "w") as intermittents_file:
for intermittent in intermittents:
- json.dump(intermittent, intermittents_file)
+ json.dump(intermittent, intermittents_file, indent=4)
print("\n", end='', file=intermittents_file)
- if len(actual_failures) == 0:
- return 0
-
output = open(log_filteredsummary, "w") if log_filteredsummary else sys.stdout
for failure in actual_failures:
- json.dump(failure, output)
+ json.dump(failure, output, indent=4)
print("\n", end='', file=output)
if output is not sys.stdout:
output.close()
+
+ if len(actual_failures) == 0:
+ return 0
return 1
@Command('test-android-startup',
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py
index 446db50feea..deb86e289c2 100644
--- a/python/tidy/servo_tidy/tidy.py
+++ b/python/tidy/servo_tidy/tidy.py
@@ -489,7 +489,7 @@ def check_manifest_dirs(config_file, print_text=True):
p = parser.parse(lines)
paths = rec_parse(wpt_path("web-platform-tests"), p)
for idx, path in enumerate(paths):
- if path.endswith("_mozilla") or path.endswith("_webgl"):
+ if '_mozilla' in path or '_webgl' in path:
continue
if not os.path.isdir(path):
yield(config_file, idx + 1, "Path in manifest was not found: {}".format(path))