- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.7k
Add more information to wait-for-publish #11713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
261249a
              5bea4ab
              7b19a6e
              7e4764a
              f60666c
              7b317f3
              3c295cf
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -44,6 +44,9 @@ pub trait Source { | |
| /// Ensure that the source is fully up-to-date for the current session on the next query. | ||
| fn invalidate_cache(&mut self); | ||
|  | ||
| /// If quiet, the source should not display any progress or status messages. | ||
| fn set_quiet(&mut self, quiet: bool); | ||
| 
      Comment on lines
    
      +47
     to 
      +48
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, don't we cache sources generally (and the "wait" logic has to workaround that)? I feel like mutating a cached item like this is pretty brittle (in an already brittle system) and I'd hope we can find a way to avoid making it worse. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I follow. Sources are inherently mutable. I'm not sure I would say they are "cached" so much as they are lazily created as needed and held in the  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As for the caching / lazy loading, I don't remember the details but I do remember running into a lot of problems implementing this because I was getting stale state due to caches that said "everything is loaded, no reason to talk to the server again". 
 From my quick glance, they are mutated as-needed in that you invalidate their cache and they reload. I didn't see any other real "state" to them that could leak from one operation to another. That is what I'm concerned about. As I said, I ran into a lot of problems with cargo assuming everything was only done once because commands are transient but when a command needed to do things multiple times, they broke. While I am not refreshed on all the details to map out whether its actually safe or not, this feels like one of those things that could easily cause people problems in the future. | ||
|  | ||
| /// Fetches the full package for each name and version specified. | ||
| fn download(&mut self, package: PackageId) -> CargoResult<MaybePackage>; | ||
|  | ||
|  | @@ -163,6 +166,10 @@ impl<'a, T: Source + ?Sized + 'a> Source for Box<T> { | |
| (**self).invalidate_cache() | ||
| } | ||
|  | ||
| fn set_quiet(&mut self, quiet: bool) { | ||
| (**self).set_quiet(quiet) | ||
| } | ||
|  | ||
| /// Forwards to `Source::download`. | ||
| fn download(&mut self, id: PackageId) -> CargoResult<MaybePackage> { | ||
| (**self).download(id) | ||
|  | @@ -233,6 +240,10 @@ impl<'a, T: Source + ?Sized + 'a> Source for &'a mut T { | |
| (**self).invalidate_cache() | ||
| } | ||
|  | ||
| fn set_quiet(&mut self, quiet: bool) { | ||
| (**self).set_quiet(quiet) | ||
| } | ||
|  | ||
| fn download(&mut self, id: PackageId) -> CargoResult<MaybePackage> { | ||
| (**self).download(id) | ||
| } | ||
|  | ||
Uh oh!
There was an error while loading. Please reload this page.