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

Issue 23876012: Fix polymer build steps so we don't trust existing packages symlinks or folders. (Closed)

Created:
7 years, 3 months ago by Siggi Cherem (dart-lang)
Modified:
7 years, 3 months ago
Reviewers:
Jennifer Messerly
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fixes in polymer build related to 'packages': - we don't trust existing packages symlinks or folders. - create relative symlinks so subfolders can be valid entrypoints Fixes for: dartbug.com/13219 dartbug.com/13185 R=jmesserly@google.com Committed: https://code.google.com/p/dart/source/detail?r=27435

Patch Set 1 #

Patch Set 2 : #

Total comments: 15

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -44 lines) Patch
M pkg/polymer/lib/src/barback_runner.dart View 1 2 1 chunk +129 lines, -43 lines 0 comments Download
M pkg/polymer/test/run.sh View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Siggi Cherem (dart-lang)
https://codereview.chromium.org/23876012/diff/3001/pkg/polymer/lib/src/barback_runner.dart File pkg/polymer/lib/src/barback_runner.dart (left): https://codereview.chromium.org/23876012/diff/3001/pkg/polymer/lib/src/barback_runner.dart#oldcode195 pkg/polymer/lib/src/barback_runner.dart:195: Future _emitFiles(Barback barback, BarbackOptions options, String emitSubDir) { this ...
7 years, 3 months ago (2013-09-11 23:54:58 UTC) #1
Siggi Cherem (dart-lang)
just to clarify what this change does in terms of layout: before: web/ | packages/... ...
7 years, 3 months ago (2013-09-11 23:56:22 UTC) #2
Jennifer Messerly
Some suggestions, but LGTM with or without them :) https://codereview.chromium.org/23876012/diff/3001/pkg/polymer/lib/src/barback_runner.dart File pkg/polymer/lib/src/barback_runner.dart (left): https://codereview.chromium.org/23876012/diff/3001/pkg/polymer/lib/src/barback_runner.dart#oldcode195 pkg/polymer/lib/src/barback_runner.dart:195: ...
7 years, 3 months ago (2013-09-12 02:45:03 UTC) #3
Siggi Cherem (dart-lang)
Thanks! https://codereview.chromium.org/23876012/diff/3001/pkg/polymer/lib/src/barback_runner.dart File pkg/polymer/lib/src/barback_runner.dart (right): https://codereview.chromium.org/23876012/diff/3001/pkg/polymer/lib/src/barback_runner.dart#newcode280 pkg/polymer/lib/src/barback_runner.dart:280: void _deleteIfPresent(var packagesPath) { On 2013/09/12 02:45:03, John ...
7 years, 3 months ago (2013-09-12 16:53:14 UTC) #4
Siggi Cherem (dart-lang)
Committed patchset #3 manually as r27435 (presubmit successful).
7 years, 3 months ago (2013-09-12 16:53:51 UTC) #5
Jennifer Messerly
7 years, 3 months ago (2013-09-12 17:53:47 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/23876012/diff/3001/pkg/polymer/lib/src/barbac...
File pkg/polymer/lib/src/barback_runner.dart (right):

https://codereview.chromium.org/23876012/diff/3001/pkg/polymer/lib/src/barbac...
pkg/polymer/lib/src/barback_runner.dart:293: var file = new File(packagesPath);
On 2013/09/12 16:53:14, Siggi Cherem (dart-lang) wrote:
> On 2013/09/12 02:45:03, John Messerly wrote:
> > do you actually need to check for all 3 kinds of things?
> > 
> > from a few quick tests:
> > 
> > * new File(path).deleteSync() works on symlinks
> > * new Directory(path).deleteSync(recursive: true) works on symlinks, and
will
> > not delete contents.
> > * new Directory(path).deleteSync(recursive: true) works on files too
> > 
> > this makes me think that `new Directory(path).deleteSync(recursive: true)`
is
> > all you need here.
> > 
> > ... combining this with the earlier suggestion, perhaps just this?
> > 
> > void _deleteIfPresent(String path) {
> >   try {
> >     new Directory(path).deleteSync(recursive: true);
> >   } on DirectoryException catch (e) {}
> > }
> > 
> > 
> > For the record, I didn't try this on any OS except Linux, so no promises...
:)
> 
> I'm a little paranoid on whether this works in Windows. I just found  that pub
> has a similar pattern, they basically do the 3 checks as well.

yeah, I wonder though. Pub can be a tricky place to copy code from; as the first
big thing using dart:io cross platform, they developed a lot of crazy
workarounds, and sometimes the original bug has been fixed for a long time :).


anyway, if the pattern is required, it seems like it should be in a
library/package somewhere. (it's a pet peeve of mine when something simple like
"delete this path if it exists" becomes a 15 line function ;) )

Powered by Google App Engine
This is Rietveld 408576698