polymer-dart / todo_ddc

15 stars 3 forks source link

Building on Windows #8

Closed rillomas closed 7 years ago

rillomas commented 7 years ago

I tried building this on Windows 10 Pro x64, but got the following error

λ pub run polymerize:polymerize build
2017.32.08 21:32:48.893 polymerize      [INFO]: Updating build files ... (rules=v0.12.5, dart=C:\tools\dart-sdk\bin)
2017.32.08 21:32:49.155 polymerize      [SEVERE]:       ERROR: Unsupported operation: PackageInfo.loadConfig doesn't support URI scheme "c:".
 AT: package:package_resolver/src/utils.dart 37                   loadConfigMap
package:package_resolver/src/sync_package_resolver.dart 107  SyncPackageResolver.loadConfig
package:package_resolver/src/package_resolver.dart 100       PackageResolver.loadConfig
package:polymerize/src/dep_analyzer.dart 120                 InternalContext._init
package:polymerize/src/dep_analyzer.dart 86                  InternalContext.create.<fn>
dart:collection                                              _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent
package:polymerize/src/dep_analyzer.dart 84                  InternalContext.create
package:polymerize/src/dep_analyzer.dart 257                 WorkspaceBuilder.build
package:polymerize/src/dep_analyzer.dart 242                 WorkspaceBuilder.create
package:polymerize/src/build_command.dart 29                 build
package:polymerize/polymerize.dart 176                       processRequestArgs
package:polymerize/polymerize.dart 135                       _main
package:polymerize/polymerize.dart 43                        main.<fn>
package:stack_trace                                          Chain.capture
package:polymerize/polymerize.dart 42                        main
http://localhost:60351/polymerize.dart 3                     main
===== asynchronous gap ===========================
dart:async                                                   _Completer.completeError
package:package_resolver/src/utils.dart 42                   loadConfigMap
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:package_resolver/src/utils.dart 20                   loadConfigMap
package:package_resolver/src/sync_package_resolver.dart 107  SyncPackageResolver.loadConfig
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:package_resolver/src/sync_package_resolver.dart 104  SyncPackageResolver.loadConfig
package:package_resolver/src/package_resolver.dart 100       PackageResolver.loadConfig
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:package_resolver/src/package_resolver.dart 99        PackageResolver.loadConfig
package:polymerize/src/dep_analyzer.dart 120                 InternalContext._init
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/dep_analyzer.dart 109                 InternalContext._init
package:polymerize/src/dep_analyzer.dart 86                  InternalContext.create.<fn>
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/dep_analyzer.dart 84                  InternalContext.create.<fn>
dart:collection                                              _HashVMBase&MapMixin&&_LinkedHashMapMixin.putIfAbsent
package:polymerize/src/dep_analyzer.dart 84                  InternalContext.create
package:polymerize/src/dep_analyzer.dart 257                 WorkspaceBuilder.build
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/dep_analyzer.dart 251                 WorkspaceBuilder.build
package:polymerize/src/dep_analyzer.dart 242                 WorkspaceBuilder.create
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/dep_analyzer.dart 237                 WorkspaceBuilder.create
package:polymerize/src/build_command.dart 29                 build
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/src/build_command.dart 10                 build
package:polymerize/polymerize.dart 176                       processRequestArgs
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/polymerize.dart 166                       processRequestArgs
package:polymerize/polymerize.dart 135                       _main
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/polymerize.dart 53                        _main
package:polymerize/polymerize.dart 43                        main.<fn>
===== asynchronous gap ===========================
dart:async                                                   Future.Future.microtask
package:polymerize/polymerize.dart 42                        main.<fn>
package:stack_trace                                          Chain.capture
package:polymerize/polymerize.dart 42                        main

Unsupported operation: PackageInfo.loadConfig doesn't support URI scheme "c:".
Unsupported operation: PackageInfo.loadConfig doesn't support URI scheme "c:".

My environment is the following:

dam0vm3nt commented 7 years ago

Sorry never tested on windows. I see there's some problem with how path s are handled. I'll try it on a VM to see if it can be fixed easlily.

dam0vm3nt commented 7 years ago

Try with latest polymerize. It doesn't use bazel anymore because dart 1.24 had built-in support for DDc.

rillomas commented 7 years ago

Hi @dam0vm3nt I cloned 8658d5bcf1189582b3bfc260f04f968b22fd4d28, upgraded to dart 1.24.0 and ran pub build, and this time got a different error.

λ pub build
Loading source assets...
Loading polymerize transformers...
Building todo_ddc...
[Info from BowerInstall on todo_ddc|web/bower.json]:
Downloading bower dependencies ...
Build error:
Transform BowerInstall on todo_ddc|web/bower.json threw error: 指定されたファイルが見つかりません。

  Command: bower install
