juergbi commented on code in PR #1997:
URL: https://github.com/apache/buildstream/pull/1997#discussion_r2028451472


##########
src/buildstream/downloadablefilesource.py:
##########
@@ -270,6 +270,13 @@ def fetch(self):  # pylint: disable=arguments-differ
                 "File downloaded from {} has sha256sum '{}', not 
'{}'!".format(self.url, sha256, self.ref)
             )
 
+    def collect_source_info(self):
+        #
+        # XXX remote sources are not necessarily archives, perhaps we should
+        # allow downloadablefilesource imlementations to choose the 
SourceInfoMedium
+        #
+        return [SourceInfo(self.url, SourceInfoMedium.ARCHIVE, 
SourceVersionType.SHA256, self.ref)]

Review Comment:
   I forgot that `self.url` won't be a mirror URL outside `Source.fetch()` and 
`Source.track()`, so it should indeed be less of an issue. However, even the 
original URL is not part of the cache key, so changing the alias definition 
would still result in `collect_source_info()` without a cache key change. Or am 
I missing something else? Maybe this is acceptable but we should at least be 
aware of this.
   
   > I would further like to protect against any "original URL" mangling would 
could result from junctioning and alias mappings, but I'm pretty sure that the 
alias mapping feature used for mirror plugins does not affect what the original 
upstream URLs would be.
   
   I'm not sure whether that's the case. Won't the alias definition from the 
parent project be used if the alias from the subproject is mapped in the 
junction? That alias definition could potentially point to a different URL 
without affecting the cache key.



-- 
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