Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Issue 11151035: Download packages to temp dir inside system cache. (Closed)

Created:
8 years, 2 months ago by Bob Nystrom
Modified:
8 years, 2 months ago
Reviewers:
nweiz, dgrove, kasperl
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Download packages to temp dir inside system cache. This fixes an issue where the rename will fail if your system temp directory is on a different volume from your user directory (and thus your pub cache). Committed: https://code.google.com/p/dart/source/detail?r=13674

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -2 lines) Patch
M utils/pub/hosted_source.dart View 1 chunk +2 lines, -1 line 0 comments Download
M utils/pub/pub.dart View 3 chunks +4 lines, -1 line 1 comment Download
M utils/pub/system_cache.dart View 3 chunks +24 lines, -0 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
Bob Nystrom
Dan, this fixes an issue John discovered where pub install doesn't work on his machine ...
8 years, 2 months ago (2012-10-16 02:31:41 UTC) #1
kasperl
LGTM. https://codereview.chromium.org/11151035/diff/1/utils/pub/pub.dart File utils/pub/pub.dart (right): https://codereview.chromium.org/11151035/diff/1/utils/pub/pub.dart#newcode224 utils/pub/pub.dart:224: future = future.chain((_) => cache_.deleteTempDir()); I guess this ...
8 years, 2 months ago (2012-10-16 06:08:50 UTC) #2
ricow1
On 2012/10/16 06:08:50, kasperl wrote: > LGTM. > > https://codereview.chromium.org/11151035/diff/1/utils/pub/pub.dart > File utils/pub/pub.dart (right): > ...
8 years, 2 months ago (2012-10-16 06:21:18 UTC) #3
Bob Nystrom
8 years, 2 months ago (2012-10-16 14:10:22 UTC) #4
On 2012/10/16 06:21:18, ricow1 wrote:
> On 2012/10/16 06:08:50, kasperl wrote:
> > LGTM.
> > 
> > https://codereview.chromium.org/11151035/diff/1/utils/pub/pub.dart
> > File utils/pub/pub.dart (right):
> > 
> >
https://codereview.chromium.org/11151035/diff/1/utils/pub/pub.dart#newcode224
> > utils/pub/pub.dart:224: future = future.chain((_) =>
cache_.deleteTempDir());
> > I guess this should always be done (also in the exception case), but let's
not
> > mess with that now.

This is intentional (for now). I wanted to keep the patch as simple as possible.
I tried .onComplete() which should be the right way to do this, but I couldn't
get it to work and that corner of Future isn't well-used.

On the off chance that you do fail and leave stuff in _temp, it will just get
cleaned out the next time around.

> > https://codereview.chromium.org/11151035/diff/1/utils/pub/system_cache.dart
> > File utils/pub/system_cache.dart (right):
> > 
> >
>
https://codereview.chromium.org/11151035/diff/1/utils/pub/system_cache.dart#n...
> > utils/pub/system_cache.dart:85: return ensureDir(join(rootDir,
> > '_temp')).chain((tempDir) {
> > Rename tempDir variable to avoid shadowing the getter? I'd suggest temp.

I don't have a strong preference one way or the other, but at least in the pub
code base, we don't tend to worry about shadowing too much.

> > 
> > Use tempDir instead of join(rootDir, '_temp').
> I landed this with Kaspers suggestion incorporated (I did not upload a new
> patchset to rietveld since I am using svn)

Thank you!

Powered by Google App Engine
This is Rietveld 408576698