Merge mozilla-central to inbound. a=merge CLOSED TREE
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Mon, 29 Oct 2018 11:29:58 +0200
changeset 443291 265e49140f732f2884ceb888f504bd16d6a84c02
parent 443286 57b383a52a444a318bd3bc041bb44fe53bf8aaa7 (current diff)
parent 443290 f7a97b344fa59bd3b01ea81ebd5b150aa63bfb12 (diff)
child 443292 7e98f8ed12d4a3d9616f8a586041cd7b14963f83
push id109336
push userebalazs@mozilla.com
push dateMon, 29 Oct 2018 09:30:25 +0000
treeherdermozilla-inbound@265e49140f73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone65.0a1
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
Merge mozilla-central to inbound. a=merge CLOSED TREE
build/workspace-hack/Cargo.toml
build/workspace-hack/src/lib.rs
--- 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/accessible/windows/msaa/ARIAGridAccessibleWrap.cpp
+++ b/accessible/windows/msaa/ARIAGridAccessibleWrap.cpp
@@ -12,18 +12,19 @@ using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // ARIAGridAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_IMPL_ISUPPORTS_INHERITED0(ARIAGridAccessibleWrap,
                              ARIAGridAccessible)
 
-IMPL_IUNKNOWN_INHERITED1(ARIAGridAccessibleWrap,
+IMPL_IUNKNOWN_INHERITED2(ARIAGridAccessibleWrap,
                          AccessibleWrap,
+                         HyperTextAccessibleWrap,
                          ia2AccessibleTable)
 
 void
 ARIAGridAccessibleWrap::Shutdown()
 {
   ia2AccessibleTable::mTable = nullptr;
   ARIAGridAccessible::Shutdown();
 }
--- a/accessible/windows/msaa/HTMLTableAccessibleWrap.cpp
+++ b/accessible/windows/msaa/HTMLTableAccessibleWrap.cpp
@@ -11,18 +11,19 @@ using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableAccessibleWrap,
                              HTMLTableAccessible)
 
-IMPL_IUNKNOWN_INHERITED1(HTMLTableAccessibleWrap,
+IMPL_IUNKNOWN_INHERITED2(HTMLTableAccessibleWrap,
                          AccessibleWrap,
+                         HyperTextAccessibleWrap,
                          ia2AccessibleTable)
 
 void
 HTMLTableAccessibleWrap::Shutdown()
 {
   ia2AccessibleTable::mTable = nullptr;
   HTMLTableAccessible::Shutdown();
 }
--- 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/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -2002,43 +2002,50 @@ HTMLEditor::InsertAsPlaintextQuotation(c
     // and set the selection inside it:
     DebugOnly<nsresult> rv = selection->Collapse(newNode, 0);
     NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
       "Failed to collapse selection into the new node");
   }
 
   if (aAddCites) {
     rv = InsertWithQuotationsAsSubAction(aQuotedText);
-    NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
-      "Failed to insert the text with quotations");
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      return rv;
+    }
   } else {
     rv = InsertTextAsSubAction(aQuotedText);
-    NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
-      "Failed to insert the quoted text as plain text");
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      return rv;
+    }
+  }
+
+  if (!newNode) {
+    return NS_OK;
   }
+
+  // Set the selection to just after the inserted node:
+  EditorRawDOMPoint afterNewNode(newNode);
+  bool advanced = afterNewNode.AdvanceOffset();
+  NS_WARNING_ASSERTION(advanced,
+    "Failed to advance offset to after the new <span> element");
+  if (advanced) {
+    DebugOnly<nsresult> rvIgnored = selection->Collapse(afterNewNode);
+    NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
+      "Failed to collapse after the new node");
+  }
+
   // Note that if !aAddCites, aNodeInserted isn't set.
   // That's okay because the routines that use aAddCites
   // don't need to know the inserted node.
