diff --git a/build-task.sh b/build-task.sh deleted file mode 100755 index 1159686da6f..00000000000 --- a/build-task.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -set -e -set -x - -cd something-rust -cargo build --release -gzip -c target/release/something-rust > executable.gz diff --git a/servo-x86_64-linux.dockerfile b/build-x86_64-linux.dockerfile similarity index 100% rename from servo-x86_64-linux.dockerfile rename to build-x86_64-linux.dockerfile diff --git a/decision-task.py b/decision-task.py index d911b0b6058..e498dd1f348 100644 --- a/decision-task.py +++ b/decision-task.py @@ -1,5 +1,10 @@ # coding: utf8 +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + import os.path from decisionlib import DecisionTask @@ -15,44 +20,62 @@ CARGO_CACHE = { "cargo-git-cache": "/root/.cargo/git", } +BUILD_ENV = { + "RUST_BACKTRACE": "1", + "RUSTFLAGS": "-Dwarnings", + "CARGO_INCREMENTAL": "0", + "SCCACHE_IDLE_TIMEOUT": "1200", +} + def main(): decision = DecisionTask( - project_name="Taskcluster experiments for Servo", # Used in task names - route_prefix="project.servo.servo-taskcluster-experiments", - docker_image_cache_expiry="1 week", + project_name="Servo", # Used in task names + route_prefix="project.servo.servo", worker_type="servo-docker-worker", ) + # FIXME: remove this before merging in servo/servo + os.environ["GIT_URL"] = "https://github.com/SimonSapin/servo" + os.environ["GIT_REF"] = "refs/heads/master" + os.environ["GIT_SHA"] = "605d74c59b6de7ae2b535d42fde40405a96b67e0" + decision.docker_image_cache_expiry = "1 week" + decision.route_prefix = "project.servo.servo-taskcluster-experiments" + # ~ + decision.create_task_with_in_tree_dockerfile( - task_name="servo build task", - command="./servo-build-task.sh", - dockerfile=dockerfile("servo-x86_64-linux"), + task_name="building for Linux x86_64 in dev mode + unit tests", + command=""" + ./mach build --dev + ./mach test-unit + """, + env=BUILD_ENV, + dockerfile=dockerfile("build-x86_64-linux"), max_run_time_minutes=3 * 60, scopes=CARGO_CACHE_SCOPES, cache=CARGO_CACHE, ) - build_task = decision.create_task_with_in_tree_dockerfile( - task_name="build task", - command="./build-task.sh", - dockerfile=dockerfile("servo-x86_64-linux"), - max_run_time_minutes=20, + decision.create_task_with_in_tree_dockerfile( + task_name="building for Linux x86_64 in release mode", + command=""" + ./mach build --release + """, + env=BUILD_ENV, + dockerfile=dockerfile("build-x86_64-linux"), + max_run_time_minutes=3 * 60, scopes=CARGO_CACHE_SCOPES, cache=CARGO_CACHE, - - artifacts=[ - ("/repo/something-rust/executable.gz", "1 week"), - ], ) - decision.create_task( - task_name="run task", - command="./run-task.sh", - image="buildpack-deps:bionic-scm", + decision.create_task_with_in_tree_dockerfile( + task_name="tidy", + command=""" + ./mach test-tidy --no-progress --all + ./mach test-tidy --no-progress --self-test + """, + dockerfile=dockerfile("build-x86_64-linux"), max_run_time_minutes=20, - dependencies=[build_task], - env={"BUILD_TASK_ID": build_task}, ) diff --git a/decisionlib.py b/decisionlib.py index a746a552713..82ce6783232 100644 --- a/decisionlib.py +++ b/decisionlib.py @@ -1,5 +1,14 @@ # coding: utf8 +# Copyright 2018 The Servo Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution. +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + """ Project-independent library for Taskcluster decision tasks """ @@ -180,4 +189,4 @@ class DecisionTask: def deindent(string): - return re.sub("\n +", "\n ", string) + return re.sub("\n +", " \n ", string) diff --git a/run-task.sh b/run-task.sh deleted file mode 100755 index ee4e7a999c4..00000000000 --- a/run-task.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e -set -x - -./curl-artifact.sh $BUILD_TASK_ID public/executable.gz -o executable.gz -gunzip executable.gz -chmod +x executable -./executable diff --git a/servo-build-task.sh b/servo-build-task.sh deleted file mode 100755 index 747cd7f43be..00000000000 --- a/servo-build-task.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e -set -x - -git clone https://github.com/servo/servo/ -cd servo -git checkout --depth 1 0a2c61da91e77102ae774075ec4126937a79f038 -./mach build -d diff --git a/something-rust/Cargo.lock b/something-rust/Cargo.lock deleted file mode 100644 index 2dceb4c3e2e..00000000000 --- a/something-rust/Cargo.lock +++ /dev/null @@ -1,14 +0,0 @@ -[[package]] -name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "something-rust" -version = "0.1.0" -dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[metadata] -"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" diff --git a/something-rust/Cargo.toml b/something-rust/Cargo.toml deleted file mode 100644 index 5d54f7af454..00000000000 --- a/something-rust/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "something-rust" -version = "0.1.0" -authors = ["Simon Sapin"] - -[dependencies] -matches = "0.1" diff --git a/something-rust/rust-toolchain b/something-rust/rust-toolchain deleted file mode 100644 index cfc730712d5..00000000000 --- a/something-rust/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -1.28.0 diff --git a/something-rust/src/main.rs b/something-rust/src/main.rs deleted file mode 100644 index e7a11a969c0..00000000000 --- a/something-rust/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world!"); -}