From 3dd00bac7c60452055b657903da9c736149140ad Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 15 Jul 2019 09:18:32 -0700 Subject: [PATCH] ci: Remove Travis/AppVeyor configuration Now that we've fully moved to Azure Pipelines and bors has been updated to only gate on Azure this commit removes the remaining Travis/AppVeyor support contained in this repository. Most of the deletions here are related to producing better output on Travis by folding certain sections. This isn't supported by Azure so there's no need to keep it around, and if Azure ever adds support we can always add it back! --- .travis.yml | 10 ---- appveyor.yml | 9 --- src/bootstrap/check.rs | 5 -- src/bootstrap/compile.rs | 4 -- src/bootstrap/lib.rs | 15 +---- src/bootstrap/native.rs | 3 - src/bootstrap/test.rs | 15 ----- src/bootstrap/tool.rs | 2 - src/bootstrap/util.rs | 76 +------------------------- src/ci/docker/README.md | 2 +- src/ci/docker/run.sh | 9 --- src/ci/docker/x86_64-gnu-tools/repo.sh | 26 +-------- src/ci/init_repo.sh | 5 -- src/ci/run.sh | 18 ------ src/ci/shared.sh | 46 +--------------- 15 files changed, 11 insertions(+), 234 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1d35ea0efacc2..0000000000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: shell -script: echo Travis CI is not used anymore - -branches: - only: - - auto - - try - -notifications: - email: false diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 003de85184c32..0000000000000 --- a/appveyor.yml +++ /dev/null @@ -1,9 +0,0 @@ -clone_depth: 1 -build: false - -test_script: - - echo AppVeyor is not used anymore - -branches: - only: - - auto diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index bdf5306d4b549..11b082ac3f6d8 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -50,7 +50,6 @@ impl Step for Std { let mut cargo = builder.cargo(compiler, Mode::Std, target, cargo_subcommand(builder.kind)); std_cargo(builder, &compiler, target, &mut cargo); - let _folder = builder.fold_output(|| format!("stage{}-std", compiler.stage)); builder.info(&format!("Checking std artifacts ({} -> {})", &compiler.host, target)); run_cargo(builder, &mut cargo, @@ -99,7 +98,6 @@ impl Step for Rustc { cargo_subcommand(builder.kind)); rustc_cargo(builder, &mut cargo); - let _folder = builder.fold_output(|| format!("stage{}-rustc", compiler.stage)); builder.info(&format!("Checking compiler artifacts ({} -> {})", &compiler.host, target)); run_cargo(builder, &mut cargo, @@ -153,7 +151,6 @@ impl Step for CodegenBackend { // We won't build LLVM if it's not available, as it shouldn't affect `check`. - let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage)); run_cargo(builder, &mut cargo, args(builder.kind), @@ -190,7 +187,6 @@ impl Step for Test { let mut cargo = builder.cargo(compiler, Mode::Test, target, cargo_subcommand(builder.kind)); test_cargo(builder, &compiler, target, &mut cargo); - let _folder = builder.fold_output(|| format!("stage{}-test", compiler.stage)); builder.info(&format!("Checking test artifacts ({} -> {})", &compiler.host, target)); run_cargo(builder, &mut cargo, @@ -239,7 +235,6 @@ impl Step for Rustdoc { SourceType::InTree, &[]); - let _folder = builder.fold_output(|| format!("stage{}-rustdoc", compiler.stage)); println!("Checking rustdoc artifacts ({} -> {})", &compiler.host, target); run_cargo(builder, &mut cargo, diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 576267e6948f5..9ced04a5c808a 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -95,7 +95,6 @@ impl Step for Std { let mut cargo = builder.cargo(compiler, Mode::Std, target, "build"); std_cargo(builder, &compiler, target, &mut cargo); - let _folder = builder.fold_output(|| format!("stage{}-std", compiler.stage)); builder.info(&format!("Building stage{} std artifacts ({} -> {})", compiler.stage, &compiler.host, target)); run_cargo(builder, @@ -422,7 +421,6 @@ impl Step for Test { let mut cargo = builder.cargo(compiler, Mode::Test, target, "build"); test_cargo(builder, &compiler, target, &mut cargo); - let _folder = builder.fold_output(|| format!("stage{}-test", compiler.stage)); builder.info(&format!("Building stage{} test artifacts ({} -> {})", compiler.stage, &compiler.host, target)); run_cargo(builder, @@ -555,7 +553,6 @@ impl Step for Rustc { let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "build"); rustc_cargo(builder, &mut cargo); - let _folder = builder.fold_output(|| format!("stage{}-rustc", compiler.stage)); builder.info(&format!("Building stage{} compiler artifacts ({} -> {})", compiler.stage, &compiler.host, target)); run_cargo(builder, @@ -710,7 +707,6 @@ impl Step for CodegenBackend { let tmp_stamp = out_dir.join(".tmp.stamp"); - let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage)); let files = run_cargo(builder, cargo.arg("--features").arg(features), vec![], diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 4d297fa918a11..7011b7f1664c7 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -128,7 +128,7 @@ use build_helper::{ }; use filetime::FileTime; -use crate::util::{exe, libdir, OutputFolder, CiEnv}; +use crate::util::{exe, libdir, CiEnv}; mod cc_detect; mod channel; @@ -1092,19 +1092,6 @@ impl Build { } } - /// Fold the output of the commands after this method into a group. The fold - /// ends when the returned object is dropped. Folding can only be used in - /// the Travis CI environment. - pub fn fold_output(&self, name: F) -> Option - where D: Into, F: FnOnce() -> D - { - if !self.config.dry_run && self.ci_env == CiEnv::Travis { - Some(OutputFolder::new(name().into())) - } else { - None - } - } - /// Updates the actual toolstate of a tool. /// /// The toolstates are saved to the file specified by the key diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 8b6e856a8aba8..f8d1abe299473 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -104,7 +104,6 @@ impl Step for Llvm { } } - let _folder = builder.fold_output(|| "llvm"); let descriptor = if emscripten { "Emscripten " } else { "" }; builder.info(&format!("Building {}LLVM for {}", descriptor, target)); let _time = util::timeit(&builder); @@ -493,7 +492,6 @@ impl Step for Lld { return out_dir } - let _folder = builder.fold_output(|| "lld"); builder.info(&format!("Building LLD for {}", target)); let _time = util::timeit(&builder); t!(fs::create_dir_all(&out_dir)); @@ -560,7 +558,6 @@ impl Step for TestHelpers { return } - let _folder = builder.fold_output(|| "build_test_helpers"); builder.info("Building test helpers"); t!(fs::create_dir_all(&dst)); let mut cfg = cc::Build::new(); diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 6c0c770bf0844..26fd7585ab5d1 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -713,7 +713,6 @@ impl Step for Tidy { cmd.arg("--verbose"); } - let _folder = builder.fold_output(|| "tidy"); builder.info("tidy check"); try_run(builder, &mut cmd); } @@ -1310,7 +1309,6 @@ impl Step for Compiletest { builder.ci_env.force_coloring_in_ci(&mut cmd); - let _folder = builder.fold_output(|| format!("test_{}", suite)); builder.info(&format!( "Check compiletest suite={} mode={} ({} -> {})", suite, mode, &compiler.host, target @@ -1320,7 +1318,6 @@ impl Step for Compiletest { if let Some(compare_mode) = compare_mode { cmd.arg("--compare-mode").arg(compare_mode); - let _folder = builder.fold_output(|| format!("test_{}_{}", suite, compare_mode)); builder.info(&format!( "Check compiletest suite={} mode={} compare_mode={} ({} -> {})", suite, mode, compare_mode, &compiler.host, target @@ -1364,7 +1361,6 @@ impl Step for DocTest { // tests for all files that end in `*.md` let mut stack = vec![builder.src.join(self.path)]; let _time = util::timeit(&builder); - let _folder = builder.fold_output(|| format!("test_{}", self.name)); let mut files = Vec::new(); while let Some(p) = stack.pop() { @@ -1495,7 +1491,6 @@ impl Step for ErrorIndex { .env("CFG_BUILD", &builder.config.build) .env("RUSTC_ERROR_METADATA_DST", builder.extended_error_dir()); - let _folder = builder.fold_output(|| "test_error_index"); builder.info(&format!("Testing error-index stage{}", compiler.stage)); let _time = util::timeit(&builder); builder.run(&mut tool); @@ -1819,14 +1814,6 @@ impl Step for Crate { ); } - let _folder = builder.fold_output(|| { - format!( - "{}_stage{}-{}", - test_kind.subcommand(), - compiler.stage, - krate - ) - }); builder.info(&format!( "{} {} stage{} ({} -> {})", test_kind, krate, compiler.stage, &compiler.host, target @@ -1894,8 +1881,6 @@ impl Step for CrateRustdoc { cargo.arg("--quiet"); } - let _folder = builder - .fold_output(|| format!("{}_stage{}-rustdoc", test_kind.subcommand(), compiler.stage)); builder.info(&format!( "{} rustdoc stage{} ({} -> {})", test_kind, compiler.stage, &compiler.host, target diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index a9269a7ad24ab..15a329a5b9152 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -74,7 +74,6 @@ impl Step for ToolBuild { &self.extra_features, ); - let _folder = builder.fold_output(|| format!("stage{}-{}", compiler.stage, tool)); builder.info(&format!("Building stage{} tool {} ({})", compiler.stage, tool, target)); let mut duplicates = Vec::new(); let is_expected = compile::stream_cargo(builder, &mut cargo, vec![], &mut |msg| { @@ -509,7 +508,6 @@ impl Step for Rustdoc { &[], ); - let _folder = builder.fold_output(|| format!("stage{}-rustdoc", target_compiler.stage)); builder.info(&format!("Building rustdoc for stage{} ({})", target_compiler.stage, target_compiler.host)); builder.run(&mut cargo); diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index 47f5edd15631a..98ae7b692bb3c 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -6,10 +6,10 @@ use std::env; use std::str; use std::fs; -use std::io::{self, Write}; +use std::io; use std::path::{Path, PathBuf}; use std::process::Command; -use std::time::{SystemTime, Instant}; +use std::time::Instant; use build_helper::t; @@ -254,78 +254,12 @@ pub fn symlink_dir(config: &Config, src: &Path, dest: &Path) -> io::Result<()> { } } -/// An RAII structure that indicates all output until this instance is dropped -/// is part of the same group. -/// -/// On Travis CI, these output will be folded by default, together with the -/// elapsed time in this block. This reduces noise from unnecessary logs, -/// allowing developers to quickly identify the error. -/// -/// Travis CI supports folding by printing `travis_fold:start:` and -/// `travis_fold:end:` around the block. Time elapsed is recognized -/// similarly with `travis_time:[start|end]:`. These are undocumented, but -/// can easily be deduced from source code of the [Travis build commands]. -/// -/// [Travis build commands]: -/// https://github.com/travis-ci/travis-build/blob/f603c0089/lib/travis/build/templates/header.sh -pub struct OutputFolder { - name: String, - start_time: SystemTime, // we need SystemTime to get the UNIX timestamp. -} - -impl OutputFolder { - /// Creates a new output folder with the given group name. - pub fn new(name: String) -> OutputFolder { - // "\r" moves the cursor to the beginning of the line, and "\x1b[0K" is - // the ANSI escape code to clear from the cursor to end of line. - // Travis seems to have trouble when _not_ using "\r\x1b[0K", that will - // randomly put lines to the top of the webpage. - print!("travis_fold:start:{0}\r\x1b[0Ktravis_time:start:{0}\r\x1b[0K", name); - OutputFolder { - name, - start_time: SystemTime::now(), - } - } -} - -impl Drop for OutputFolder { - fn drop(&mut self) { - use std::time::*; - use std::u64; - - fn to_nanos(duration: Result) -> u64 { - match duration { - Ok(d) => d.as_secs() * 1_000_000_000 + d.subsec_nanos() as u64, - Err(_) => u64::MAX, - } - } - - let end_time = SystemTime::now(); - let duration = end_time.duration_since(self.start_time); - let start = self.start_time.duration_since(UNIX_EPOCH); - let finish = end_time.duration_since(UNIX_EPOCH); - println!( - "travis_fold:end:{0}\r\x1b[0K\n\ - travis_time:end:{0}:start={1},finish={2},duration={3}\r\x1b[0K", - self.name, - to_nanos(start), - to_nanos(finish), - to_nanos(duration) - ); - io::stdout().flush().unwrap(); - } -} - /// The CI environment rustbuild is running in. This mainly affects how the logs /// are printed. #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub enum CiEnv { /// Not a CI environment. None, - /// The Travis CI environment, for Linux (including Docker) and macOS builds. - Travis, - /// The AppVeyor environment, for Windows builds. - AppVeyor, /// The Azure Pipelines environment, for Linux (including Docker), Windows, and macOS builds. AzurePipelines, } @@ -333,11 +267,7 @@ pub enum CiEnv { impl CiEnv { /// Obtains the current CI environment. pub fn current() -> CiEnv { - if env::var("TRAVIS").ok().map_or(false, |e| &*e == "true") { - CiEnv::Travis - } else if env::var("APPVEYOR").ok().map_or(false, |e| &*e == "True") { - CiEnv::AppVeyor - } else if env::var("TF_BUILD").ok().map_or(false, |e| &*e == "True") { + if env::var("TF_BUILD").ok().map_or(false, |e| &*e == "True") { CiEnv::AzurePipelines } else { CiEnv::None diff --git a/src/ci/docker/README.md b/src/ci/docker/README.md index 34320ab4411e2..367e43849923f 100644 --- a/src/ci/docker/README.md +++ b/src/ci/docker/README.md @@ -20,7 +20,7 @@ Images will output artifacts in an `obj` dir at the root of a repository. - Each directory, excluding `scripts` and `disabled`, corresponds to a docker image - `scripts` contains files shared by docker images -- `disabled` contains images that are not built on travis +- `disabled` contains images that are not built on CI ## Docker Toolbox on Windows diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index e6cd794887c0a..dea41bee6e05c 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -17,9 +17,6 @@ dist=$objdir/build/dist source "$ci_dir/shared.sh" -travis_fold start build_docker -travis_time_start - if [ -f "$docker_dir/$image/Dockerfile" ]; then if [ "$CI" != "" ]; then hash_key=/tmp/.docker-hash-key.txt @@ -94,7 +91,6 @@ elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then echo Cannot run disabled images on CI! exit 1 fi - # retry messes with the pipe from tar to docker. Not needed on non-travis # Transform changes the context of disabled Dockerfiles to match the enabled ones tar --transform 's#^./disabled/#./#' -C $docker_dir -c . | docker \ build \ @@ -107,9 +103,6 @@ else exit 1 fi -travis_fold end build_docker -travis_time_finish - mkdir -p $HOME/.cargo mkdir -p $objdir/tmp mkdir -p $objdir/cores @@ -144,8 +137,6 @@ exec docker \ --env DEPLOY_ALT \ --env LOCAL_USER_ID=`id -u` \ --env CI \ - --env TRAVIS \ - --env TRAVIS_BRANCH \ --env TF_BUILD \ --env BUILD_SOURCEBRANCHNAME \ --env TOOLSTATE_REPO_ACCESS_TOKEN \ diff --git a/src/ci/docker/x86_64-gnu-tools/repo.sh b/src/ci/docker/x86_64-gnu-tools/repo.sh index 741d4dcbd9a45..56186a8b6a686 100644 --- a/src/ci/docker/x86_64-gnu-tools/repo.sh +++ b/src/ci/docker/x86_64-gnu-tools/repo.sh @@ -5,8 +5,7 @@ # # The function relies on a GitHub bot user, which should have a Personal access # token defined in the environment variable $TOOLSTATE_REPO_ACCESS_TOKEN. If for -# some reason you need to change the token, please update `.travis.yml` and -# `appveyor.yml`: +# some reason you need to change the token, please update `.azure-pipelines/*`. # # 1. Generate a new Personal access token: # @@ -18,28 +17,9 @@ # Save it somewhere secure, as the token would be gone once you leave # the page. # -# 2. Encrypt the token for Travis CI +# 2. Update the variable group in Azure Pipelines # -# * Install the `travis` tool locally (`gem install travis`). -# * Encrypt the token: -# ``` -# travis -r rust-lang/rust encrypt \ -# TOOLSTATE_REPO_ACCESS_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -# ``` -# * Copy output to replace the existing one in `.travis.yml`. -# * Details of this step can be found in -# -# -# 3. Encrypt the token for AppVeyor -# -# * Login to AppVeyor using your main account, and login as the rust-lang -# organization. -# * Open the ["Encrypt data" tool](https://ci.appveyor.com/tools/encrypt) -# * Paste the 40-digit token into the "Value to encrypt" box, then click -# "Encrypt" -# * Copy the output to replace the existing one in `appveyor.yml`. -# * Details of this step can be found in -# +# * Ping a member of the infrastructure team to do this. # # 4. Replace the email address below if the bot account identity is changed # diff --git a/src/ci/init_repo.sh b/src/ci/init_repo.sh index 8b635810825f1..c7c3b0a5fbf5b 100755 --- a/src/ci/init_repo.sh +++ b/src/ci/init_repo.sh @@ -11,9 +11,6 @@ set -o nounset ci_dir=$(cd $(dirname $0) && pwd) . "$ci_dir/shared.sh" -travis_fold start init_repo -travis_time_start - REPO_DIR="$1" CACHE_DIR="$2" @@ -73,5 +70,3 @@ retry sh -c "git submodule deinit -f $use_git && \ git submodule sync && \ git submodule update -j 16 --init --recursive $use_git" wait -travis_fold end init_repo -travis_time_finish diff --git a/src/ci/run.sh b/src/ci/run.sh index 811d401a83c21..b40bef7766573 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -91,27 +91,14 @@ if [ "$RUN_CHECK_WITH_PARALLEL_QUERIES" != "" ]; then rm -rf build fi -travis_fold start configure -travis_time_start $SRC/configure $RUST_CONFIGURE_ARGS -travis_fold end configure -travis_time_finish -travis_fold start make-prepare -travis_time_start retry make prepare -travis_fold end make-prepare -travis_time_finish -travis_fold start check-bootstrap -travis_time_start make check-bootstrap -travis_fold end check-bootstrap -travis_time_finish # Display the CPU and memory information. This helps us know why the CI timing # is fluctuating. -travis_fold start log-system-info if isOSX; then system_profiler SPHardwareDataType || true sysctl hw || true @@ -121,19 +108,14 @@ else cat /proc/meminfo || true ncpus=$(grep processor /proc/cpuinfo | wc -l) fi -travis_fold end log-system-info if [ ! -z "$SCRIPT" ]; then sh -x -c "$SCRIPT" else do_make() { - travis_fold start "make-$1" - travis_time_start echo "make -j $ncpus $1" make -j $ncpus $1 local retval=$? - travis_fold end "make-$1" - travis_time_finish return $retval } diff --git a/src/ci/shared.sh b/src/ci/shared.sh index 323d53f2bec85..b093a07ec5c5a 100644 --- a/src/ci/shared.sh +++ b/src/ci/shared.sh @@ -25,53 +25,13 @@ function retry { } function isCI { - [ "$CI" = "true" ] || [ "$TRAVIS" = "true" ] || [ "$TF_BUILD" = "True" ] + [ "$CI" = "true" ] || [ "$TF_BUILD" = "True" ] } function isOSX { - [ "$TRAVIS_OS_NAME" = "osx" ] || [ "$AGENT_OS" = "Darwin" ] + [ "$AGENT_OS" = "Darwin" ] } function getCIBranch { - if [ "$TRAVIS" = "true" ]; then - echo "$TRAVIS_BRANCH" - elif [ "$APPVEYOR" = "True" ]; then - echo "$APPVEYOR_REPO_BRANCH" - else - echo "$BUILD_SOURCEBRANCHNAME" - fi; + echo "$BUILD_SOURCEBRANCHNAME" } - -if ! declare -F travis_fold; then - if [ "${TRAVIS-false}" = 'true' ]; then - # This is a trimmed down copy of - # https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/templates/header.sh - travis_fold() { - echo -en "travis_fold:$1:$2\r\033[0K" - } - travis_time_start() { - travis_timer_id=$(printf %08x $(( RANDOM * RANDOM ))) - travis_start_time=$(travis_nanoseconds) - echo -en "travis_time:start:$travis_timer_id\r\033[0K" - } - travis_time_finish() { - travis_end_time=$(travis_nanoseconds) - local duration=$(($travis_end_time-$travis_start_time)) - local msg="travis_time:end:$travis_timer_id" - echo -en "\n$msg:start=$travis_start_time,finish=$travis_end_time,duration=$duration\r\033[0K" - } - if [ $(uname) = 'Darwin' ]; then - travis_nanoseconds() { - date -u '+%s000000000' - } - else - travis_nanoseconds() { - date -u '+%s%N' - } - fi - else - travis_fold() { return 0; } - travis_time_start() { return 0; } - travis_time_finish() { return 0; } - fi -fi