dart-lang / pub

The pub command line tool
https://dart.dev/tools/pub/cmd
BSD 3-Clause "New" or "Revised" License
1.03k stars 225 forks source link

pub deploy (with polymer?) not working if sdk is inside project directory #787

Closed DartBot closed 9 years ago

DartBot commented 9 years ago

Issue by hpoul Originally opened as dart-lang/sdk#15688


What steps will reproduce the problem?

  1. extract/copy dart-sdk directly into a polymer app e.g. cp -r $DART_SDK deps/dart-sdk
  2. run: deps/dart-sdk/bin/pub deploy

What is the expected output? What do you see instead? i either expect useful error messages, or more preferable that it simply builds :-)

What version of the product are you using? On what operating system? 1.1.0-dev.4.0 (tried it on debian with a patched dart sdk release and on mac osx with an official release)

Please provide any additional information below. the first question is probably why would that ever be required.. i have a jenkins build server where i simply downloaded dart as a dependency into the workspace of the project beeing built.. (the project specifies the required dart version, so i didn't want to have it installed globally) .. it's still arguable if it's really a good idea.. but anyway

the error messages are: jenkins@build-slave:~/workspace/worktrail_dart_polymer_ui$ deps/dart-sdk/bin/pub deploy Building worktrail_webui...... [Dart2JS]: Error: Can't read 'file:///var/lib/jenkins/workspace/worktrail_dart_polymer_ui/deps/dart-sdk/lib/_internal/lib/js_helper.dart' (Transform Dart2JS on worktrail_webui|web/timetracking.html_bootstrap.dart tried to load missing input worktrail_webui|deps/dart-sdk/lib/_internal/lib/js_helper.dart.). [Dart2JS]: Error: Can't read 'file:///var/lib/jenkins/workspace/worktrail_dart_polymer_ui/deps/dart-sdk/lib/_internal/lib/interceptors.dart' (Transform Dart2JS on worktrail_webui|web/timetracking.html_bootstrap.dart tried to load missing input worktrail_webui|deps/dart-sdk/lib/_internal/lib/interceptors.dart.). The compiler is broken.

When compiling the above element, the compiler crashed. It is not possible to tell if this is caused by a problem in your program or not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (build number could not be determined), and

* the entire message you see here (including the full stack trace   below as well as the source location above).

[Dart2JS]: file:///var/lib/jenkins/workspace/worktrail_dart_polymer_ui/web/timetracking.html_bootstrap.dart: Error: The compiler crashed when compiling this element. Build error: Transform Dart2JS on worktrail_webui|web/timetracking.html_bootstrap.dart threw error: The null object does not have a method 'find'.

NoSuchMethodError : method not found: 'find' Receiver: null Arguments: ["assertHelper"] dart:core Object.noSuchMethod ../../../../../mnt/data/b/build/slave/dart-editor-linux-dev/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 948 Compiler.scanBuiltinLibraries.<fn> dart:isolate _RawReceivePortImpl._handleMessage

Build failed.

which really confuses me, is that the path to js_helpers.dart it can't read is actually correct so it's probably some rewrite problem: jenkins@build-slave:~/workspace/worktrail_dart_polymer_ui$ ls -l /var/lib/jenkins/workspace/worktrail_dart_polymer_ui/deps/dart-sdk/lib/_internal/lib/js_helper.dart -rw------- 1 jenkins jenkins 93526 Dec 13 03:14 /var/lib/jenkins/workspace/worktrail_dart_polymer_ui/deps/dart-sdk/lib/_internal/lib/js_helper.dart

when i simply move the dart-sdk outside of the projects root directory it is working: jenkins@build-slave:~/workspace/worktrail_dart_polymer_ui$ cp -r deps/dart-sdk /var/tmp jenkins@build-slave:~/workspace/worktrail_dart_polymer_ui$ /var/tmp/dart-sdk/bin/pub deploy Building worktrail_webui......... [...] web/timetracking.html_bootstrap.dart:1:1: Hint: 6978 methods retained for use by dart:mirrors out of 10335 total methods (68%).

Built 265 files! jenkins@build-slave:~/workspace/worktrail_dart_polymer_ui$

DartBot commented 9 years ago

Comment by floitschG


Added Area-Pub, Triaged labels.

DartBot commented 9 years ago

Comment by nex3


Bob, could this be caused by the dart2js transformer being too aggressive about translating dart2js's file load requests into barback requests? Should we have it only translate them for files in web/ or lib/?


cc @munificent.

DartBot commented 9 years ago

Comment by munificent


Bob, could this be caused by the dart2js transformer being too aggressive about translating dart2js's file load requests into barback requests? Should we have it only translate them for files in web/ or lib/?

Yeah that's exactly right. The dart2js transformer shunts anything in the package's directory to barback. Meanwhile, we only add sources to barback for the whitelisted web/, lib/, and asset/ directories. Since the file in question here is in "deps", it's falling through the cracks.

DartBot commented 9 years ago

Comment by munificent


Set owner to @munificent. Added Started label.

DartBot commented 9 years ago

Comment by munificent


Added Fixed label.