From 18aad63bcb0e4a49e27747d0bb321bdd6e7e590e Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 1 Oct 2019 00:27:18 +0000 Subject: [PATCH] servo: Merge #6306 - Use Cargo's target directory sharing (from metajack:shared-target-dir); r=mbrubeck This speeds up `./mach build --dev` followed by `./mach build-cef` by 25%. When rust-lang/cargo#497 is fixed, this speedup will increase dramatically. Source-Repo: https://github.com/servo/servo Source-Revision: d6263c9b6e969fde4c644034e684a39d68667ad9 UltraBlame original commit: 42376672d55b8b2f7f08473d1ab24888896d0256 --- servo/cargo-nightly-build | 4 +- servo/components/servo/.cargo/config | 12 ---- servo/components/util/resource_files.rs | 36 ---------- servo/etc/ci/upload_docs.sh | 8 --- servo/ports/cef/Cargo.toml | 14 ++-- servo/ports/gonk/README.md | 8 --- servo/python/servo/build_commands.py | 13 +--- servo/python/servo/command_base.py | 88 ++++++++++++++++++++--- servo/python/servo/post_build_commands.py | 21 ++---- servo/python/servo/testing_commands.py | 31 ++------ servo/python/tidy.py | 14 ---- servo/tests/power/PowerMeasure.py | 4 -- 12 files changed, 98 insertions(+), 155 deletions(-) diff --git a/servo/cargo-nightly-build b/servo/cargo-nightly-build index d78180ab9e8ed..1153bf348273a 100644 --- a/servo/cargo-nightly-build +++ b/servo/cargo-nightly-build @@ -1,5 +1,5 @@ 2015 - -04 +06 - -14 +15 diff --git a/servo/components/servo/.cargo/config b/servo/components/servo/.cargo/config index 8676283bc1cbc..84d6f5777f509 100644 --- a/servo/components/servo/.cargo/config +++ b/servo/components/servo/.cargo/config @@ -35,18 +35,6 @@ linker . . / -support -/ -android -- -rs -- -glue -/ -apk -- -builder -/ target / debug diff --git a/servo/components/util/resource_files.rs b/servo/components/util/resource_files.rs index aa602ef3bf484..74af58087cf5f 100644 --- a/servo/components/util/resource_files.rs +++ b/servo/components/util/resource_files.rs @@ -201,41 +201,6 @@ pop ; path . -pop -( -) -; -path -. -push -( -" -resources -" -) -; -if -! -path -. -is_dir -( -) -{ -path -. -pop -( -) -; -path -. -pop -( -) -; -path -. push ( " @@ -274,7 +239,6 @@ resources ; } } -} path } } diff --git a/servo/etc/ci/upload_docs.sh b/servo/etc/ci/upload_docs.sh index 5220c7396c103..025c04f48c438 100644 --- a/servo/etc/ci/upload_docs.sh +++ b/servo/etc/ci/upload_docs.sh @@ -93,10 +93,6 @@ servo org / * -components -/ -servo -/ target / doc @@ -106,10 +102,6 @@ ghp import - n -components -/ -servo -/ target / doc diff --git a/servo/ports/cef/Cargo.toml b/servo/ports/cef/Cargo.toml index eec8db98714aa..eb4d713d0f3b0 100644 --- a/servo/ports/cef/Cargo.toml +++ b/servo/ports/cef/Cargo.toml @@ -67,13 +67,6 @@ libc " * " -objc -= -" -0 -. -1 -" [ dependencies . @@ -450,6 +443,13 @@ darwin . dependencies ] +objc += +" +0 +. +1 +" cocoa = " diff --git a/servo/ports/gonk/README.md b/servo/ports/gonk/README.md index ba79b7c86f495..c5e066088e4b3 100644 --- a/servo/ports/gonk/README.md +++ b/servo/ports/gonk/README.md @@ -333,10 +333,6 @@ libmozjs . so ( -ports -/ -gonk -/ target / arm @@ -438,10 +434,6 @@ Copy b2s adb push -ports -/ -gonk -/ target / arm diff --git a/servo/python/servo/build_commands.py b/servo/python/servo/build_commands.py index 6f8920286a4e0..54e2d732504ab 100644 --- a/servo/python/servo/build_commands.py +++ b/servo/python/servo/build_commands.py @@ -923,19 +923,10 @@ base_path = -path +self . -join +get_target_dir ( -" -components -" -" -servo -" -" -target -" ) release_path diff --git a/servo/python/servo/command_base.py b/servo/python/servo/command_base.py index 83178ba7d3d0a..b560b9b7fc0d6 100644 --- a/servo/python/servo/command_base.py +++ b/servo/python/servo/command_base.py @@ -1118,30 +1118,66 @@ _cargo_build_id def -get_binary_path +get_target_dir ( self -release -dev ) : -base_path -= -path -. -join -( +if " -components +CARGO_TARGET_DIR " +in +os +. +environ +: + +return +os +. +environ +[ " -servo +CARGO_TARGET_DIR " +] + +else +: + +return +path +. +join +( +self +. +context +. +topdir " target " ) + +def +get_binary_path +( +self +release +dev +) +: + +base_path += +self +. +get_target_dir +( +) release_path = @@ -1792,6 +1828,36 @@ " ] +if +" +CARGO_TARGET_DIR +" +not +in +env +: + +env +[ +" +CARGO_TARGET_DIR +" +] += +path +. +join +( +self +. +context +. +topdir +" +target +" +) + if extra_lib : diff --git a/servo/python/servo/post_build_commands.py b/servo/python/servo/post_build_commands.py index 6fc58cb89937c..6757af4537237 100644 --- a/servo/python/servo/post_build_commands.py +++ b/servo/python/servo/post_build_commands.py @@ -994,21 +994,11 @@ . join ( - self . -context -. -topdir -" -components -" -" -servo -" -" -target -" +get_target_dir +( +) " doc " @@ -1263,13 +1253,10 @@ self . -servo_crate +get_target_dir ( ) " -target -" -" doc " " diff --git a/servo/python/servo/testing_commands.py b/servo/python/servo/testing_commands.py index 183addc96f84c..1661ee63b01fa 100644 --- a/servo/python/servo/testing_commands.py +++ b/servo/python/servo/testing_commands.py @@ -214,18 +214,9 @@ self . -context -. -topdir -" -components -" -" -servo -" -" -target -" +get_target_dir +( +) " debug " @@ -260,19 +251,9 @@ self . -context -. -topdir -" -components -" -" -servo -" - -" -target -" +get_target_dir +( +) " debug " diff --git a/servo/python/tidy.py b/servo/python/tidy.py index e1de2d057e033..cc454643cf62f 100644 --- a/servo/python/tidy.py +++ b/servo/python/tidy.py @@ -222,20 +222,6 @@ " " -components -/ -servo -/ -target -/ -* -" - -" -ports -/ -gonk -/ target / * diff --git a/servo/tests/power/PowerMeasure.py b/servo/tests/power/PowerMeasure.py index 7a2e9bd8aed38..5ca0ecdd87e8b 100644 --- a/servo/tests/power/PowerMeasure.py +++ b/servo/tests/power/PowerMeasure.py @@ -227,10 +227,6 @@ . . / -components -/ -servo -/ target / release