-
-  if (aNodeInserted && NS_SUCCEEDED(rv)) {
+  if (aNodeInserted) {
     newNode.forget(aNodeInserted);
   }
 
-  // Set the selection to just after the inserted node:
-  if (NS_SUCCEEDED(rv) && newNode) {
-    EditorRawDOMPoint afterNewNode(newNode);
-    if (afterNewNode.AdvanceOffset()) {
-      DebugOnly<nsresult> rv = selection->Collapse(afterNewNode);
-      NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
-        "Failed to collapse after the new node");
-    }
-  }
-
   // XXX Why don't we call HTMLEditRules::DidDoAction() here?
-  return rv;
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLEditor::Rewrap(bool aRespectNewlines)
 {
   // Rewrap makes no sense if there's no wrap column; default to 72.
   int32_t wrapWidth = WrapWidth();
   if (wrapWidth <= 0) {
@@ -2154,34 +2161,46 @@ HTMLEditor::InsertAsCitedQuotationIntern
     newNode->SetAttr(kNameSpaceID_None, nsGkAtoms::cite, aCitation, true);
   }
 
   // Set the selection inside the blockquote so aQuotedText will go there:
   selection->Collapse(newNode, 0);
 
   if (aInsertHTML) {
     rv = LoadHTML(aQuotedText);
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      return rv;
+    }
   } else {
     rv = InsertTextAsSubAction(aQuotedText);  // XXX ignore charset
-    NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Failed to insert the quoted text");
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      return rv;
+    }
   }
 
