Bug 1516568 - Update WR mac CI scripts to allow cross-compiling. r=kvark

This introduces some env vars to allow running cross-compiled
binaries instead of running things on the builder. Additionally
the `cargo test --features "ipc"` check is modified to be `check`
instead since there are no actual tests being run by that command.
The only thing we lose is a rustdoc example check but we are
checking that on Linux anyway so doing it for Mac is redundant.

Differential Revision: https://phabricator.services.mozilla.com/D19367

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2019-02-15 01:32:06 +00:00
Родитель aab00418a2
Коммит a79bc23095
3 изменённых файлов: 26 добавлений и 9 удалений

Просмотреть файл

@ -8,15 +8,22 @@
# Users may set the CARGOFLAGS environment variable to pass
# additional flags to cargo if desired.
# Note that this script is run in a special cross-compiling configuration,
# where CARGOTESTFLAGS includes `--no-run`, and the binaries produced by
# `cargo test` are run on a different machine. When making changes to this
# file, please ensure any such binaries produced by `cargo test` are not
# deleted, or they may not get run as expected.
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
CARGOFLAGS=${CARGOFLAGS:-"--verbose"} # default to --verbose if not set
CARGOTESTFLAGS=${CARGOTESTFLAGS:-""}
pushd webrender_api
cargo test ${CARGOFLAGS} --features "ipc"
cargo check ${CARGOFLAGS} --features "ipc"
popd
pushd webrender
@ -35,4 +42,4 @@ pushd examples
cargo check ${CARGOFLAGS}
popd
cargo test ${CARGOFLAGS} --all
cargo test ${CARGOFLAGS} ${CARGOTESTFLAGS} --all

Просмотреть файл

@ -7,6 +7,8 @@
# This must be run from the root webrender directory!
# Users may set the CARGOFLAGS environment variable to pass
# additional flags to cargo if desired.
# The WRENCH_BINARY environment variable, if set, is used to run
# the precached reftest.
set -o errexit
set -o nounset
@ -14,10 +16,14 @@ set -o pipefail
set -o xtrace
CARGOFLAGS=${CARGOFLAGS:-""} # default to empty if not set
WRENCH_BINARY=${WRENCH_BINARY:-""}
pushd wrench
python script/headless.py reftest
cargo build ${CARGOFLAGS} --release
cargo run ${CARGOFLAGS} --release -- --precache \
if [[ -z "${WRENCH_BINARY}" ]]; then
cargo build ${CARGOFLAGS} --release
WRENCH_BINARY="../target/release/wrench"
fi
"${WRENCH_BINARY}" --precache \
reftest reftests/clip/fixed-position-clipping.yaml
popd

Просмотреть файл

@ -65,13 +65,17 @@ def set_osmesa_env(bin_path):
os.environ["GALLIUM_DRIVER"] = "softpipe"
extra_flags = os.getenv('CARGOFLAGS', None)
extra_flags = extra_flags.split(' ') if extra_flags else []
subprocess.check_call(['cargo', 'build'] + extra_flags + ['--release', '--verbose', '--features', 'headless'])
set_osmesa_env('../target/release/')
target_folder = os.getenv('WRENCH_HEADLESS_TARGET', None)
if not target_folder:
extra_flags = os.getenv('CARGOFLAGS', None)
extra_flags = extra_flags.split(' ') if extra_flags else []
subprocess.check_call(['cargo', 'build'] + extra_flags + ['--release', '--verbose', '--features', 'headless'])
target_folder = '../target/'
set_osmesa_env(target_folder + 'release/')
# TODO(gw): We have an occasional accuracy issue or bug (could be WR or OSMesa)
# where the output of a previous test that uses intermediate targets can
# cause 1.0 / 255.0 pixel differences in a subsequent test. For now, we
# run tests with no-scissor mode, which ensures a complete target clear
# between test runs. But we should investigate this further...
subprocess.check_call(['../target/release/wrench', '--no-scissor', '-h'] + sys.argv[1:])
subprocess.check_call([target_folder + 'release/wrench', '--no-scissor', '-h'] + sys.argv[1:])