diff --git a/etc/patches/Remove-Cargo-toml-files.patch b/etc/patches/Remove-Cargo-toml-files.patch
deleted file mode 100644
index 76ffb196f3..0000000000
--- a/etc/patches/Remove-Cargo-toml-files.patch
+++ /dev/null
@@ -1,526 +0,0 @@
-diff --git a/mozjs/js/rust/Cargo.toml b/mozjs/js/rust/Cargo.toml
-deleted file mode 100644
-index e0b4fe0..0000000
---- a/mozjs/js/rust/Cargo.toml
-+++ /dev/null
-@@ -1,49 +0,0 @@
--[package]
--name = "js"
--version = "0.1.4"
--authors = ["The Servo Project Developers"]
--build = "build.rs"
--license = "MPL-2.0"
--
--[build-dependencies]
--env_logger = {version = "0.4", default-features = false} # disable `regex` to reduce code size
--log = "0.3"
--bindgen = {version = "0.33.1", default-features = false} # disable `logging` to reduce code size
--cmake = "0.1"
--glob = "0.2.11"
--
--[[test]]
--name = "callback"
--[[test]]
--name = "enumerate"
--[[test]]
--name = "evaluate"
--[[test]]
--name = "panic"
--[[test]]
--name = "rooting"
--[[test]]
--name = "runtime"
--[[test]]
--name = "typedarray"
--[[test]]
--name = "stack_limit"
--[[test]]
--name = "vec_conversion"
--
--[lib]
--doctest = false
--
--[features]
--debugmozjs = ['mozjs_sys/debugmozjs']
--promises = ['mozjs_sys/promises']
--nonzero = []
--
--[dependencies.mozjs_sys]
--path = "../src"
--
--[dependencies]
--lazy_static = "0.2.1"
--libc = "0.2"
--log = "0.3"
--num-traits = "0.1.32"
-diff --git a/mozjs/js/src/Cargo.toml b/mozjs/js/src/Cargo.toml
-deleted file mode 100644
-index 4829b49..0000000
---- a/mozjs/js/src/Cargo.toml
-+++ /dev/null
-@@ -1,21 +0,0 @@
--[package]
--name = "mozjs_sys"
--version = "0.0.0"
--authors = ["Mozilla"]
--links = "mozjs"
--build = "build.rs"
--
--[features]
--debugmozjs = []
--promises = []
--
--[lib]
--name = "mozjs_sys"
--path = "lib.rs"
--
--[build-dependencies]
--num_cpus = "1.1.0"
--
--[dependencies]
--libc = "0.2"
--libz-sys = "1.0.16"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/backend/data/host-rust-library-features/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/backend/data/host-rust-library-features/Cargo.toml
-deleted file mode 100644
-index 2a883e4..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/backend/data/host-rust-library-features/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "hostrusttool"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/backend/data/host-rust-library/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/backend/data/host-rust-library/Cargo.toml
-deleted file mode 100644
-index 2a883e4..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/backend/data/host-rust-library/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "hostrusttool"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/backend/data/rust-library-features/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/backend/data/rust-library-features/Cargo.toml
-deleted file mode 100644
-index 756ab43..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/backend/data/rust-library-features/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "feature-library"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/backend/data/rust-library/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/backend/data/rust-library/Cargo.toml
-deleted file mode 100644
-index bde9b92..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/backend/data/rust-library/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "test-library"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/backend/data/rust-programs/code/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/backend/data/rust-programs/code/Cargo.toml
-deleted file mode 100644
-index 85da1ca..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/backend/data/rust-programs/code/Cargo.toml
-+++ /dev/null
-@@ -1,10 +0,0 @@
--[package]
--authors = ["nobody <nobody@mozilla.org>"]
--name = "testing"
--version = "0.0.1"
--
--[[bin]]
--name = "target"
--
--[[bin]]
--name = "host"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/Cargo.toml
-deleted file mode 100644
-index 99d10b1..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/Cargo.toml
-+++ /dev/null
-@@ -1,18 +0,0 @@
--[package]
--name = "random-crate"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[dependencies]
--deep-crate = { version = "0.1.0", path = "the/depths" }
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/shallow/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/shallow/Cargo.toml
-deleted file mode 100644
-index c347f8c..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/shallow/Cargo.toml
-+++ /dev/null
-@@ -1,6 +0,0 @@
--[package]
--name = "shallow-crate"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/the/depths/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/the/depths/Cargo.toml
-deleted file mode 100644
-index 10a4ded..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/crate-dependency-path-resolution/the/depths/Cargo.toml
-+++ /dev/null
-@@ -1,9 +0,0 @@
--[package]
--name = "deep-crate"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[dependencies]
--shallow-crate = { path = "../../shallow" }
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/host-rust-libraries/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/host-rust-libraries/Cargo.toml
-deleted file mode 100644
-index c1d2579..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/host-rust-libraries/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "host-lib"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/host-rust-program-nonexistent-name/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/host-rust-program-nonexistent-name/Cargo.toml
-deleted file mode 100644
-index 6b727da..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/host-rust-program-nonexistent-name/Cargo.toml
-+++ /dev/null
-@@ -1,7 +0,0 @@
--[package]
--authors = ["nobody <nobody@mozilla.org>"]
--name = "testing"
--version = "0.0.1"
--
--[[bin]]
--name = "some"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/host-rust-programs/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/host-rust-programs/Cargo.toml
-deleted file mode 100644
-index 6b727da..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/host-rust-programs/Cargo.toml
-+++ /dev/null
-@@ -1,7 +0,0 @@
--[package]
--authors = ["nobody <nobody@mozilla.org>"]
--name = "testing"
--version = "0.0.1"
--
--[[bin]]
--name = "some"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/Cargo.toml
-deleted file mode 100644
-index 9037d8f..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "rust1"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/Cargo.toml
-deleted file mode 100644
-index f200189..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "rust2"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/Cargo.toml
-deleted file mode 100644
-index fa122b7..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-dash-folding/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "random-crate"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-duplicate-features/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-duplicate-features/Cargo.toml
-deleted file mode 100644
-index fa122b7..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-duplicate-features/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "random-crate"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-features/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-features/Cargo.toml
-deleted file mode 100644
-index fa122b7..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-features/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "random-crate"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["staticlib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/Cargo.toml
-deleted file mode 100644
-index 26c653f..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-invalid-crate-type/Cargo.toml
-+++ /dev/null
-@@ -1,15 +0,0 @@
--[package]
--name = "random-crate"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[lib]
--crate-type = ["dylib"]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/Cargo.toml
-deleted file mode 100644
-index 41a9a7c..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-name-mismatch/Cargo.toml
-+++ /dev/null
-@@ -1,12 +0,0 @@
--[package]
--name = "deterministic-crate"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/Cargo.toml
-deleted file mode 100644
-index a20b19c..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-library-no-lib-section/Cargo.toml
-+++ /dev/null
-@@ -1,12 +0,0 @@
--[package]
--name = "random-crate"
--version = "0.1.0"
--authors = [
--  "Nobody <nobody@mozilla.org>",
--]
--
--[profile.dev]
--panic = "abort"
--
--[profile.release]
--panic = "abort"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-program-nonexistent-name/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-program-nonexistent-name/Cargo.toml
-deleted file mode 100644
-index 6b727da..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-program-nonexistent-name/Cargo.toml
-+++ /dev/null
-@@ -1,7 +0,0 @@
--[package]
--authors = ["nobody <nobody@mozilla.org>"]
--name = "testing"
--version = "0.0.1"
--
--[[bin]]
--name = "some"
-diff --git a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-programs/Cargo.toml b/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-programs/Cargo.toml
-deleted file mode 100644
-index 6b727da..0000000
---- a/mozjs/python/mozbuild/mozbuild/test/frontend/data/rust-programs/Cargo.toml
-+++ /dev/null
-@@ -1,7 +0,0 @@
--[package]
--authors = ["nobody <nobody@mozilla.org>"]
--name = "testing"
--version = "0.0.1"
--
--[[bin]]
--name = "some"
-diff --git a/mozjs/testing/mozbase/rust/mozprofile/Cargo.toml b/mozjs/testing/mozbase/rust/mozprofile/Cargo.toml
-deleted file mode 100644
-index b270600..0000000
---- a/mozjs/testing/mozbase/rust/mozprofile/Cargo.toml
-+++ /dev/null
-@@ -1,10 +0,0 @@
--[package]
--name = "mozprofile"
--version = "0.3.0"
--authors = ["Mozilla Tools and Automation <auto-tools@mozilla.com>"]
--description = "Library for working with Mozilla profiles."
--repository = "https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/rust/mozprofile"
--license = "MPL-2.0"
--
--[dependencies]
--tempdir = "0.3.4"
-diff --git a/mozjs/testing/mozbase/rust/mozrunner/Cargo.toml b/mozjs/testing/mozbase/rust/mozrunner/Cargo.toml
-deleted file mode 100644
-index 41e3fb0..0000000
---- a/mozjs/testing/mozbase/rust/mozrunner/Cargo.toml
-+++ /dev/null
-@@ -1,17 +0,0 @@
--[package]
--name = "mozrunner"
--version = "0.5.0"
--authors = ["Mozilla Tools and Automation <auto-tools@mozilla.com>"]
--description = "Library for starting Firefox binaries."
--repository = "https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/rust/mozrunner"
--license = "MPL-2.0"
--
--[dependencies]
--log = "0.4"
--mozprofile = { path = "../mozprofile" }
--
--[target.'cfg(target_os = "windows")'.dependencies]
--winreg = "0.5"
--
--[[bin]]
--name = "firefox-default-path"
-diff --git a/mozjs/testing/mozbase/rust/mozversion/Cargo.toml b/mozjs/testing/mozbase/rust/mozversion/Cargo.toml
-deleted file mode 100644
-index 30daf0d..0000000
---- a/mozjs/testing/mozbase/rust/mozversion/Cargo.toml
-+++ /dev/null
-@@ -1,13 +0,0 @@
--[package]
--name = "mozversion"
--version = "0.1.2"
--authors = ["James Graham <james@hoppipolla.co.uk>"]
--description = "Utility for accessing Firefox version metadata"
--keywords = ["mozilla", "firefox"]
--repository = "https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/rust/mozversion"
--license = "MPL-2.0"
--
--[dependencies]
--regex = "0.2"
--rust-ini = "0.10.2"
--semver = "0.6"
diff --git a/etc/update.py b/etc/update.py
index b42f8a9f82..cfb927bf30 100644
--- a/etc/update.py
+++ b/etc/update.py
@@ -32,6 +32,20 @@ def extract_tarball(tarball):
     subprocess.check_call(["git", "add", "--all", TARGET], stdout=subprocess.DEVNULL)
     subprocess.check_call(["git", "commit", "-m", "Update SpiderMonkey"], stdout=subprocess.DEVNULL)
 
+def remove_cargo_tomls():
+    print("Removing all Cargo.toml files.")
+
+    problem_dirs = [
+        os.path.join("mozjs", "js"),
+        os.path.join("mozjs", "python"),
+        os.path.join("mozjs", "testing"),
+    ]
+    for dir in problem_dirs:
+        for root, dir, files in os.walk(dir):
+            for file in files:
+                if file == "Cargo.toml":
+                    subprocess.check_call(["git", "rm", os.path.join(root, file)])
+
 def apply_patches():
     print("Applying patches.")
 
@@ -44,7 +58,7 @@ def apply_patches():
 
     for p in patches:
         print("  Applying patch: %s." % p)
-        subprocess.check_call(["git", "am", p], stdout=subprocess.DEVNULL)
+        subprocess.check_call(["git", "apply", p], stdout=subprocess.DEVNULL)
 
 def generate_configure():
     print("Generating configure.")
@@ -61,9 +75,23 @@ def generate_configure():
     subprocess.check_call(["git", "commit", "-m", "Generate configure."], stdout=subprocess.DEVNULL)
 
 def main(args):
-    extract_tarball(os.path.abspath(args[0]))
-    apply_patches()
-    generate_configure()
+    extract = None
+    patch = True
+    configure = True
+    for arg in args:
+        if arg == "--no-patch":
+            patch = False
+        elif arg == "--no-configure":
+            configure = False
+        else:
+            extract = arg
+    if extract:
+        extract_tarball(os.path.abspath(extract))
+    if patch:
+        remove_cargo_tomls()
+        apply_patches()
+    if configure:
+        generate_configure()
 
 if __name__ == "__main__":
     import sys