-  if (aNodeInserted && NS_SUCCEEDED(rv)) {
-    *aNodeInserted = newNode;
-    NS_IF_ADDREF(*aNodeInserted);
+  if (!newNode) {
+    return NS_OK;
   }
 
   // Set the selection to just after the inserted node:
-  if (NS_SUCCEEDED(rv) && newNode) {
-    EditorRawDOMPoint afterNewNode(newNode);
-    if (afterNewNode.AdvanceOffset()) {
-      selection->Collapse(afterNewNode);
-    }
+  EditorRawDOMPoint afterNewNode(newNode);
+  bool advanced = afterNewNode.AdvanceOffset();
+  NS_WARNING_ASSERTION(advanced,
+    "Failed advance offset to after the new <blockquote> element");
+  if (advanced) {
+    DebugOnly<nsresult> rvIgnored = selection->Collapse(afterNewNode);
+    NS_WARNING_ASSERTION(NS_SUCCEEDED(rvIgnored),
+      "Failed to collapse after the new node");
   }
-  return rv;
+
+  if (aNodeInserted) {
+    newNode.forget(aNodeInserted);
+  }
+
+  return NS_OK;
 }
 
 
 void RemoveBodyAndHead(nsINode& aNode)
 {
   nsCOMPtr<nsIContent> body, head;
   // find the body and head nodes if any.
   // look only at immediate children of aNode.
--- a/editor/libeditor/tests/mochitest.ini
+++ b/editor/libeditor/tests/mochitest.ini
@@ -277,16 +277,17 @@ subsuite = clipboard
 skip-if = android_version == '24'
 [test_inline_style_cache.html]
 [test_inlineTableEditing.html]
 [test_insertParagraph_in_inline_editing_host.html]
 [test_keypress_untrusted_event.html]
 [test_middle_click_paste.html]
 subsuite = clipboard
 skip-if = android_version == '24'
+[test_nsIEditorMailSupport_insertAsCitedQuotation.html]
 [test_nsIHTMLEditor_getSelectedElement.html]
 [test_nsIHTMLEditor_selectElement.html]
 [test_nsIHTMLEditor_setCaretAfterElement.html]
 [test_nsIHTMLObjectResizer_hideResizers.html]
 [test_nsITableEditor_deleteTableCell.html]
 [test_nsITableEditor_deleteTableCellContents.html]
 [test_nsITableEditor_deleteTableColumn.html]
 [test_nsITableEditor_deleteTableRow.html]
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/tests/test_nsIEditorMailSupport_insertAsCitedQuotation.html
@@ -0,0 +1,84 @@
+<!DOCTYPE>
+<html>
+<head>
+  <title>Test for nsIEditorMailSupport.insertAsCitedQuotation()</title>
+  <script src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" href="/tests/SimpleTest/test.css">
+</head>
+<body>
+<div id="display">
+</div>
+<div id="content" contenteditable></div>
+<pre id="test">
+</pre>
+
+<script class="testbody" type="application/javascript">
+
+SimpleTest.waitForExplicitFinish();
+SimpleTest.waitForFocus(function() {
+  let editor = document.getElementById("content");
+  let selection = document.getSelection();
+
+  editor.focus();
+  selection.collapse(editor, 0);
+
+  // Tests when the editor is in plaintext mode.
+
+  getEditor().flags |= SpecialPowers.Ci.nsIPlaintextEditor.eEditorPlaintextMask;
+
+  getEditorMailSupport().insertAsCitedQuotation("this is quoted text\nAnd here is second line.", "this is cited text", false);
+
+  ok(selection.isCollapsed,
+     "Selection should be collapsed after calling nsIEditorMailSupport.insertAsCitedQuotation() of plaintext editor");
+  is(selection.focusNode, editor,
+     "focus node of Selection should be a child of the editing host after calling nsIEditorMailSupport.insertAsCitedQuotation() of plaintext editor");
+  is(selection.focusOffset, 1,
+     "focus offset of Selection should be next to inserted <span> element after calling nsIEditorMailSupport.insertAsCitedQuotation() of plaintext editor");
+  is(editor.innerHTML, '<span style="white-space: pre-wrap;">&gt; this is quoted text<br>&gt; And here is second line.<br><br></span>',
+     "The quoted text should be inserted as plaintext into the plaintext editor");
+
+  // Tests when the editor is in HTML editor mode.
+  getEditor().flags &= ~SpecialPowers.Ci.nsIPlaintextEditor.eEditorPlaintextMask;
+
+  editor.innerHTML = "";
+
+  getEditorMailSupport().insertAsCitedQuotation("this is quoted text<br>", "this is cited text", false);
+
+  ok(selection.isCollapsed,
+     "Selection should be collapsed after calling nsIEditorMailSupport.insertAsCitedQuotation() of HTMLEditor editor (inserting as plaintext)");
+  is(selection.focusNode, editor,
+     "focus node of Selection should be a child of the editing host after calling nsIEditorMailSupport.insertAsCitedQuotation() of HTMLEditor editor (inserting as plaintext)");
+  is(selection.focusOffset, 1,
+     "focus offset of Selection should be next to inserted <span> element after calling nsIEditorMailSupport.insertAsCitedQuotation() of HTMLEditor editor (inserting as plaintext)");
+  is(editor.innerHTML,
+     '<blockquote type="cite" cite="this is cited text">this is quoted text&lt;br&gt;</blockquote>', "The quoted text should be inserted as plaintext into the HTML editor");
+
+  editor.innerHTML = "";
+
+  getEditorMailSupport().insertAsCitedQuotation("this is quoted text<br>And here is second line.", "this is cited text", true);
+
+  ok(selection.isCollapsed,
+     "Selection should be collapsed after calling nsIEditorMailSupport.insertAsCitedQuotation() of HTMLEditor editor (inserting as HTML source)");
+  is(selection.focusNode, editor,
+     "focus node of Selection should be a child of the editing host after calling nsIEditorMailSupport.insertAsCitedQuotation() of HTMLEditor editor (inserting as HTML source)");
+  is(selection.focusOffset, 1,
+     "focus offset of Selection should be next to inserted <span> element after calling nsIEditorMailSupport.insertAsCitedQuotation() of HTMLEditor editor (inserting as HTML source)");
+  is(editor.innerHTML, '<blockquote type="cite" cite="this is cited text">this is quoted text<br>And here is second line.</blockquote>',
+     "The quoted text should be inserted as HTML source into the HTML editor");
+
+  SimpleTest.finish();
+});
+
+function getEditor() {
+  var editingSession = SpecialPowers.wrap(window).docShell.editingSession;
+  return editingSession.getEditorForWindow(window);
+}
+
+function getEditorMailSupport() {
+  return getEditor().QueryInterface(SpecialPowers.Ci.nsIEditorMailSupport);
+}
+
+</script>
+</body>
+
+</html>
--- 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',
 ]