Print the full path for errors occurring in the servo crate

This commit is contained in:
tigercosmos 2017-10-25 23:31:21 +08:00
parent c494d25e24
commit a0ae81610d
7 changed files with 29 additions and 19 deletions

View file

@ -1,13 +1,13 @@
[target.arm-linux-androideabi] [target.arm-linux-androideabi]
linker = "./fake-ld-arm.sh" linker = "./ports/servo/fake-ld-arm.sh"
ar = "arm-linux-androideabi-ar" ar = "arm-linux-androideabi-ar"
[target.armv7-linux-androideabi] [target.armv7-linux-androideabi]
linker = "./fake-ld-armv7.sh" linker = "./ports/servo/fake-ld-armv7.sh"
ar = "arm-linux-androideabi-ar" ar = "arm-linux-androideabi-ar"
[target.aarch64-linux-android] [target.aarch64-linux-android]
linker = "./fake-ld-arm64.sh" linker = "./ports/servo/fake-ld-arm64.sh"
ar = "aarch64-linux-android-ar" ar = "aarch64-linux-android-ar"
[target.arm-unknown-linux-gnueabihf] [target.arm-unknown-linux-gnueabihf]
@ -19,4 +19,4 @@ linker = "aarch64-linux-gnu-gcc"
ar = "aarch64-linux-gnu-ar" ar = "aarch64-linux-gnu-ar"
[target.'cfg(target_os=windows)'] [target.'cfg(target_os=windows)']
linker = "./fake-ld.cmd" linker = "./ports/servo/fake-ld.cmd"

3
.gitignore vendored
View file

@ -1,5 +1,6 @@
/.servo /.servo
/.cargo /.cargo/*
!/.cargo/config.*
/.servobuild /.servobuild
/target /target
/ports/android/bin /ports/android/bin

View file

@ -8,7 +8,7 @@ set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
source fake-ld.sh source ./ports/servo/fake-ld.sh
export _GCC_PARAMS="${@}" export _GCC_PARAMS="${@}"
call_gcc "arch-arm" "arm-linux-androideabi" "android-18" "armeabi" call_gcc "arch-arm" "arm-linux-androideabi" "android-18" "armeabi"

View file

@ -8,7 +8,7 @@ set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
source fake-ld.sh source ./ports/servo/fake-ld.sh
export _GCC_PARAMS="${@}" export _GCC_PARAMS="${@}"
call_gcc "arch-arm64" "aarch64-linux-android" "android-21" "arm64-v8a" call_gcc "arch-arm64" "aarch64-linux-android" "android-21" "arm64-v8a"

View file

@ -8,7 +8,7 @@ set -o errexit
set -o nounset set -o nounset
set -o pipefail set -o pipefail
source fake-ld.sh source ./ports/servo/fake-ld.sh
export _GCC_PARAMS="${@}" export _GCC_PARAMS="${@}"
call_gcc "arch-arm" "arm-linux-androideabi" "android-18" "armeabi-v7a" call_gcc "arch-arm" "arm-linux-androideabi" "android-18" "armeabi-v7a"

View file

@ -176,12 +176,14 @@ class MachCommands(CommandBase):
def build(self, target=None, release=False, dev=False, jobs=None, def build(self, target=None, release=False, dev=False, jobs=None,
features=None, android=None, verbose=False, debug_mozjs=False, params=None, features=None, android=None, verbose=False, debug_mozjs=False, params=None,
with_debug_assertions=False): with_debug_assertions=False):
opts = params or []
opts += ["--manifest-path", self.servo_manifest()]
if android is None: if android is None:
android = self.config["build"]["android"] android = self.config["build"]["android"]
features = features or self.servo_features() features = features or self.servo_features()
opts = params or []
base_path = self.get_target_dir() base_path = self.get_target_dir()
release_path = path.join(base_path, "release", "servo") release_path = path.join(base_path, "release", "servo")
dev_path = path.join(base_path, "debug", "servo") dev_path = path.join(base_path, "debug", "servo")
@ -318,8 +320,7 @@ class MachCommands(CommandBase):
cargo_binary = "cargo" + BIN_SUFFIX cargo_binary = "cargo" + BIN_SUFFIX
status = call( status = call(
[cargo_binary, "build"] + opts, [cargo_binary, "build"] + opts, env=env, verbose=verbose)
env=env, cwd=self.servo_crate(), verbose=verbose)
elapsed = time() - build_start elapsed = time() - build_start
# Do some additional things if the build succeeded # Do some additional things if the build succeeded
@ -384,6 +385,8 @@ class MachCommands(CommandBase):
ret = None ret = None
opts = [] opts = []
opts += ["--manifest-path", self.cef_manifest()]
if jobs is not None: if jobs is not None:
opts += ["-j", jobs] opts += ["-j", jobs]
if verbose: if verbose:
@ -407,10 +410,7 @@ class MachCommands(CommandBase):
# common dependencies with the same flags. # common dependencies with the same flags.
opts += ["--", "-C", "link-args=-Xlinker -undefined -Xlinker dynamic_lookup"] opts += ["--", "-C", "link-args=-Xlinker -undefined -Xlinker dynamic_lookup"]
with cd(path.join("ports", "cef")): ret = call(["cargo", "rustc"] + opts, env=env, verbose=verbose)
ret = call(["cargo", "rustc"] + opts,
env=env,
verbose=verbose)
elapsed = time() - build_start elapsed = time() - build_start
# Generate Desktop Notification if elapsed-time > some threshold value # Generate Desktop Notification if elapsed-time > some threshold value
@ -441,20 +441,20 @@ class MachCommands(CommandBase):
ret = None ret = None
opts = [] opts = []
opts += ["--manifest-path", self.geckolib_manifest()]
features = [] features = []
if jobs is not None: if jobs is not None:
opts += ["-j", jobs] opts += ["-j", jobs]
if verbose: if verbose:
opts += ["-v"] opts += ["-v"]
if release: if release:
opts += ["--release"] opts += ["--release"]
if features: if features:
opts += ["--features", ' '.join(features)] opts += ["--features", ' '.join(features)]
build_start = time() build_start = time()
with cd(path.join("ports", "geckolib")): ret = call(["cargo", "build"] + opts, env=env, verbose=verbose)
ret = call(["cargo", "build"] + opts, env=env, verbose=verbose)
elapsed = time() - build_start elapsed = time() - build_start
# Generate Desktop Notification if elapsed-time > some threshold value # Generate Desktop Notification if elapsed-time > some threshold value

View file

@ -545,6 +545,15 @@ class CommandBase(object):
def servo_crate(self): def servo_crate(self):
return path.join(self.context.topdir, "ports", "servo") return path.join(self.context.topdir, "ports", "servo")
def servo_manifest(self):
return path.join(self.context.topdir, "ports", "servo", "Cargo.toml")
def geckolib_manifest(self):
return path.join(self.context.topdir, "ports", "geckolib", "Cargo.toml")
def cef_manifest(self):
return path.join(self.context.topdir, "ports", "cef", "Cargo.toml")
def servo_features(self): def servo_features(self):
"""Return a list of optional features to enable for the Servo crate""" """Return a list of optional features to enable for the Servo crate"""
features = [] features = []