package:polymerize/src/transformers.dart 316  BowerInstallTransformer.apply
===== asynchronous gap ===========================
package:$pub/serialize/transformer.dart 31    _serializeTransformer.<fn>.<fn>.<fn>
dart:async/future.dart 206                    new Future.sync
package:$pub/serialize/transformer.dart 30    _serializeTransformer.<fn>.<fn>
package:$pub/serialize.dart 150               respond.<fn>
dart:async/future.dart 206                    new Future.sync
package:$pub/serialize.dart 150               respond
package:$pub/serialize/transformer.dart 17    _serializeTransformer.<fn>
dart:async/zone.dart 1307                     _RootZone.runUnaryGuarded
dart:async/stream_impl.dart 330               _BufferingStreamSubscription._sendData
dart:async/stream_impl.dart 257               _BufferingStreamSubscription._add
dart:async/stream_controller.dart 796         _StreamController&&_SyncStreamControllerDispatch._sendData
dart:async/stream_controller.dart 667         _StreamController._add
dart:async/stream_controller.dart 613         _StreamController.add
dart:isolate-patch/isolate_patch.dart 151     _RawReceivePortImpl._handleMessage

package:polymerize/src/transformers.dart 316  BowerInstallTransformer.apply
===== asynchronous gap ===========================
package:$pub/serialize/transformer.dart 31    _serializeTransformer.<fn>.<fn>.<fn>
dart:async                                    new Future.sync
package:$pub/serialize/transformer.dart 30    _serializeTransformer.<fn>.<fn>
package:$pub/serialize.dart 150               respond.<fn>
dart:async                                    new Future.sync
package:$pub/serialize.dart 150               respond
package:$pub/serialize/transformer.dart 17    _serializeTransformer.<fn>
Build failed.

The error message 指定されたファイルが見つかりません。 means Specified file cannot be found

rillomas commented 7 years ago

I also tried pub serve with dartium, and it seems there is an exception occurring at index.dart

image

dam0vm3nt commented 7 years ago

mmh. I should check with a windows installation. Those errors are very strange. In particular for the bower.json I'm using a temporary folder, maybe it's not working for that reason (paths are different).

dam0vm3nt commented 7 years ago

also note that due to a bug in pub pub serve would only work from 1.24-1 on.

dam0vm3nt commented 7 years ago

also note that polymerize is using dartdevc. This means that by no means it will never work with dartium. You always have to use a normal browser. This is not a problem because reload times are faster with dartdevc than with dartium.

dam0vm3nt commented 7 years ago

published 0.9.1+1. Should work on windows too. Can you check please ?

rillomas commented 7 years ago

Thanks for the support @dam0vm3nt. I updated to dart-sdk 1.24.1 and tried pub get pub build with bd345c2308aefbaf8f449939dd776dddcc5f86c8, but unfortunately I'm getting the same error. pub serve displays the same error message too.

> pub build
Loading source assets...
Loading polymerize transformers...
Building todo_ddc...
[Info from BowerInstall on todo_ddc|web/bower.json]:
Downloading bower dependencies ...
Build error:
Transform BowerInstall on todo_ddc|web/bower.json threw error: 指定されたファイルが見つかりません。

  Command: bower install
package:polymerize/src/transformers.dart 316  BowerInstallTransformer.apply
===== asynchronous gap ===========================
package:$pub/serialize/transformer.dart 31    _serializeTransformer.<fn>.<fn>.<fn>
dart:async/future.dart 206                    new Future.sync
package:$pub/serialize/transformer.dart 30    _serializeTransformer.<fn>.<fn>
package:$pub/serialize.dart 150               respond.<fn>
dart:async/future.dart 206                    new Future.sync
package:$pub/serialize.dart 150               respond
package:$pub/serialize/transformer.dart 17    _serializeTransformer.<fn>
dart:async/zone.dart 1307                     _RootZone.runUnaryGuarded
dart:async/stream_impl.dart 330               _BufferingStreamSubscription._sendData
dart:async/stream_impl.dart 257               _BufferingStreamSubscription._add
dart:async/stream_controller.dart 796         _StreamController&&_SyncStreamControllerDispatch._sendData
dart:async/stream_controller.dart 667         _StreamController._add
dart:async/stream_controller.dart 613         _StreamController.add
dart:isolate-patch/isolate_patch.dart 151     _RawReceivePortImpl._handleMessage

package:polymerize/src/transformers.dart 316  BowerInstallTransformer.apply
===== asynchronous gap ===========================
package:$pub/serialize/transformer.dart 31    _serializeTransformer.<fn>.<fn>.<fn>
dart:async                                    new Future.sync
package:$pub/serialize/transformer.dart 30    _serializeTransformer.<fn>.<fn>
package:$pub/serialize.dart 150               respond.<fn>
dart:async                                    new Future.sync
package:$pub/serialize.dart 150               respond
package:$pub/serialize/transformer.dart 17    _serializeTransformer.<fn>
Build failed.
dam0vm3nt commented 7 years ago

