Bug 1324462 - Don't automatically upgrade dependent libraries when running |mach vendor rust|. r?ted draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 20 Dec 2016 09:08:03 -0500
changeset 451491 9f49463c1007089ab8ee28531e01eafd33b27e82
parent 451264 567894f026558e6dada617a3998f29aed06ac7d8
child 540048 548dd97b019b7bd4d99bd63a13bf2b4a3c8a81a9
push id39203
push userkgupta@mozilla.com
push dateTue, 20 Dec 2016 14:08:26 +0000
reviewersted
bugs1324462
milestone53.0a1
Bug 1324462 - Don't automatically upgrade dependent libraries when running |mach vendor rust|. r?ted This allows developers to manually upgrade packages as desired by running |cargo update -p <package>| or |cargo update| on gkrust and gkrust-gtest. Previously this update would happen implicitly as part of |mach vendor rust|, and made it hard to upgrade specific packages without upgrading everything. MozReview-Commit-ID: KuG1t96i5dT
python/mozbuild/mozbuild/vendor_rust.py
--- a/python/mozbuild/mozbuild/vendor_rust.py
+++ b/python/mozbuild/mozbuild/vendor_rust.py
@@ -71,16 +71,16 @@ Please commit or stash these changes bef
             self.run_process(args=[cargo, 'install', 'cargo-vendor'])
         else:
             self.log(logging.DEBUG, 'cargo_vendor', {}, 'cargo-vendor already intalled')
         vendor_dir = mozpath.join(self.topsrcdir, 'third_party/rust')
         self.log(logging.INFO, 'rm_vendor_dir', {}, 'rm -rf %s' % vendor_dir)
         mozfile.remove(vendor_dir)
         # Once we require a new enough cargo to switch to workspaces, we can
         # just do this once on the workspace root crate.
-        for crate_root in ('toolkit/library/rust/',
-                           'toolkit/library/gtest/rust'):
+        for (crate_root, lib) in (('toolkit/library/rust/', 'gkrust'),
+                                  ('toolkit/library/gtest/rust', 'gkrust-gtest')):
             path = mozpath.join(self.topsrcdir, crate_root)
-            self._run_command_in_srcdir(args=[cargo, 'generate-lockfile', '--manifest-path', mozpath.join(path, 'Cargo.toml')])
+            self._run_command_in_srcdir(args=[cargo, 'update', '--manifest-path', mozpath.join(path, 'Cargo.toml'), '-p', lib])
             self._run_command_in_srcdir(args=[cargo, 'vendor', '--sync', mozpath.join(path, 'Cargo.lock'), vendor_dir])
         #TODO: print stats on size of files added/removed, warn or error
         # when adding very large files (bug 1306078)
         self.repository.add_remove_files(vendor_dir)