Backed out 4 changesets (bug 1499196) for regression author didn't respond on time, depends on 1501178, requested by igoldan. a=backout
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Mon, 29 Oct 2018 10:30:22 +0200
changeset 443284 28fcf5ff82bf4a5d9e3a6425c586d5fcfdf695d2
parent 443283 a2e694f4996853244efc911abdeb599847f9ffa5
child 443287 f7a97b344fa59bd3b01ea81ebd5b150aa63bfb12
push id34952
push userebalazs@mozilla.com
push dateMon, 29 Oct 2018 08:31:50 +0000
treeherdermozilla-central@28fcf5ff82bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1499196, 1501178
milestone65.0a1
backs outc43c91d2b97b1d1b230efdabce8b67d52e5cda27
caaad097961a2566dff3742bf57b36085ce3bab6
98fad0b05551284eae4d2079123b5555d07dbc4d
470e06d78a7b1da0aea4fd58b520090097de6e19
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 4 changesets (bug 1499196) for regression author didn't respond on time, depends on 1501178, requested by igoldan. a=backout Backed out changeset c43c91d2b97b (bug 1499196) Backed out changeset caaad097961a (bug 1499196) Backed out changeset 98fad0b05551 (bug 1499196) Backed out changeset 470e06d78a7b (bug 1499196)
Cargo.lock
build/templates.mozbuild
build/workspace-hack/Cargo.toml
build/workspace-hack/src/lib.rs
js/src/build.rs
js/src/rust/Cargo.toml
python/mozbuild/mozbuild/backend/tup.py
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
toolkit/library/gtest/rust/moz.build
toolkit/library/rust/Cargo.toml
toolkit/library/rust/moz.build
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1007,17 +1007,16 @@ dependencies = [
  "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "gkrust"
 version = "0.1.0"
 dependencies = [
  "gkrust-shared 0.1.0",
- "mozilla-central-workspace-hack 0.1.0",
  "stylo_tests 0.0.1",
 ]
 
 [[package]]
 name = "gkrust-gtest"
 version = "0.1.0"
 dependencies = [
  "bench-collections-gtest 0.1.0",
@@ -1219,17 +1218,16 @@ dependencies = [
  "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "jsrust"
 version = "0.1.0"
 dependencies = [
  "jsrust_shared 0.1.0",
- "mozilla-central-workspace-hack 0.1.0",
 ]
 
 [[package]]
 name = "jsrust_shared"
 version = "0.1.0"
 dependencies = [
  "baldrdash 0.1.0",
  "bindgen 0.43.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1537,30 +1535,16 @@ dependencies = [
 ]
 
 [[package]]
 name = "moz_cbor"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
-name = "mozilla-central-workspace-hack"
-version = "0.1.0"
-dependencies = [
- "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "proc-macro2 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.66 (git+https://github.com/servo/serde?branch=deserialize_from_enums8)",
- "syn 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
 name = "mozjs_sys"
 version = "0.0.0"
 dependencies = [
  "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
--- a/build/templates.mozbuild
+++ b/build/templates.mozbuild
@@ -57,32 +57,35 @@ def Library(name):
 def AllowCompilerWarnings():
     COMPILE_FLAGS['WARNINGS_AS_ERRORS'] = []
 
 @template
 def DisableCompilerWarnings():
     COMPILE_FLAGS['WARNINGS_CFLAGS'] = []
 
 @template
-def RustLibrary(name, features=None, output_category=None):
+def RustLibrary(name, features=None, target_dir=None, output_category=None):
     '''Template for Rust libraries.'''
     Library(name)
 
     IS_RUST_LIBRARY = True
     # Some Rust build scripts compile C/C++ sources, don't error on warnings for them.
     AllowCompilerWarnings()
 
     # And furthermore, don't even show warnings for them, so they don't regress
     # the Compiler Warnings build metric
     # <https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Automated_Performance_Testing_and_Sheriffing/Build_Metrics#compiler_warnings>.
     DisableCompilerWarnings()
 
     if features:
         RUST_LIBRARY_FEATURES = features
 
+    if target_dir:
+        RUST_LIBRARY_TARGET_DIR = target_dir
+
     if output_category:
         RUST_LIBRARY_OUTPUT_CATEGORY = output_category
 
 
 @template
 def SharedLibrary(name, output_category=None):
     '''Template for shared libraries.'''
     Library(name)
deleted file mode 100644
--- a/build/workspace-hack/Cargo.toml
+++ /dev/null
@@ -1,58 +0,0 @@
-[package]
-name = "mozilla-central-workspace-hack"
-version = "0.1.0"
-
-# This is a hack to help rust code in the tree that are built by different
-# invocations of cargo share dependencies rather than rebuilding them. This is
-# based on the "rustc-workspace-hack" used by the rustc build system to achieve
-# the same. From the description of the issue given there:
-#
-#  "Each time Cargo runs a build it will re-resolve the dependency graph, "
-#  "notably selecting different features sometimes for each build."
-#
-# We work around this by specifying the union of the set of features selected
-# by dependencies in each cargo invocation for each instance they would differ.
-
-[build-dependencies]
-void = { features = ["std", "default"], version = "1.0.2" }
-syn = { features = ["extra-traits", "fold", "full"],  version = "0.14" }
-log = { features = ["release_max_level_info", "release_max_level_warn", "std"],  version = "0.4.5" }
-serde = { features = ["default", "rc", "serde_derive", "std"], version = "1.0.66" }
-serde_derive = { features = ["default", "deserialize_in_place"], version = "1.0.66" }
-quote = { features = ["default", "proc-macro"], version = "0.5.2" }
-proc-macro2 = { features = ["default", "proc-macro"], version = "0.3.5" }
-
-[target."cfg(windows)".dependencies.winapi]
-version = "0.3.6"
-features = [
-    "basetsd",
-    "consoleapi",
-    "dwrite",
-    "dwrite_1",
-    "dwrite_3",
-    "errhandlingapi",
-    "fileapi",
-    "handleapi",
-    "hidclass",
-    "hidpi",
-    "hidusage",
-    "libloaderapi",
-    "memoryapi",
-    "minwinbase",
-    "minwindef",
-    "ntdef",
-    "ntsecapi",
-    "ntstatus",
-    "processenv",
-    "profileapi",
-    "setupapi",
-    "std",
-    "sysinfoapi",
-    "timezoneapi",
-    "unknwnbase",
-    "winbase",
-    "wincon",
-    "winerror",
-    "winnls",
-    "winnt"
-]
deleted file mode 100644
--- a/build/workspace-hack/src/lib.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#[cfg(test)]
-mod tests {
-    #[test]
-    fn it_works() {
-        assert_eq!(2 + 2, 4);
-    }
-}
--- a/js/src/build.rs
+++ b/js/src/build.rs
@@ -85,17 +85,17 @@ fn main() {
 fn maybe_add_spidermonkey_rust_lib() {
     let out_dir = env::var("OUT_DIR")
         .expect("cargo should invoke us with the OUT_DIR env var set");
 
     let mut target_build_dir = path::PathBuf::from(out_dir);
     target_build_dir.push("../../");
 
     let mut build_dir = target_build_dir.display().to_string();
-    build_dir.push_str("mozjs_sys-*/out/*/debug");
+    build_dir.push_str("mozjs_sys-*/out/js/src/rust/*/debug");
 
     let entries = match glob::glob(&build_dir){
         Err(_) => { return; }
         Ok(entries) => entries
     };
 
     for entry in entries {
         if let Ok(path) = entry {
--- a/js/src/rust/Cargo.toml
+++ b/js/src/rust/Cargo.toml
@@ -5,9 +5,8 @@ authors = ["The Spidermonkey developers"
 
 [lib]
 name = "jsrust"
 crate-type = ["staticlib"]
 path = "lib.rs"
 
 [dependencies]
 jsrust_shared = { path = "./shared" }
-mozilla-central-workspace-hack = { path = "../../../build/workspace-hack" }
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -961,17 +961,17 @@ class TupBackend(CommonBackend):
                 header = 'RUSTC'
             else:
                 inputs.add(invocation['program'])
                 header = 'RUN'
 
             invocation['full-deps'].update(inputs)
             invocation['full-deps'].update(invocation['outputs'])
 
-            cmd_key = ' '.join(outputs)
+            cmd_key = ' '.join(command)
             if cmd_key not in self._rust_cmds:
                 self._rust_cmds.add(cmd_key)
                 # We have some custom build scripts that depend on python code
                 # as well as invalidate a lot of the rust build, so set
                 # check_unchanged to try to reduce long incremental builds
                 # when only changing python.
                 check_unchanged = False
                 if (invocation['target_kind'][0] == 'custom-build' and
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -524,17 +524,17 @@ class TreeMetadataEmitter(LoggingMixin):
                 context)
 
         crate_type = crate_type[0]
         if crate_type != 'staticlib':
             raise SandboxValidationError(
                 'crate-type %s is not permitted for %s' % (crate_type, libname),
                 context)
 
-        cargo_target_dir = context.config.topobjdir
+        cargo_target_dir = context.get('RUST_LIBRARY_TARGET_DIR', '.')
 
         dependencies = set(config.get('dependencies', {}).iterkeys())
 
         features = context.get(cls.FEATURES_VAR, [])
         unique_features = set(features)
         if len(features) != len(unique_features):
             raise SandboxValidationError(
                 'features for %s should not contain duplicates: %s' % (libname, features),
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -832,51 +832,51 @@ class TestRecursiveMakeBackend(BackendTe
         env = self._consume('rust-library', RecursiveMakeBackend)
 
         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]
                  # Strip out computed flags, they're a PITA to test.
                  if not l.startswith('COMPUTED_')]
 
         expected = [
-            'RUST_LIBRARY_FILE := %s/x86_64-unknown-linux-gnu/release/libtest_library.a' % env.topobjdir,
+            'RUST_LIBRARY_FILE := ./x86_64-unknown-linux-gnu/release/libtest_library.a',
             'CARGO_FILE := $(srcdir)/Cargo.toml',
             'CARGO_TARGET_DIR := %s' % env.topobjdir,
         ]
 
         self.assertEqual(lines, expected)
 
     def test_host_rust_library(self):
         """Test that a Rust library is written to backend.mk correctly."""
         env = self._consume('host-rust-library', RecursiveMakeBackend)
 
         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]
                  # Strip out computed flags, they're a PITA to test.
                  if not l.startswith('COMPUTED_')]
 
         expected = [
-            'HOST_RUST_LIBRARY_FILE := %s/x86_64-unknown-linux-gnu/release/libhostrusttool.a' % env.topobjdir,
+            'HOST_RUST_LIBRARY_FILE := ./x86_64-unknown-linux-gnu/release/libhostrusttool.a',
             'CARGO_FILE := $(srcdir)/Cargo.toml',
             'CARGO_TARGET_DIR := %s' % env.topobjdir,
         ]
 
         self.assertEqual(lines, expected)
 
     def test_host_rust_library_with_features(self):
         """Test that a host Rust library with features is written to backend.mk correctly."""
         env = self._consume('host-rust-library-features', RecursiveMakeBackend)
 
         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]
                  # Strip out computed flags, they're a PITA to test.
                  if not l.startswith('COMPUTED_')]
 
         expected = [
-            'HOST_RUST_LIBRARY_FILE := %s/x86_64-unknown-linux-gnu/release/libhostrusttool.a' % env.topobjdir,
+            'HOST_RUST_LIBRARY_FILE := ./x86_64-unknown-linux-gnu/release/libhostrusttool.a',
             'CARGO_FILE := $(srcdir)/Cargo.toml',
             'CARGO_TARGET_DIR := %s' % env.topobjdir,
             'HOST_RUST_LIBRARY_FEATURES := musthave cantlivewithout',
         ]
 
         self.assertEqual(lines, expected)
 
     def test_rust_library_with_features(self):
@@ -884,17 +884,17 @@ class TestRecursiveMakeBackend(BackendTe
         env = self._consume('rust-library-features', RecursiveMakeBackend)
 
         backend_path = mozpath.join(env.topobjdir, 'backend.mk')
         lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]
                  # Strip out computed flags, they're a PITA to test.
                  if not l.startswith('COMPUTED_')]
 
         expected = [
-            'RUST_LIBRARY_FILE := %s/x86_64-unknown-linux-gnu/release/libfeature_library.a' % env.topobjdir,
+            'RUST_LIBRARY_FILE := ./x86_64-unknown-linux-gnu/release/libfeature_library.a',
             'CARGO_FILE := $(srcdir)/Cargo.toml',
             'CARGO_TARGET_DIR := %s' % env.topobjdir,
             'RUST_LIBRARY_FEATURES := musthave cantlivewithout',
         ]
 
         self.assertEqual(lines, expected)
 
     def test_rust_programs(self):
--- a/toolkit/library/gtest/rust/moz.build
+++ b/toolkit/library/gtest/rust/moz.build
@@ -1,10 +1,10 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 include('../../rust/gkrust-features.mozbuild')
 
-RustLibrary('gkrust-gtest', gkrust_features,
+RustLibrary('gkrust-gtest', gkrust_features, '../..',
             output_category=None if CONFIG['LINK_GTEST_DURING_COMPILE'] else 'gtest')
--- a/toolkit/library/rust/Cargo.toml
+++ b/toolkit/library/rust/Cargo.toml
@@ -15,17 +15,16 @@ gecko_debug = ["gkrust-shared/gecko_debu
 simd-accel = ["gkrust-shared/simd-accel"]
 moz_memory = ["gkrust-shared/moz_memory"]
 spidermonkey_rust = ["gkrust-shared/spidermonkey_rust"]
 gecko_profiler = ["gkrust-shared/gecko_profiler"]
 gecko_profiler_parse_elf = ["gkrust-shared/gecko_profiler_parse_elf"]
 
 [dependencies]
 gkrust-shared = { path = "shared" }
-mozilla-central-workspace-hack = { path = "../../../build/workspace-hack" }
 
 [dev-dependencies]
 stylo_tests = { path = "../../../servo/ports/geckolib/tests/" }
 
 [lib]
 path = "lib.rs"
 crate-type = ["staticlib"]
 test = false
--- a/toolkit/library/rust/moz.build
+++ b/toolkit/library/rust/moz.build
@@ -1,17 +1,17 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 include('gkrust-features.mozbuild')
 
-RustLibrary('gkrust', gkrust_features)
+RustLibrary('gkrust', gkrust_features, '..')
 
 # Target directory doesn't matter a lot here, since we can't share panic=abort
 # compilation artifacts with gkrust.
 RUST_TESTS = [
     'selectors',
     'servo_arc',
     'stylo_tests',
 ]