sophie-h commented on code in PR #62:
URL: 
https://github.com/apache/buildstream-plugins/pull/62#discussion_r1530650012


##########
src/buildstream_plugins/sources/cargo.py:
##########
@@ -386,15 +704,24 @@ def track(self, *, previous_sources_dir):
         return new_ref
 
     def stage(self, directory):
-
         # Stage the crates into the vendor directory
         vendor_dir = os.path.join(directory, self.vendor_dir)
+
+        git_repos = set()
         for crate in self.crates:
             crate.stage(vendor_dir)
+            if isinstance(crate, CrateGit):
+                git_repos.add(crate.repo)
+
+        # Every git repo needs an extra entry in the config
+        # Using a set since the config entry cannot appear twice
+        vendor_cfg_git = ""
+        for repo in git_repos:
+            vendor_cfg_git += _git_vendor_config_template.format(git_repo=repo)
 
         # Stage our vendor config
         vendor_config = _default_vendor_config_template.format(
-            vendorurl=self.translate_url(self.url), vendordir=self.vendor_dir
+            vendorurl=self.translate_url(self.url), vendordir=self.vendor_dir, 
git_vendors=vendor_cfg_git

Review Comment:
   Has this ever been tested? Translating the URL here seems wrong at first 
glance. Cargo will still be looking up the original URL that's in the 
Cargo.lock file and doesn't know anything about buildstream using a mirror to 
download the files and also doesn't need to know. Or am I missing something?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to