I've tryied on my windows10 and it worked. Initially there was a problem because bower command on windows should be invoked as bower.cmd but 0.9.1+1 should have fixed that.

Can you please check if you have bower globally installed and if typing bower.cmd from the commandline does work ?

Can you also run the build with the -v flag and send me the output ? (pub build -v). It will be a big file, you can zip it and upload it somewhere if you want.

rillomas commented 7 years ago

I didn't have bower installed (I didn't know it was required). I installed bower 1.8.0 via chocolatey and tried again, however I'm still getting the same errors. I confirmed bower and bower.cmd both working on powershell.

Here is the pub build -v output : pub_build_output.zip

dam0vm3nt commented 7 years ago

Yes bower is needed , I'll add some better error messages to make people know it.

From the logs you have sent to me is like it is still not using latest polymerize (infact it is missing the Gathering transformer I have introduced in that version).

Can you please run a pub upgrade and retry the build ? please check the pub upgrade output to see if polymerize version 0.9.1+1 is downloaded and used.

rillomas commented 7 years ago

It seems to me that 0.9.1+1 is used. Here is the pub upgrade output

Resolving dependencies...
  analyzer 0.30.0+2
  archive 1.0.29
  args 0.13.7 (1.0.0 available)
  async 1.13.3
  barback 0.15.2+11
  bazel_worker 0.1.4
  built_collection 1.4.1
  charcode 1.1.1
  cli_util 0.1.1
  code_builder 1.0.4
  code_transformers 0.5.1+3
  collection 1.14.1
  convert 2.0.1
  crypto 2.0.1
  csslib 0.14.0
  dart_style 1.0.6
  fixnum 0.10.5
  front_end 0.1.0-alpha.4
  func 1.0.0
  glob 1.1.3
  homedir 0.0.4
  html 0.13.2
  html5 0.1.4
  http 0.11.3+13
  http_parser 3.1.1
  intl 0.15.1
  isolate 1.0.0
  js 0.6.1
  kernel 0.3.0-alpha.1
  logging 0.11.3+1
  logging_handlers 0.8.0
  matcher 0.12.1+1
  meta 1.0.5
  package_config 1.0.1
  package_resolver 1.0.2
  path 1.4.2
  plugin 0.2.0
  polymer_element 2.0.4
! polymer_elements 2.0.1 from git https://github.com/polymer-dart/polymerize_elements.git at 15691c (overridden)
  polymerize 0.9.1+1
  polymerize_common 1.0.1
  pool 1.3.1
  protobuf 0.5.4
  quiver 0.25.0
  resource 2.1.2
  source_maps 0.10.4
  source_span 1.4.0
  stack_trace 1.7.3
  string_scanner 1.0.2
  todo_common 0.0.1 from path todo_common
  todo_main 0.0.1 from path todo_main
  todo_renderer 0.0.1 from path todo_renderer
  typed_data 1.1.3
  utf 0.9.0+3
  watcher 0.9.7+3
  yaml 2.1.12
Warning: You are using these overridden dependencies:
! polymer_elements 2.0.1 from git https://github.com/polymer-dart/polymerize_elements.git at 15691c
No dependencies changed.

I even tried pub cache repair but had no luck.

dam0vm3nt commented 7 years ago

... and you repeated the build right ? I'll try again now from a clean env on my vm....

dam0vm3nt commented 7 years ago

BTW: if you want we can talk here for a better interaction

rillomas commented 7 years ago

Yes I did run pub build again after pub upgrade. Same exact error. Oh and thanks for the gitter link I'll have a look.

dam0vm3nt commented 7 years ago

Please can you download and extract
check.dart.zip

and run it with :

dart check.dart

On your system ? It should output the bower version.

dam0vm3nt commented 7 years ago

if it doesn't work try passing as an argument the path for bower.cmd :

dart check.dart c:\path\to\bower.cmd

Can you tell me if one which one of those will work (without arg or with arg)?

rillomas commented 7 years ago

OK I ran it and got the following:

PS C:\Users\masato\repos> dart .\check.dart
REs: 1.8.0
PS C:\Users\masato\repos> dart .\check.dart C:\Users\masato\AppData\Roaming\npm\bower.cmd
REs: 1.8.0
PS C:\Users\masato\repos> bower --version
1.8.0

Both versions are working.

dam0vm3nt commented 7 years ago

ok. I've published another version of polymerize (0.9.2) and updated the todo_ddc demo. can you try again from a clean workspace ?

I've added a sanity check for bower and it should not fail anymore if it doesn't find it.

With this version there's no way it fails with that error again. If it still fails there should be something else strange going on, then send me again the whole log.

rillomas commented 7 years ago

It's working! I cloned 48ccff03511c3b2ac5433039db1dfa39ab581bae, ran pub get and pub build with no errors. pub serve also seems to be working (tested with chrome 59). Thank you @dam0vm3nt !

dam0vm3nt commented 7 years ago

Good to know! You can also check the loader sample.